Skip to content

Cascade merge: 4.x into master - #253

Merged
github-actions[bot] merged 3 commits into
masterfrom
4.x
Nov 2, 2026
Merged

github-actions[bot] merged 3 commits into
masterfrom
4.x

Conversation

@github-actions

@github-actions github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Automated cascade merge that keeps master in sync with the 4.x maintenance branch.

This PR tracks 4.x and merges automatically once required checks pass. A new one is opened after each merge, so every future push to 4.x keeps flowing forward into master.

If this PR shows a conflict, resolve it manually on 4.x (or directly on this PR's branch) — auto-merge will pick it up once it's clean again.

claude and others added 3 commits November 2, 2026 21:35
Reflecting a class requires its parent class, interfaces and traits. When the
locator could not find one of them, every method that needs it threw, so the
class could not be reflected at all, even for its own methods.

ReflectionEngine now takes a MissingAncestorPolicy (via init() or
setMissingAncestorPolicy()):
- Strict (default): the current behaviour, a ClassNotFoundException (which
  extends InvalidArgumentException) is thrown;
- Partial: missing ancestors are left out, and the reflection covers what the
  class and its available ancestors declare.

ReflectionClass and ReflectionEnum gain isPartial() and getMissingClassNames(),
which report missing ancestors transitively and never throw, whatever the
policy. All ancestor reflections now go through ReflectionClass::reflectAncestor().

Closes #251

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxhC1CBg4rnTu9UjAMcCpL
Passing the result of class_exists() and alike as a bool lost the narrowing of
the ancestor name to a class-string, so PHPStan rejected the native
reflection of a declared ancestor. The helper now checks it itself, as
ReflectionEngine::locateClassFile() does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxhC1CBg4rnTu9UjAMcCpL
feat: Partial reflection of classes whose ancestors can not be located
@github-actions
github-actions Bot merged commit 711bd75 into master Nov 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants