Skip to content

Commit

Permalink
Merge branch 'master' into 6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianfeldmann committed Jan 9, 2020
2 parents 1739a1a + 5ef79f9 commit 3b931ce
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 11 deletions.
3 changes: 1 addition & 2 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
github: # waiting to get approved to the beta
custom: https://www.paypal.me/kackb00n
github: sebastianfeldmann
5 changes: 5 additions & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ build:
coverage:
file: clover.xml
format: php-clover
nodes:
analysis:
tests:
override:
- php-scrutinizer-run
coding_style:
php:
spaces:
Expand Down
1 change: 1 addition & 0 deletions phpbu.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
<xs:enumeration value="gzip"/>
<xs:enumeration value="zip"/>
<xs:enumeration value="7zip"/>
<xs:enumeration value="xz"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
Expand Down
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
parameters:
level: 2
level: 3
paths:
- %currentWorkingDirectory%/src/
ignoreErrors:
Expand Down
7 changes: 5 additions & 2 deletions src/Backup/Cleaner/Capacity.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function setup(array $options)
*
* @param \phpbu\App\Backup\Target $target
* @param \phpbu\App\Backup\Collector $collector
* @return \phpbu\App\Backup\File\Local[]
* @return \phpbu\App\Backup\File[]
* @throws \phpbu\App\Exception
*/
protected function getFilesToDelete(Target $target, Collector $collector)
Expand All @@ -76,7 +76,7 @@ protected function getFilesToDelete(Target $target, Collector $collector)


// sum up the size of all backups
/** @var \phpbu\App\Backup\File\Local $file */
/** @var \phpbu\App\Backup\File $file */
foreach ($files as $file) {
$size += $file->getSize();
}
Expand All @@ -89,6 +89,9 @@ protected function getFilesToDelete(Target $target, Collector $collector)
while ($this->isCapacityExceeded($size) && count($files) > 0) {
// get oldest backup from list, move it to delete list
$file = array_shift($files);
if ($file === null) {
break;
}
$size -= $file->getSize();
$delete[] = $file;
}
Expand Down
5 changes: 4 additions & 1 deletion src/Backup/Cleaner/Quantity.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function setup(array $options)
*
* @param \phpbu\App\Backup\Target $target
* @param \phpbu\App\Backup\Collector $collector
* @return \phpbu\App\Backup\File\Local[]
* @return \phpbu\App\Backup\File[]
*/
protected function getFilesToDelete(Target $target, Collector $collector)
{
Expand All @@ -66,6 +66,9 @@ protected function getFilesToDelete(Target $target, Collector $collector)

while ($this->isCapacityExceeded($files)) {
$file = array_shift($files);
if ($file === null) {
break;
}
$delete[] = $file;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Backup/Cleaner/Stepwise.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ protected function setupRanges()
*
* @param \phpbu\App\Backup\Target $target
* @param \phpbu\App\Backup\Collector $collector
* @return \phpbu\App\Backup\File\Local[]
* @return \phpbu\App\Backup\File[]
* @throws \phpbu\App\Exception
*/
protected function getFilesToDelete(Target $target, Collector $collector)
Expand Down
2 changes: 1 addition & 1 deletion src/Backup/Cleaner/Stepwise/Keeper/OnePerGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class OnePerGroup implements Keeper
/**
* List of groups containing the files.
*
* @var \phpbu\App\Backup\File\Local[]
* @var \phpbu\App\Backup\File\Local[][]
*/
private $groups = [];

Expand Down
4 changes: 2 additions & 2 deletions src/Backup/Collector/Abstraction.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ abstract class Abstraction
/**
* Collection cache
*
* @var \phpbu\App\Backup\File\Local[]
* @var \phpbu\App\Backup\File[]
*/
protected $files;

Expand Down Expand Up @@ -67,7 +67,7 @@ public function setSimulation(bool $isSimulation)
/**
* Get all created backups.
*
* @return \phpbu\App\Backup\File\Local[]
* @return \phpbu\App\Backup\File[]
*/
public function getBackupFiles() : array
{
Expand Down
2 changes: 1 addition & 1 deletion src/Configuration/Loader/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ protected function getAdapterizedValue($value)
*
* @param string $filename
* @throws \phpbu\App\Exception
* @return \stdClass
* @return string
*/
protected function loadFile($filename)
{
Expand Down

0 comments on commit 3b931ce

Please sign in to comment.