Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Jun 5, 2025

  • Fix PHP 8.4 parameter implicitly nullable deprecation
  • Add basic static analysis to CI workflow with PHPStan
  • Update GHA runner to one that is not retired

@goetas
Copy link
Collaborator

goetas commented Jun 5, 2025

Nice! Thank you for this pr.

Is there a lot of work needed to increase the phpstan level?

@ghost
Copy link
Author

ghost commented Jun 6, 2025

Wasn't bad! I got up to level 6 by:

Level 2:

  • Removing support for predis/predis ^0.8
  • Removing some types that were removed in Symfony 5 (which is already a base requirement)

Level 3:

  • Adding some missing return types to StorageInterface and property type to PhpRedis

Level 4:

  • Updating PHPDoc to describe RateLimitService::$storage as nullable (which is already is, since it's untyped in PHP)

Level 5:

  • Casting some numbers as strings where strings were expected

Level 6:

  • Adding iterable type PHPDoc to NoxlogicRateLimitExtension::load() parameter $config (this was affecting SF 5.4 builds only)
  • There are a lot more missing type errors that I didn't fix, but I generated a baseline to enforce strong typing in any new code.

@goetas goetas merged commit 07bdfaa into jaytaph:main Jun 8, 2025
18 checks passed
@goetas
Copy link
Collaborator

goetas commented Jun 8, 2025

Thank you for your excellent work

@ghost
Copy link
Author

ghost commented Jun 9, 2025

No problem! Would you mind releasing a 2.1.0 version please for folks who's like to squash PHP 8.4 deprecations?

@goetas
Copy link
Collaborator

goetas commented Jun 9, 2025

Done

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