Skip to content

Modernize codebase for PHP 8.1 - #1992

Merged
XWB merged 3 commits into
FriendsOfSymfony:masterfrom
guillaume-sainthillier:claude/laughing-carson-byUX1
May 28, 2026
Merged

XWB merged 3 commits into
FriendsOfSymfony:masterfrom
guillaume-sainthillier:claude/laughing-carson-byUX1

Conversation

@guillaume-sainthillier

Copy link
Copy Markdown
Contributor

Apply Rector with PHP 8.1 sets plus dead code, code quality, type declarations, privatization, and early return prepared sets.

Main changes:

  • Constructor property promotion and readonly properties
  • Add missing void/typed return types
  • Remove redundant @return/@var phpdocs
  • Replace isset() with null comparison on typed properties
  • Drop ReflectionProperty::setAccessible() calls (no-op since PHP 8.1)
  • Fix incorrect TCallbackInternal type (ExpressionLanguage -> Expression)

@guillaume-sainthillier
guillaume-sainthillier force-pushed the claude/laughing-carson-byUX1 branch from cfa253b to 567d57f Compare May 26, 2026 10:17
@XWB

XWB commented May 28, 2026

Copy link
Copy Markdown
Member

Just one merge conflict.

claude added 3 commits May 28, 2026 10:53
Apply Rector with PHP 8.1 sets plus dead code, code quality, type
declarations, privatization, and early return prepared sets.

Main changes:
- Constructor property promotion and readonly properties
- Add missing void/typed return types
- Remove redundant @return/@var phpdocs
- Replace isset() with null comparison on typed properties
- Drop ReflectionProperty::setAccessible() calls (no-op since PHP 8.1)
- Fix incorrect TCallbackInternal type (ExpressionLanguage -> Expression)
Add explicit parameter types to closures and arrow functions where
the type can be inferred unambiguously from context:

- Event listener closures typed with their event class
- Config DSL ifTrue/then callbacks typed as array or mixed
- usort/array_map callbacks in transformer typed as array|object
- PropertyAccessor mock callback typed (object, string)
Run Rector with type coverage level 100 plus manual passes to add types
to every method, interface, and anonymous function across src/ and tests/.

- Interface return types and param types (Finder, ObjectPersister,
  Paginator, Pager, ElasticaToModelTransformer, HighlightableModel)
- Implementation methods updated to match (TransformedFinder, Repository,
  RawPaginatorAdapter, FantaPaginatorAdapter, HybridResult,
  AbstractElasticaToModelTransformer, Doctrine transformers)
- Configuration DSL arrow function param/return types
- Test fixture POPO getters typed from property declarations
- Test mock repositories typed to return their QueryBuilder type
@guillaume-sainthillier
guillaume-sainthillier force-pushed the claude/laughing-carson-byUX1 branch from 567d57f to 305fbfe Compare May 28, 2026 08:53
@XWB
XWB merged commit 54c0db3 into FriendsOfSymfony:master May 28, 2026
25 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.

3 participants