Skip to content

Add Parsers::parse*Name() methods#7403

Merged
morozov merged 1 commit into
doctrine:4.5.xfrom
morozov:parser-helper-methods
Jun 13, 2026
Merged

Add Parsers::parse*Name() methods#7403
morozov merged 1 commit into
doctrine:4.5.xfrom
morozov:parser-helper-methods

Conversation

@morozov

@morozov morozov commented Jun 13, 2026

Copy link
Copy Markdown
Member

Most consumers of the Parsers helper don't need a parser instance (Parsers::get*NameParser()); they need to parse a name. The only exception is AbstractAsset::_setName(), which is shared between subclasses that use different parsers for their respective name classes, and which has already been removed in 5.0.x.

To slightly reduce the boilerplate, we can introduce Parsers::parse*Name() methods. They will be more extensively used in DBAL 5.0.x and also, potentially, the ORM as an upgrade path towards names as objects (e.g. doctrine/orm#12357).

@morozov morozov added this to the 4.5.0 milestone Jun 13, 2026
@morozov morozov marked this pull request as ready for review June 13, 2026 16:31
@morozov morozov requested a review from greg0ire June 13, 2026 16:31
@greg0ire

Copy link
Copy Markdown
Member

and also, potentially, the ORM as an upgrade path towards names as objects

Parsers is marked as @internal. Should that change, in this case?

@morozov morozov merged commit cc729ae into doctrine:4.5.x Jun 13, 2026
130 checks passed
@morozov

morozov commented Jun 13, 2026

Copy link
Copy Markdown
Member Author

Parsers is marked as @internal. Should that change, in this case?

I thought we decided to make an exception for the ORM and have it use an @internal API. If needed, we can make it public separately.

@morozov morozov deleted the parser-helper-methods branch June 13, 2026 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants