Skip to content

Commit

Permalink
Merge pull request #1713 from aivchen/update-phpstan
Browse files Browse the repository at this point in the history
Update PHPStan and write down all errors to baseline file
  • Loading branch information
frankdejonge committed Oct 19, 2023
2 parents bd4c9b2 + 47523f6 commit e5608b5
Show file tree
Hide file tree
Showing 4 changed files with 155 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/.editorconfig export-ignore
/.php-cs-fixer.dist.php export-ignore
/phpstan.neon export-ignore
/phpstan-baseline.neon export-ignore
/phpunit.php export-ignore
/phpunit.xml.dist export-ignore
/.travis.yml export-ignore
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"ext-ftp": "*",
"microsoft/azure-storage-blob": "^1.1",
"phpunit/phpunit": "^9.5.11|^10.0",
"phpstan/phpstan": "^0.12.26",
"phpstan/phpstan": "^1.10",
"phpseclib/phpseclib": "^3.0.14",
"aws/aws-sdk-php": "^3.220.0",
"composer/semver": "^3.0",
Expand Down
150 changes: 150 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
parameters:
ignoreErrors:
-
message: "#^Parameter \\$connection of method League\\\\Flysystem\\\\Ftp\\\\FtpAdapter\\:\\:resolveConnectionRoot\\(\\) has invalid type FTP\\\\Connection\\.$#"
count: 1
path: src/Ftp/FtpAdapter.php

-
message: "#^Unsafe access to private property League\\\\Flysystem\\\\GoogleCloudStorage\\\\GoogleCloudStorageAdapter\\:\\:\\$algoToInfoMap through static\\:\\:\\.$#"
count: 1
path: src/GoogleCloudStorage/GoogleCloudStorageAdapter.php

-
message: "#^Unsafe access to private property League\\\\Flysystem\\\\GoogleCloudStorage\\\\GoogleCloudStorageAdapterTest\\:\\:\\$adapterPrefix through static\\:\\:\\.$#"
count: 3
path: src/GoogleCloudStorage/GoogleCloudStorageAdapterTest.php

-
message: "#^Unsafe access to private property League\\\\Flysystem\\\\GoogleCloudStorage\\\\GoogleCloudStorageAdapterTest\\:\\:\\$bucket through static\\:\\:\\.$#"
count: 5
path: src/GoogleCloudStorage/GoogleCloudStorageAdapterTest.php

-
message: "#^Unsafe access to private property League\\\\Flysystem\\\\GoogleCloudStorage\\\\GoogleCloudStorageAdapterTest\\:\\:\\$prefixer through static\\:\\:\\.$#"
count: 3
path: src/GoogleCloudStorage/GoogleCloudStorageAdapterTest.php

-
message: "#^Offset 2 does not exist on array\\{League\\\\Flysystem\\\\FilesystemOperator, string\\}\\.$#"
count: 1
path: src/MountManager.php

-
message: "#^Unsafe access to private property League\\\\Flysystem\\\\ZipArchive\\\\ZipArchiveAdapterTestCase\\:\\:\\$archiveProvider through static\\:\\:\\.$#"
count: 10
path: src/ZipArchive/ZipArchiveAdapterTestCase.php
-
message: "#^Parameter \\#1 \\$ftp of function ftp_chdir expects FTP\\\\Connection, resource given\\.$#"
count: 2
path: src/Ftp/FtpAdapter.php

-
message: "#^Parameter \\#1 \\$ftp of function ftp_chmod expects FTP\\\\Connection, resource given\\.$#"
count: 2
path: src/Ftp/FtpAdapter.php

-
message: "#^Parameter \\#1 \\$ftp of function ftp_delete expects FTP\\\\Connection, resource given\\.$#"
count: 1
path: src/Ftp/FtpAdapter.php

-
message: "#^Parameter \\#1 \\$ftp of function ftp_fget expects FTP\\\\Connection, resource given\\.$#"
count: 1
path: src/Ftp/FtpAdapter.php

-
message: "#^Parameter \\#1 \\$ftp of function ftp_fput expects FTP\\\\Connection, resource given\\.$#"
count: 1
path: src/Ftp/FtpAdapter.php

