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

Replace self with static in fabric methods for ConversionException #3500

Closed
wants to merge 1 commit into from
Closed

Conversation

nitso
Copy link

@nitso nitso commented Mar 27, 2019

Q A
Type improvement
BC Break no
Fixed issues -

This change enables compatibility with inherited classes for fabric methods in base exception class.

I like to use \Doctrine\DBAL\Types\ConversionException factory methods when working with types.
But for custom types I prefer to extend base exception class to get more specific behavior.

@nitso nitso changed the title Replace self with static in fabric methods Replace self with static in fabric methods for ConversionException Mar 27, 2019
@Ocramius
Copy link
Member

Sorry, but this is an incorrect approach, since there is no guarantee that your child class constructor behaves like the parent one: please use your own implementation of these classes and static methods.

@nitso
Copy link
Author

nitso commented Mar 27, 2019

Thanks for quick reply, I see the problem.
Do you plan to refactor type system (\Doctrine\DBAL\Types\Type) in future releases?

@nitso nitso deleted the patch-3 branch March 27, 2019 15:50
@Ocramius
Copy link
Member

Yes, but right now the BC break would be too massive. Please check develop for current 3.x work

@Majkl578
Copy link
Contributor

Majkl578 commented Apr 2, 2019

Also see #2841.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants