-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TASK] Fix phpstan for level 5, Generate baseline for level max (#465)
* [TASK] Fix phpstan for level 5 * [TASK] Raise phpstan level to max and generate baseline
- Loading branch information
Showing
9 changed files
with
319 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,307 @@ | ||
parameters: | ||
ignoreErrors: | ||
- | ||
message: '#^Parameter \#1 \$environment of class App\\Kernel constructor expects string, mixed given\.$#' | ||
identifier: argument.type | ||
count: 1 | ||
path: public/index.php | ||
|
||
- | ||
message: '#^Cannot access offset ''composer_name'' on mixed\.$#' | ||
identifier: offsetAccess.nonOffsetAccessible | ||
count: 2 | ||
path: src/Command/ExtensionsTerJsonCreateCommand.php | ||
|
||
- | ||
message: '#^Cannot access offset ''error'' on mixed\.$#' | ||
identifier: offsetAccess.nonOffsetAccessible | ||
count: 1 | ||
path: src/Command/ExtensionsTerJsonCreateCommand.php | ||
|
||
- | ||
message: '#^Parameter \#1 \$dependencies of method App\\Command\\ExtensionsTerJsonCreateCommand\:\:getPackageLinks\(\) expects array\<string, array\<string, string\>\>, array\<mixed, mixed\> given\.$#' | ||
identifier: argument.type | ||
count: 1 | ||
path: src/Command/ExtensionsTerJsonCreateCommand.php | ||
|
||
- | ||
message: '#^Parameter \#1 \$message of class RuntimeException constructor expects string, mixed given\.$#' | ||
identifier: argument.type | ||
count: 1 | ||
path: src/Command/ExtensionsTerJsonCreateCommand.php | ||
|
||
- | ||
message: '#^Property App\\Command\\ExtensionsTerJsonCreateCommand\:\:\$extensions \(array\<int, SimpleXMLElement\>\) does not accept array\<SimpleXMLElement\>\.$#' | ||
identifier: assign.propertyType | ||
count: 1 | ||
path: src/Command/ExtensionsTerJsonCreateCommand.php | ||
|
||
- | ||
message: '#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\.$#' | ||
identifier: foreach.nonIterable | ||
count: 1 | ||
path: src/Command/ListMissingDownloadsCommand.php | ||
|
||
- | ||
message: '#^Binary operation "\." between mixed and ''\:'' results in an error\.$#' | ||
identifier: binaryOp.invalid | ||
count: 1 | ||
path: src/Command/ListMissingDownloadsCommand.php | ||
|
||
- | ||
message: '#^Cannot access offset ''releases'' on mixed\.$#' | ||
identifier: offsetAccess.nonOffsetAccessible | ||
count: 1 | ||
path: src/Command/ListMissingDownloadsCommand.php | ||
|
||
- | ||
message: '#^Cannot access offset ''tar'' on mixed\.$#' | ||
identifier: offsetAccess.nonOffsetAccessible | ||
count: 1 | ||
path: src/Command/ListMissingDownloadsCommand.php | ||
|
||
- | ||
message: '#^Cannot access offset ''url'' on mixed\.$#' | ||
identifier: offsetAccess.nonOffsetAccessible | ||
count: 2 | ||
path: src/Command/ListMissingDownloadsCommand.php | ||
|
||
- | ||
message: '#^Cannot access offset ''zip'' on mixed\.$#' | ||
identifier: offsetAccess.nonOffsetAccessible | ||
count: 1 | ||
path: src/Command/ListMissingDownloadsCommand.php | ||
|
||
- | ||
message: '#^Parameter \#1 \$url of method App\\Command\\ListMissingDownloadsCommand\:\:getFixedUrl\(\) expects string, mixed given\.$#' | ||
identifier: argument.type | ||
count: 2 | ||
path: src/Command/ListMissingDownloadsCommand.php | ||
|
||
- | ||
message: '#^Parameter \#2 \$release of method App\\Command\\ListMissingDownloadsCommand\:\:getFixedUrl\(\) expects string, mixed given\.$#' | ||
identifier: argument.type | ||
count: 2 | ||
path: src/Command/ListMissingDownloadsCommand.php | ||
|
||
- | ||
message: '#^Parameter \#1 \$callback of function array_map expects \(callable\(mixed\)\: mixed\)\|null, Closure\(Symfony\\Component\\Validator\\ConstraintViolationInterface\)\: \(string\|Stringable\) given\.$#' | ||
identifier: argument.type | ||
count: 1 | ||
path: src/Controller/Api/SitepackageController.php | ||
|
||
- | ||
message: '#^Parameter \#1 \$packages of method App\\Service\\ComposerPackagesService\:\:cleanPackagesForVersions\(\) expects array\<string, bool\|string\>, array\<mixed\> given\.$#' | ||
identifier: argument.type | ||
count: 1 | ||
path: src/Controller/DefaultController.php | ||
|
||
- | ||
message: '#^Binary operation "\." between ''https\://typo3…'' and mixed results in an error\.$#' | ||
identifier: binaryOp.invalid | ||
count: 1 | ||
path: src/Controller/DownloadController.php | ||
|
||
- | ||
message: '#^Binary operation "\." between non\-falsy\-string and mixed results in an error\.$#' | ||
identifier: binaryOp.invalid | ||
count: 1 | ||
path: src/Controller/DownloadController.php | ||
|
||
- | ||
message: '#^Cannot access offset ''latest'' on mixed\.$#' | ||
identifier: offsetAccess.nonOffsetAccessible | ||
count: 1 | ||
path: src/Controller/DownloadController.php | ||
|
||
- | ||
message: '#^Cannot access offset ''releases'' on mixed\.$#' | ||
identifier: offsetAccess.nonOffsetAccessible | ||
count: 1 | ||
path: src/Controller/DownloadController.php | ||
|
||
- | ||
message: '#^Cannot access offset ''version'' on mixed\.$#' | ||
identifier: offsetAccess.nonOffsetAccessible | ||
count: 1 | ||
path: src/Controller/DownloadController.php | ||
|
||
- | ||
message: '#^Cannot access offset mixed on mixed\.$#' | ||
identifier: offsetAccess.nonOffsetAccessible | ||
count: 1 | ||
path: src/Controller/DownloadController.php | ||
|
||
- | ||
message: '#^Cannot cast mixed to string\.$#' | ||
identifier: cast.string | ||
count: 1 | ||
path: src/Controller/DownloadController.php | ||
|
||
- | ||
message: '#^Method App\\Controller\\DownloadController\:\:getDownloadRedirect\(\) should return array\{url\: string, version\: string, format\: string\} but returns array\{url\: non\-falsy\-string, version\: mixed, format\: ''tar\.gz''\|''tar\.gz\.sig''\|''zip''\|''zip\.sig''\}\.$#' | ||
identifier: return.type | ||
count: 1 | ||
path: src/Controller/DownloadController.php | ||
|
||
- | ||
message: '#^Parameter \#1 \$version1 of function version_compare expects string, mixed given\.$#' | ||
identifier: argument.type | ||
count: 1 | ||
path: src/Controller/DownloadController.php | ||
|
||
- | ||
message: '#^Parameter \#2 \.\.\.\$values of function sprintf expects bool\|float\|int\|string\|null, mixed given\.$#' | ||
identifier: argument.type | ||
count: 1 | ||
path: src/Controller/DownloadController.php | ||
|
||
- | ||
message: '#^Method App\\Controller\\SitepackageController\:\:createEditSitePackageForm\(\) return type with generic interface Symfony\\Component\\Form\\FormInterface does not specify its types\: TData$#' | ||
identifier: missingType.generics | ||
count: 1 | ||
path: src/Controller/SitepackageController.php | ||
|
||
- | ||
message: '#^Method App\\Controller\\SitepackageController\:\:createNewSitepackageForm\(\) return type with generic interface Symfony\\Component\\Form\\FormInterface does not specify its types\: TData$#' | ||
identifier: missingType.generics | ||
count: 1 | ||
path: src/Controller/SitepackageController.php | ||
|
||
- | ||
message: '#^Parameter \#2 \.\.\.\$values of function sprintf expects bool\|float\|int\|string\|null, mixed given\.$#' | ||
identifier: argument.type | ||
count: 1 | ||
path: src/DataFixtures/ReleaseFixtures.php | ||
|
||
- | ||
message: '#^Method App\\Entity\\Release\:\:getMajorVersion\(\) should return App\\Entity\\MajorVersion but returns App\\Entity\\MajorVersion\|null\.$#' | ||
identifier: return.type | ||
count: 1 | ||
path: src/Entity/Release.php | ||
|
||
- | ||
message: '#^Binary operation "\." between ''Unknown option \('' and mixed results in an error\.$#' | ||
identifier: binaryOp.invalid | ||
count: 1 | ||
path: src/Enum/AbstractEnum.php | ||
|
||
- | ||
message: '#^Class App\\Form\\AuthorType extends generic class Symfony\\Component\\Form\\AbstractType but does not specify its types\: TData$#' | ||
identifier: missingType.generics | ||
count: 1 | ||
path: src/Form/AuthorType.php | ||
|
||
- | ||
message: '#^Method App\\Form\\AuthorType\:\:buildForm\(\) has no return type specified\.$#' | ||
identifier: missingType.return | ||
count: 1 | ||
path: src/Form/AuthorType.php | ||
|
||
- | ||
message: '#^Cannot access offset ''icon'' on mixed\.$#' | ||
identifier: offsetAccess.nonOffsetAccessible | ||
count: 1 | ||
path: src/Form/Extension/AbstractIconExtension.php | ||
|
||
- | ||
message: '#^Class App\\Form\\SitepackageType extends generic class Symfony\\Component\\Form\\AbstractType but does not specify its types\: TData$#' | ||
identifier: missingType.generics | ||
count: 1 | ||
path: src/Form/SitepackageType.php | ||
|
||
- | ||
message: '#^Parameter \#1 \$action of method Symfony\\Component\\Form\\FormConfigBuilderInterface\<mixed\>\:\:setAction\(\) expects string, mixed given\.$#' | ||
identifier: argument.type | ||
count: 1 | ||
path: src/Form/SitepackageType.php | ||
|
||
- | ||
message: '#^Offset ''repositories'' might not exist on array\{name\: string, homepage\: string\|null, repositories\?\: array\<int, array\<string, string\>\>\|null, require\?\: array\<string, string\>\|null, require\-all\: bool, require\-dependencies\: bool, require\-dev\-dependencies\: bool\}\.$#' | ||
identifier: offsetAccess.notFound | ||
count: 1 | ||
path: src/Model/SatisJson.php | ||
|
||
- | ||
message: '#^Offset ''require'' might not exist on array\{name\: string, homepage\: string\|null, repositories\?\: non\-empty\-array\<int, array\<string, string\>\>\|null, require\?\: array\<string, string\>\|null, require\-all\: bool, require\-dependencies\: bool, require\-dev\-dependencies\: bool\}\.$#' | ||
identifier: offsetAccess.notFound | ||
count: 1 | ||
path: src/Model/SatisJson.php | ||
|
||
- | ||
message: '#^Method App\\Repository\\MajorVersionRepository\:\:findAllActiveElts\(\) should return array\<App\\Entity\\MajorVersion\> but returns array\<mixed, mixed\>\.$#' | ||
identifier: return.type | ||
count: 1 | ||
path: src/Repository/MajorVersionRepository.php | ||
|
||
- | ||
message: '#^Method App\\Repository\\MajorVersionRepository\:\:findAllComposerSupported\(\) should return array\<App\\Entity\\MajorVersion\> but returns array\<mixed, mixed\>\.$#' | ||
identifier: return.type | ||
count: 1 | ||
path: src/Repository/MajorVersionRepository.php | ||
|
||
- | ||
message: '#^Method App\\Repository\\MajorVersionRepository\:\:findLatestLtsComposerSupported\(\) should return App\\Entity\\MajorVersion\|null but returns mixed\.$#' | ||
identifier: return.type | ||
count: 1 | ||
path: src/Repository/MajorVersionRepository.php | ||
|
||
- | ||
message: '#^Parameter \#1 \$version of method App\\Repository\\MajorVersionRepository\:\:majorVersionDescending\(\) expects App\\Entity\\MajorVersion, mixed given\.$#' | ||
identifier: argument.type | ||
count: 2 | ||
path: src/Repository/MajorVersionRepository.php | ||
|
||
- | ||
message: '#^Parameter \#1 \$versions of method App\\Repository\\MajorVersionRepository\:\:removeVersionsWithoutReleases\(\) expects array\<int, App\\Entity\\MajorVersion\>, array\<mixed, mixed\> given\.$#' | ||
identifier: argument.type | ||
count: 3 | ||
path: src/Repository/MajorVersionRepository.php | ||
|
||
- | ||
message: '#^Binary operation "\." between non\-falsy\-string and mixed results in an error\.$#' | ||
identifier: binaryOp.invalid | ||
count: 1 | ||
path: src/Service/CacheWarmupService.php | ||
|
||
- | ||
message: '#^Cannot call method getStatusCode\(\) on mixed\.$#' | ||
identifier: method.nonObject | ||
count: 1 | ||
path: src/Service/CacheWarmupService.php | ||
|
||
- | ||
message: '#^Method App\\Service\\ComposerPackagesService\:\:buildForm\(\) has parameter \$builder with generic interface Symfony\\Component\\Form\\FormBuilderInterface but does not specify its types\: TData$#' | ||
identifier: missingType.generics | ||
count: 1 | ||
path: src/Service/ComposerPackagesService.php | ||
|
||
- | ||
message: '#^Method App\\Service\\ComposerPackagesService\:\:buildForm\(\) return type with generic interface Symfony\\Component\\Form\\FormInterface does not specify its types\: TData$#' | ||
identifier: missingType.generics | ||
count: 1 | ||
path: src/Service/ComposerPackagesService.php | ||
|
||
- | ||
message: '#^Offset 0 might not exist on array\{0\?\: string\}\.$#' | ||
identifier: offsetAccess.notFound | ||
count: 1 | ||
path: src/Service/ComposerPackagesService.php | ||
|
||
- | ||
message: '#^Parameter \#1 \$child of method Symfony\\Component\\Form\\FormBuilderInterface\<mixed\>\:\:add\(\) expects string\|Symfony\\Component\\Form\\FormBuilderInterface, list\<string\>\|string given\.$#' | ||
identifier: argument.type | ||
count: 1 | ||
path: src/Service/ComposerPackagesService.php | ||
|
||
- | ||
message: '#^Parameter \#1 \$releases of method App\\Twig\\Filter\\SortByVersion\:\:sort\(\) expects Doctrine\\Common\\Collections\\Collection\<int, App\\Entity\\Release\>, mixed given\.$#' | ||
identifier: argument.type | ||
count: 1 | ||
path: src/Twig/Filter/SortByVersion.php | ||
|
||
- | ||
message: '#^Method App\\Tests\\Functional\\Controller\\Api\\ApiCase\:\:decodeResponse\(\) should return array\<string, mixed\> but returns array\<mixed, mixed\>\.$#' | ||
identifier: return.type | ||
count: 1 | ||
path: tests/Functional/Controller/Api/ApiCase.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
includes: | ||
- phpstan-baseline.neon | ||
parameters: | ||
level: max | ||
treatPhpDocTypesAsCertain: false | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters