-
-
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
set default value for Channel taxCalculationStrategy #11418
Conversation
oallain
commented
May 3, 2020
•
edited
Loading
edited
Q | A |
---|---|
Branch? | master |
Bug fix? | yes |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Related tickets | fixes #11414 |
License | MIT |
ccaa975
to
f35af58
Compare
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.
What issue does it solve?
Oh, I've just seen #11414. I'm not feeling comfortable with hardcoding the strategy, we should find some way to at least rely on some constraint or just use the first strategy that is available. |
Neither do I, the current solution is a no-go right now. Maybe we should provide such config through our factory service? This is the default method of creating new objects in Sylius. |
Hi @lchrusciel @pamil , I create a ChannelFactory in Core, tell me if this is what you expected? |
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.
Seems good to me. Thanks Olivier!
5cbb841
to
c33cb40
Compare
use Sylius\Component\Core\Model\ChannelInterface; | ||
use Sylius\Component\Resource\Factory\FactoryInterface; | ||
|
||
interface ChannelFactoryInterface extends FactoryInterface |
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.
Is this interface even needed, as we have the interface from component namespace?
public function createNamed(string $name): ChannelInterface; |
If so, it should be extended rather than replaced.
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.
IMHO, we need it while we don't have the covariance provided by PHP 7.4.
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.
However, all of the current implementations, that are based on the previous interface cannot be changed, due to BC Policy. If we want to extend the previous implementation we need to extend the previous interface
Sorry for pushing it back and forth, but not spotting the current factory implementation was my mistake from the early beginning |
eeb1267
to
5cb43bc
Compare
5cb43bc
to
da5510c
Compare
Hi @lchrusciel All looks good, but Travis failed. Thanks |
The reason some of your tests may fail is because currently the master is broken. So just wait for them to fix it and then rebase again. (Or fix it yourself and make a separate pull request) |
We can try to rebase now, it should work ;) |
67c09ca
to
70a40c6
Compare
70a40c6
to
efcd749
Compare
Hi @lchrusciel , Rebase is done, and "application" is green on Travis, but "doc" still red 😞 |
Can you rebase again now? |
efcd749
to
2786699
Compare
@mamazu , It's worse 😉 |
Hm, but the master is green. Very odd. |
a641300
to
ff7c64b
Compare
I changed target to master and it's green now :) Thanks ! |
1734369
to
281269e
Compare
Hello @lchrusciel @mamazu I rebase (again) and now Travis is green 😄 (But Symfony/Insight is Pending 😂 ) Regards |
Hm, someone from Sylius needs to restart this job. |
Hey Olivier 👋 I didn't find time to take over this PR, however, I won't merge it without change to #11418 (comment). Right now this PR contains BC Break. |
Hello, I am facing a dilemma and I don't know what/how to do :
What is the best solution ? |
I just pushed with solution 2) 😉 Looking forward to your feedback. |
I would suggest option 1 with the return type not being type-hinted but just annotated in the doc type. Then psalm or phpstan or any other static code analysis tool can pick it up and it doesn't break things. (And this is also the best way to go in my opinion) Option 2 is not great. Because the interface of the component is smaller than the interface of the core bundle (as far as I know) so this would also be sub-optimal. Option 3: I don't know if there is already a branch in Sylius that is for 2.0 where those BC breaks will probably be bundled into. I also made a breaking change as a PR which also still has no place to go really. |
30620d6
to
31dc666
Compare
Option 3 is a no-go for us. Option 2 is what we are doing for the last few years and this is what I would recommend. However, as @mamazu stated, probably improved option 1 (with docblock) is the best solution right now. |
31dc666
to
ef3f7fc
Compare
94b23ef
to
31f3e91
Compare
Hello, @mamazu This rebase is 💚 (green) 🎉 |
The base of this pull-request was changed, you need fetch and reset your local branch Unless you added new commits (to this branch) locally that you did not push yet, Feel free to ask for assistance when you get stuck 👍 |
31f3e91
to
0dd21de
Compare
Thanks, @oallain! 🥇 |
…nor improvements (lchrusciel) This PR was merged into the 1.7 branch. Discussion ---------- | Q | A | --------------- | ----- | Branch? | 1.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Related tickets | fixes for #11418 | License | MIT <!-- - Bug fixes must be submitted against the 1.7 branch (the lowest possible) - Features and deprecations must be submitted against the master branch - Make sure that the correct base branch is set To be sure you are not breaking any Backward Compatibilities, check the documentation: https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html --> Commits ------- 4fe2f3c [Channel] Fix bc-breaking changes in ChannelFactory