-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Try to auto-detect a bundle's model namespace by default #9040
Conversation
I'm wondering if it shouldn't go to 1.0 branch. /cc @pamil |
@lchrusciel I'll rather keep 1.0 branch only for bugfixes, this is a nice DX improvement so the next minor is the best choice. |
@@ -97,9 +97,9 @@ protected function getDoctrineMappingDirectory(): string | |||
* | |||
* @return string | |||
*/ | |||
protected function getModelNamespace(): ?string | |||
protected function getModelNamespace(): string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing the return typehint by removing nullability is a no-go zone :) It would break 3rd party applications if they're using the currently correct method signature with ?string
return typehint.
@mbabker thanks for this PR, making plugins development easier is vital for Sylius 🎉 Let's change that typehint and it's good to go. |
Updated, though you should really add that change to the 2.0 backlog 😉 |
Thank you Michael! 🥇 |
v1.0.7 - [Sylius#9075](Sylius#9075) Test sylius:install command on Travis (@pamil) - [Sylius#9070](Sylius#9070) Extend Travis build matrix & setup extra jobs running nightly (1.1) (@pamil) - [Sylius#9071](Sylius#9071) Update composer.json (1.0) (@pamil) - [Sylius#9069](Sylius#9069) Extend Travis build matrix & setup extra jobs running nightly (1.0) (@pamil) - [Sylius#9065](Sylius#9065) Various Travis changes (@pamil) - [Sylius#9048](Sylius#9048) Exclude the web/media directory from firewall restrict list. (@Hailong) - [Sylius#9040](Sylius#9040) Try to auto-detect a bundle's model namespace by default (@mbabker) - [Sylius#9063](Sylius#9063) Require Symfony ^3.4 in components & bundles (@pamil) - [Sylius#9055](Sylius#9055) Remove PHP <= 7.1 Polyfills (@stefandoorn) - [Sylius#9052](Sylius#9052) Fixes history issue when adding to cart (@gabriel-cardoso) - [Sylius#9061](Sylius#9061) Require Symfony ^3.4 (@pamil) - [Sylius#9060](Sylius#9060) Remove the need for using sudo on Travis (@pamil) - [Sylius#9059](Sylius#9059) Make Travis use the most recent Chromedriver (@pamil)
Try to auto-detect a bundle's model namespace by default
Try to auto-detect a bundle's model namespace by default
Try to auto-detect a bundle's model namespace by default
The
AbstractResourceBundle
right now requires that bundles/plugins define a model namespace. Following conventions in core, by default this is presumably<BundleNamespace>\Model
. So instead of forcing child classes to define this we can make an assumption by default as a small DX improvement.For the most part this doesn't impact core as most bundles are using component models (except for the two changed here). But this can impact the plugin ecosystem and local app development by requiring one less method to set up.