Skip to content

update phpstan to 2.0 and fix errors it reports - #11

Merged
cristoforocervino merged 2 commits into
andanteproject:mainfrom
tacman:phpstan2
Apr 29, 2026
Merged

update phpstan to 2.0 and fix errors it reports#11
cristoforocervino merged 2 commits into
andanteproject:mainfrom
tacman:phpstan2

Conversation

@tacman

@tacman tacman commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Apr 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@cristoforocervino

Copy link
Copy Markdown
Member

Thanks @tacman, but cs-fixer is failing! Can you fix it?

@cristoforocervino cristoforocervino self-assigned this Apr 28, 2026
@cristoforocervino
cristoforocervino self-requested a review April 28, 2026 18:42
@cristoforocervino

Copy link
Copy Markdown
Member

@tacman thank you very much!

@cristoforocervino
cristoforocervino merged commit 7a11c26 into andanteproject:main Apr 29, 2026
18 checks passed
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.

2 participants