Skip to content

update phpstan to 2.0 and fix errors it reports#11

Open
tacman wants to merge 1 commit intoandanteproject:mainfrom
tacman:phpstan2
Open

update phpstan to 2.0 and fix errors it reports#11
tacman wants to merge 1 commit intoandanteproject:mainfrom
tacman:phpstan2

Conversation

@tacman
Copy link
Copy Markdown

@tacman tacman commented Apr 10, 2026

Updated PHPStan from 1.x to 2.0 and resolved all resulting analysis errors.

Tests pass.

Composer Updates

  • phpstan/phpstan: ^1.2^2.0
  • phpstan/phpstan-phpunit: ^1.0^2.0
  • phpstan/phpstan-symfony: ^1.0^2.0
  • phpstan/extension-installer: kept at ^1.4 (not yet available as 2.0)

Config Changes

  • Removed deprecated PHPStan options from phpstan.neon:
    • checkMissingIterableValueType
    • checkGenericClassInNonGenericObjectType
  • Added ignoreError for property.onlyRead in test fixtures (Doctrine-managed entity IDs)

Code Fixes

Source code:

  • TimestampableCacheClearer: Removed nullable type from property (never assigned null)
  • Configuration: Added PHPDoc type hints for array parameters/return types
  • EntityConfiguration: Added PHPDoc type hint for array parameter
  • TimestampableEventSubscriber: Fixed generic type annotation
    Test code:
  • Address, Organization: Changed ?int to int, added @readonly PHPDoc
  • FunctionalTestCase: Fixed method_exists() call, used list<> type
  • MappingTest: Fixed generic type annotation
  • All test classes with createKernel(): Added @param array<string, mixed> $options PHPDoc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant