Skip to content

Handle root-namespace classes in SymfonyFileLocator - #521

Open
Junaid-PK wants to merge 1 commit into
doctrine:4.2.xfrom
Junaid-PK:fix/root-namespace-mapping-message
Open

Handle root-namespace classes in SymfonyFileLocator#521
Junaid-PK wants to merge 1 commit into
doctrine:4.2.xfrom
Junaid-PK:fix/root-namespace-mapping-message

Conversation

@Junaid-PK

Copy link
Copy Markdown

Fixes #520.

When a mapping lookup fails for a class in the root namespace, strrpos() returns false. The assertion then fails when assertions are enabled; when they are disabled, the subsequent substr() starts at offset 1 and reports a filename such as ateTime.yml.

Use the complete class name when there is no namespace separator, while preserving the existing short-name behavior for namespaced classes. The regression test verifies that DateTime produces the expected MappingException and filename.

Validation:

  • vendor/bin/phpunit — 146 tests, 306 assertions
  • vendor/bin/phpcs — 72 files
  • vendor/bin/phpstan analyse --no-progress --memory-limit=512M — no errors

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.

SymfonyFileLocator triggers an assertion for DateTime params

1 participant