Repository navigation
chore(phpstan): upgrade phpstan to 2.x - #287
Merged
Merged
Conversation
jacquesbh
force-pushed
the
chore/phpstan-2-upgrade
branch
3 times, most recently
from
September 30, 2026 10:40
7ea71cd to
a692926
Compare
jacquesbh
force-pushed
the
chore/phpstan-2-upgrade
branch
from
September 30, 2026 21:21
a692926 to
67cb8f7
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
phpstan/phpstan^1.8.4→^2.2,phpstan/phpstan-doctrine^1.3.2→^2.0,phpstan/phpstan-webmozart-assert^1.1→^2.0(installed: 2.2.16 / 2.0.28 / 2.0.0)phpstan.neon: remove the now-unmatchedmissingType.genericsignore (keepmissingType.iterableValue)@SuppressWarnings("PHPMD.*")annotations across 9 files: PHPStan 2 strictly parses PHPDoc and flags the unquoted form; PHPMD behaviour verified unchanged (quoted form honoured)@return class-string<\Symfony\Component\Form\FormTypeInterface>docblocks on the conditional form-type getters (ImageType::getImageType(),VideoType::getImageType()/getVideoType()) soFormBuilderInterface::add()accepts themWysiwygType: drop a redundant?? self::DEFAULT_LOCALE(explode()[0]is never null) — behaviour-identicalsrc/UiElement/Metadata.php,src/Form/Type/UiElement/SeparatorType.php: closures → static closures)No runtime behavior changes.
Verification
composer validate --strict,phpmd,phpcs,phpspec(2 specs / 14 examples), yaml, twig, schema and container lints: all greenphpstan(level 8, PHPStan 2.2.16): 7 remaining errors, all insrc/Uploader/FixtureFileUploader.php(Gaufretteclass.notFound×6 +alreadyNarrowedType×1). These are exactly what Replace Gaufrette by FlySystem #286 fixes; this PR intentionally does not touch that file to avoid overlap. Rebase/merge after Replace Gaufrette by FlySystem #286.Notes
sylius/sylius2.3.0, which no longer ships Gaufrette — hence the errors above exist on3.xtoday, independent of this upgrade.Update: rebased onto #286's head so this PR runs on top of the Flysystem migration and CI can be green. Until #286 merges, this PR's diff also contains #286's three files (config.yaml, services.yaml, FixtureFileUploader.php). Once #286 merges, this branch will be rebased onto the new 3.x tip and the diff will show only the PHPStan upgrade.
CI note: the php (8.2) job failed at
make test.schemadue to doctrine/orm 3.7 (fresh resolution — sylius-standard v2.1.4 has no lock file) tripping on Sylius's unused ShipmentUnit mapping (Sylius/Sylius#19235). The Makefile now pinsdoctrine/orm ~3.5.0in the test application, matching what the 8.3 job already installs from sylius-standard v2.1.6's lock. Unrelated to the PHPStan upgrade itself (php 8.3 passes the full suite).