Skip to content

Commit f164830

Browse files
committed
Enable phpstan level 2
1 parent bcf6162 commit f164830

File tree

14 files changed

+27
-15
lines changed

14 files changed

+27
-15
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ before_script:
99
- composer self-update
1010
- composer install --no-interaction --prefer-source
1111
- wget -O phpunit.phar https://phar.phpunit.de/phpunit-6.5.6.phar
12+
- if [ $TRAVIS_PHP_VERSION = "7.1" ]; then wget -O phpstan.phar https://github.com/phpstan/phpstan/releases/download/0.10.5/phpstan.phar ; fi
1213

1314
script:
1415
- php phpunit.phar --configuration ./build/travis-ci.phpunit.xml
16+
- if [ $TRAVIS_PHP_VERSION = "7.1" ]; then php phpstan.phar analyse --no-progress -c phpstan.neon; fi
1517

1618
after_success:
1719
- wget https://scrutinizer-ci.com/ocular.phar

phpstan.neon

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
parameters:
2+
level: 2
3+
paths:
4+
- %currentWorkingDirectory%/src/
5+
ignoreErrors:
6+
- '#Call to an undefined method SebastianFeldmann\\Ftp\\Client::delete\(\)#'
7+
- '#Call to an undefined method ObjectStorage_Abstract::setLocalFile\(\)#'
8+
- '#Instantiated class phpbu\\App\\Runner\\Restore not found#'
9+
- '#Cannot cast DateTimeImmutable to int#'
10+
- '#Cannot call method getTimestamp\(\) on string#'

src/Backup/Cleaner/Quantity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ protected function getFilesToDelete(Target $target, Collector $collector)
7676
/**
7777
* Returns true when the capacity is exceeded.
7878
*
79-
* @param array
79+
* @param array $files
8080
* @return bool
8181
*/
8282
private function isCapacityExceeded(array $files)

src/Backup/Crypter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function setup(array $options = []);
2727
* Checks the created backup.
2828
*
2929
* @param \phpbu\App\Backup\Target $target
30-
* @param \phpbu\App\Result
30+
* @param \phpbu\App\Result $result
3131
* @throws \phpbu\App\Exception
3232
*/
3333
public function crypt(Target $target, Result $result);

src/Backup/Source/Arangodump.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ protected function createExecutable(Target $target) : Executable
173173
/**
174174
* Create backup status.
175175
*
176-
* @param \phpbu\App\Backup\Target
176+
* @param \phpbu\App\Backup\Target $target
177177
* @return \phpbu\App\Backup\Source\Status
178178
*/
179179
protected function createStatus(Target $target) : Status

src/Backup/Source/Redis.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public function backup(Target $target, Result $result) : Status
123123
/**
124124
* Setup the Executable to run the 'tar' command.
125125
*
126-
* @param \phpbu\App\Backup\Target
126+
* @param \phpbu\App\Backup\Target $target
127127
* @return \phpbu\App\Cli\Executable
128128
*/
129129
protected function createExecutable(Target $target) : Executable
@@ -208,7 +208,7 @@ private function copyDumpToTarget(Target $target) : string
208208
/**
209209
* Create backup status.
210210
*
211-
* @param \phpbu\App\Backup\Target
211+
* @param \phpbu\App\Backup\Target $target
212212
* @return \phpbu\App\Backup\Source\Status
213213
*/
214214
protected function createStatus(Target $target) : Status

src/Backup/Source/Rsync.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function backup(Target $target, Result $result) : Status
5959
/**
6060
* Setup the Executable to run the 'rsync' command.
6161
*
62-
* @param \phpbu\App\Backup\Target
62+
* @param \phpbu\App\Backup\Target $target
6363
* @return \phpbu\App\Cli\Executable
6464
*/
6565
protected function createExecutable(Target $target) : Executable
@@ -86,7 +86,7 @@ protected function createExecutable(Target $target) : Executable
8686
/**
8787
* Create backup status.
8888
*
89-
* @param \phpbu\App\Backup\Target
89+
* @param \phpbu\App\Backup\Target $target
9090
* @return \phpbu\App\Backup\Source\Status
9191
*/
9292
protected function createStatus(Target $target) : Status

src/Backup/Source/Tar.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ public function backup(Target $target, Result $result) : Status
170170
/**
171171
* Setup the Executable to run the 'tar' command.
172172
*
173-
* @param \phpbu\App\Backup\Target
173+
* @param \phpbu\App\Backup\Target $target
174174
* @return \phpbu\App\Cli\Executable
175175
*/
176176
protected function createExecutable(Target $target) : Executable
@@ -216,7 +216,7 @@ private function validatePath()
216216
/**
217217
* Create backup status.
218218
*
219-
* @param \phpbu\App\Backup\Target
219+
* @param \phpbu\App\Backup\Target $target
220220
* @return \phpbu\App\Backup\Source\Status
221221
*/
222222
protected function createStatus(Target $target) : Status

src/Backup/Source/XtraBackup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ protected function createExecutable(Target $target) : Executable
150150
/**
151151
* Create backup status.
152152
*
153-
* @param \phpbu\App\Backup\Target
153+
* @param \phpbu\App\Backup\Target $target
154154
* @return \phpbu\App\Backup\Source\Status
155155
*/
156156
protected function createStatus(Target $target) : Status

src/Backup/Sync/AmazonS3v3.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ private function uploadStream(Target $target, S3Client $s3)
187187
*
188188
* @param \phpbu\App\Backup\Target $target
189189
* @param \Aws\S3\S3Client $s3
190-
* @param \Aws\Exception\MultipartUploadException
190+
* @throws \Aws\Exception\MultipartUploadException
191191
*/
192192
private function uploadMultiPart(Target $target, S3Client $s3)
193193
{

0 commit comments

Comments
 (0)