Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow overriding the constructor #5528

Closed
wants to merge 1 commit into from

Conversation

greg0ire
Copy link
Member

Follow up of #5036, prompted by doctrine/DoctrineBundle#1246 (comment)

Now that the flyweight pattern has been removed, it should be possible.
@@ -48,13 +48,6 @@ abstract class Type

private static ?TypeRegistry $typeRegistry = null;

/**
* @internal Do not instantiate directly - use {@see Type::addType()} method instead.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A type registered through addType is still required to have no arguments in the constructor. We still need a check for that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like we need to deprecate the static Type methods that accept string $className in favor of TypeRegistry and the corresponding counterparts which accept Type $type.

Only after the deprecated methods have been removed, this constraint could be dropped.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #5530

@greg0ire greg0ire marked this pull request as draft July 22, 2022 15:45
@morozov
Copy link
Member

morozov commented Sep 24, 2022

Given that there are unresolved dependencies not being actively worked on (see #5530 (comment)), I propose that we close this pull request for now.

@greg0ire greg0ire closed this Sep 24, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants