Skip to content

Simplify narrowToFullyQualifiedOrAliasedObjectType in ObjectTypeSpecifier - #8835

Merged
TomasVotruba merged 3 commits into
mainfrom
tv-simplify-object-type-specifier
Oct 25, 2026
Merged

TomasVotruba merged 3 commits into
mainfrom
tv-simplify-object-type-specifier

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Small cleanup of ObjectTypeSpecifier::narrowToFullyQualifiedOrAliasedObjectType(), no behavior change:

  • resolve $objectType->getClassName() once into a local, instead of calling it twice.
  • collapse the two duplicated "invalid type" early returns in the template-tag branch into a single positive condition, falling through to the existing final resolveNamespacedNonExistingObjectType() return.

Behavior is identical: the invalid-type cases (no template type scope, or no matching template tag) still end up at the same resolveNamespacedNonExistingObjectType() return at the end of the method.

Full tests/ and rules-tests/TypeDeclaration suites pass; ECS and PHPStan level 8 clean on the file.

@TomasVotruba
TomasVotruba merged commit 45735fb into main Oct 25, 2026
48 of 49 checks passed
@TomasVotruba
TomasVotruba deleted the tv-simplify-object-type-specifier branch October 25, 2026 22:34
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.

1 participant