Skip to content

Commit

Permalink
chore: upgrade phpstan and rector to version 2
Browse files Browse the repository at this point in the history
Re-generate phpstan baseline.
  • Loading branch information
zackad committed Jan 9, 2025
1 parent acc9232 commit 00a0986
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 35 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Internals:
- Rewrite _Dockerfile_ to remove incorrect image metadata (EXPOSE, HEALTHCHECK)
- Upgrade webpack encore to version 5
- Manage phpstan version via composer
- Upgrade phpstan and rector to version 2

---
v0.25.0 (2024-05-25)
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@
},
"require-dev": {
"composer/package-versions-deprecated": "^1.8",
"phpstan/phpstan": "^1.12",
"phpstan/phpstan": "^2.1",
"phpunit/phpunit": "^9.6",
"rector/rector": "^1.2",
"rector/rector": "^2.0",
"symfony/browser-kit": "6.4.*",
"symfony/css-selector": "6.4.*",
"symfony/maker-bundle": "^1.14",
Expand Down
30 changes: 15 additions & 15 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

75 changes: 58 additions & 17 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,86 +1,127 @@
parameters:
ignoreErrors:
-
message: "#^Parameter \\#1 \\$filename of method App\\\\Service\\\\MimeGuesser\\:\\:guessMimeType\\(\\) expects string, string\\|null given\\.$#"
message: '#^Parameter \#1 \$filename of method App\\Service\\MimeGuesser\:\:guessMimeType\(\) expects string, string\|null given\.$#'
identifier: argument.type
count: 1
path: src/Controller/ArchiveController.php

-
message: "#^Parameter \\#1 \\$filename of method ZipArchive\\:\\:open\\(\\) expects string, string\\|false given\\.$#"
message: '#^Parameter \#1 \$filename of method ZipArchive\:\:open\(\) expects string, string\|false given\.$#'
identifier: argument.type
count: 1
path: src/Controller/ArchiveController.php

-
message: "#^Parameter \\#1 \\$name of method ZipArchive\\:\\:getStream\\(\\) expects string, string\\|null given\\.$#"
message: '#^Parameter \#1 \$name of method ZipArchive\:\:getStream\(\) expects string, string\|null given\.$#'
identifier: argument.type
count: 1
path: src/Controller/ArchiveController.php

-
message: "#^PHPDoc tag @var for variable \\$randomizedIndex has no value type specified in iterable type array\\.$#"
message: '#^PHPDoc tag @var for variable \$randomizedIndex has no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
count: 1
path: src/Controller/RandomController.php

-
message: "#^Method App\\\\Service\\\\ArchiveReader\\:\\:generateList\\(\\) return type has no value type specified in iterable type Traversable\\.$#"
message: '#^PHPDoc tag @var with type array is not subtype of native type array\<int, int\|string\>\|int\|string\.$#'
identifier: varTag.nativeType
count: 1
path: src/Controller/RandomController.php

-
message: '#^Method App\\Service\\ArchiveReader\:\:generateList\(\) return type has no value type specified in iterable type Traversable\.$#'
identifier: missingType.iterableValue
count: 1
path: src/Service/ArchiveReader.php

-
message: "#^Method App\\\\Service\\\\ArchiveReader\\:\\:getList\\(\\) return type has no value type specified in iterable type array\\.$#"
message: '#^Method App\\Service\\ArchiveReader\:\:getList\(\) return type has no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
count: 1
path: src/Service/ArchiveReader.php

-
message: "#^Method App\\\\Service\\\\DirectoryListing\\:\\:buildList\\(\\) has parameter \\$entries with no value type specified in iterable type iterable\\.$#"
message: '#^Method App\\Service\\DirectoryListing\:\:buildList\(\) has parameter \$entries with no value type specified in iterable type iterable\.$#'
identifier: missingType.iterableValue
count: 1
path: src/Service/DirectoryListing.php

-
message: '#^Method App\\Service\\DirectoryListing\:\:buildList\(\) return type has no value type specified in iterable type Traversable\.$#'
identifier: missingType.iterableValue
count: 1
path: src/Service/DirectoryListing.php

-
message: "#^Method App\\\\Service\\\\DirectoryListing\\:\\:buildList\\(\\) return type has no value type specified in iterable type Traversable\\.$#"
message: '#^Method App\\Service\\DirectoryListing\:\:scan\(\) return type has no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
count: 1
path: src/Service/DirectoryListing.php

-
message: "#^Method App\\\\Service\\\\DirectoryListing\\:\\:scan\\(\\) return type has no value type specified in iterable type array\\.$#"
message: '#^Parameter \#1 \$array \(list\<string\>\) of array_values is already a list, call has no effect\.$#'
identifier: arrayValues.list
count: 1
path: src/Service/DirectoryListing.php

-
message: "#^Method App\\\\Service\\\\Search\\:\\:buildSearchIndex\\(\\) return type has no value type specified in iterable type iterable\\.$#"
message: '#^Method App\\Service\\Search\:\:buildSearchIndex\(\) return type has no value type specified in iterable type iterable\.$#'
identifier: missingType.iterableValue
count: 1
path: src/Service/Search.php

-
message: "#^Method App\\\\Service\\\\Search\\:\\:populateEntry\\(\\) has parameter \\$list with no value type specified in iterable type array\\.$#"
message: '#^Method App\\Service\\Search\:\:populateEntry\(\) has parameter \$list with no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
count: 1
path: src/Service/Search.php

-
message: "#^PHPDoc tag @var for variable \\$file has no value type specified in iterable type array\\.$#"
message: '#^PHPDoc tag @var for variable \$file has no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
count: 1
path: src/Service/Search.php

-
message: "#^Argument of an invalid type array\\<int, string\\>\\|false supplied for foreach, only iterables are supported\\.$#"
message: '#^Parameter \#1 \$array \(list\<array\{basename\: string, realpath\: \(string\|false\), relative_path\: non\-falsy\-string\}\>\) of array_values is already a list, call has no effect\.$#'
identifier: arrayValues.list
count: 1
path: src/Service/Search.php

-
message: '#^Argument of an invalid type list\<string\>\|false supplied for foreach, only iterables are supported\.$#'
identifier: foreach.nonIterable
count: 1
path: src/Twig/AppExtension.php

-
message: '#^Method App\\Twig\\AppExtension\:\:filterCover\(\) has parameter \$items with no value type specified in iterable type Traversable\.$#'
identifier: missingType.iterableValue
count: 1
path: src/Twig/AppExtension.php

-
message: "#^Method App\\\\Twig\\\\AppExtension\\:\\:filterCover\\(\\) has parameter \\$items with no value type specified in iterable type Traversable\\.$#"
message: '#^Method App\\Twig\\AppExtension\:\:filterCover\(\) return type has no value type specified in iterable type iterable\.$#'
identifier: missingType.iterableValue
count: 1
path: src/Twig/AppExtension.php

-
message: "#^Method App\\\\Twig\\\\AppExtension\\:\\:filterCover\\(\\) return type has no value type specified in iterable type iterable\\.$#"
message: '#^Method App\\Twig\\AppExtension\:\:filterImage\(\) has parameter \$items with no value type specified in iterable type Traversable\.$#'
identifier: missingType.iterableValue
count: 1
path: src/Twig/AppExtension.php

-
message: "#^Method App\\\\Twig\\\\AppExtension\\:\\:filterImage\\(\\) has parameter \\$items with no value type specified in iterable type Traversable\\.$#"
message: '#^Method App\\Twig\\AppExtension\:\:filterImage\(\) return type has no value type specified in iterable type iterable\.$#'
identifier: missingType.iterableValue
count: 1
path: src/Twig/AppExtension.php

-
message: "#^Method App\\\\Twig\\\\AppExtension\\:\\:filterImage\\(\\) return type has no value type specified in iterable type iterable\\.$#"
message: '#^PHPDoc tag @var with type array\<string\> is not subtype of native type list\<string\>\|false\.$#'
identifier: varTag.nativeType
count: 1
path: src/Twig/AppExtension.php
2 changes: 1 addition & 1 deletion symfony.lock
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": "7.2.5"
},
"phpstan/phpstan": {
"version": "1.10",
"version": "2.1",
"recipe": {
"repo": "github.com/symfony/recipes-contrib",
"branch": "main",
Expand Down

0 comments on commit 00a0986

Please sign in to comment.