-
message: "#^Parameter \\#1 \\$ftp of function ftp_mdtm expects FTP\\\\Connection, resource given\\.$#"
count: 1
path: src/Ftp/FtpAdapter.php

-
message: "#^Parameter \\#1 \\$ftp of function ftp_mkdir expects FTP\\\\Connection, resource given\\.$#"
count: 1
path: src/Ftp/FtpAdapter.php

-
message: "#^Parameter \\#1 \\$ftp of function ftp_raw expects FTP\\\\Connection, resource given\\.$#"
count: 1
path: src/Ftp/FtpAdapter.php

-
message: "#^Parameter \\#1 \\$ftp of function ftp_rawlist expects FTP\\\\Connection, resource given\\.$#"
count: 1
path: src/Ftp/FtpAdapter.php

-
message: "#^Parameter \\#1 \\$ftp of function ftp_rename expects FTP\\\\Connection, resource given\\.$#"
count: 1
path: src/Ftp/FtpAdapter.php

-
message: "#^Parameter \\#1 \\$ftp of function ftp_rmdir expects FTP\\\\Connection, resource given\\.$#"
count: 1
path: src/Ftp/FtpAdapter.php

-
message: "#^Parameter \\#1 \\$ftp of function ftp_size expects FTP\\\\Connection, resource given\\.$#"
count: 2
path: src/Ftp/FtpAdapter.php

-
message: "#^Method League\\\\Flysystem\\\\Ftp\\\\FtpConnectionProvider\\:\\:createConnectionResource\\(\\) should return resource but returns FTP\\\\Connection\\.$#"
count: 1
path: src/Ftp/FtpConnectionProvider.php

-
message: "#^Parameter \\#1 \\$ftp of function ftp_close expects FTP\\\\Connection, resource given\\.$#"
count: 1
path: src/Ftp/FtpConnectionProvider.php

-
message: "#^Parameter \\#1 \\$ftp of function ftp_login expects FTP\\\\Connection, resource given\\.$#"
count: 1
path: src/Ftp/FtpConnectionProvider.php

-
message: "#^Parameter \\#1 \\$ftp of function ftp_pasv expects FTP\\\\Connection, resource given\\.$#"
count: 1
path: src/Ftp/FtpConnectionProvider.php

-
message: "#^Parameter \\#1 \\$ftp of function ftp_raw expects FTP\\\\Connection, resource given\\.$#"
count: 1
path: src/Ftp/FtpConnectionProvider.php

-
message: "#^Parameter \\#1 \\$ftp of function ftp_set_option expects FTP\\\\Connection, resource given\\.$#"
count: 1
path: src/Ftp/FtpConnectionProvider.php

-
message: "#^Parameter \\#1 \\$ftp of function ftp_close expects FTP\\\\Connection, resource given\\.$#"
count: 1
path: src/Ftp/FtpConnectionProviderTest.php

-
message: "#^Parameter \\#1 \\$ftp of function ftp_raw expects FTP\\\\Connection, resource given\\.$#"
count: 1
path: src/Ftp/NoopCommandConnectivityChecker.php

-
message: "#^Parameter \\#1 \\$ftp of function ftp_close expects FTP\\\\Connection, resource given\\.$#"
count: 1
path: src/Ftp/NoopCommandConnectivityCheckerTest.php

-
message: "#^Parameter \\#1 \\$ftp of function ftp_rawlist expects FTP\\\\Connection, resource given\\.$#"
count: 1
path: src/Ftp/RawListFtpConnectivityChecker.php

-
message: "#^Parameter \\#1 \\$ftp of function ftp_close expects FTP\\\\Connection, resource given\\.$#"
count: 1
path: src/Ftp/RawListFtpConnectivityCheckerTest.php
4 changes: 3 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
includes:
- phpstan-baseline.neon
parameters:
level: 6
paths:
Expand All @@ -7,7 +9,7 @@ parameters:
checkGenericClassInNonGenericObjectType: false
scanFiles:
- src/AdapterTestUtilities/test-functions.php
excludes_analyse:
excludePaths:
- src/AdapterTestUtilities/
- src/AsyncAwsS3
- src/AwsS3V3
Expand Down

0 comments on commit e5608b5

Please sign in to comment.