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

[Translation] Remove fluent interfaces #3315

Merged

Conversation

CoderMaggie
Copy link
Member

Q A
Bug fix? no
New feature? no
BC breaks? yes
Deprecations? no
Fixed tickets no
License MIT

@CoderMaggie CoderMaggie changed the title [Translation] Removed fluent interfaces [Translation] Remove fluent interfaces Sep 21, 2015
/**
* @author Gonzalo Vilaseca <gvilaseca@reiss.co.uk>
*/
class AbstractTranslation implements TranslationInterface
{
/**
* Locale.
*

Copy link
Contributor

Choose a reason for hiding this comment

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

This shouldn't be added 😉

@michalmarcinkowski
Copy link
Contributor

@@ -44,10 +40,6 @@ public function getTranslatable()
*/
public function setTranslatable(TranslatableInterface $translatable = null)
{
if ($translatable === $this->translatable) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be reverted.

@michalmarcinkowski michalmarcinkowski added the Enhancement Minor issues and PRs improving the current solutions (optimizations, typo fixes, etc.). label Sep 22, 2015
@michalmarcinkowski michalmarcinkowski added this to the v0.16.0 milestone Sep 22, 2015
@@ -44,10 +40,6 @@ public function getTranslatable()
*/
public function setTranslatable(TranslatableInterface $translatable = null)
{
if ($translatable === $this->translatable) {
return $this;
Copy link
Contributor

Choose a reason for hiding this comment

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

As above should be reverted, this line should be just return;.

@CoderMaggie
Copy link
Member Author

@michalmarcinkowski 👍 done.

@@ -19,15 +19,11 @@
abstract class AbstractTranslatable implements TranslatableInterface
{
/**
* Translations.
*
* @var TranslationInterface[]
Copy link
Contributor

Choose a reason for hiding this comment

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

Collection|TranslationInterface[]

Copy link
Contributor

Choose a reason for hiding this comment

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

IMHO putting Collection here is a bad idea as we don't want to couple this interface with Doctrine Commons.

Copy link
Contributor

Choose a reason for hiding this comment

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

But it's already coupuled with them in __construct()...

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, constructor in abstract class is not the thing I would expect :) Anyway, that should apply to TranslatableInterface.

Copy link
Contributor

Choose a reason for hiding this comment

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

@pamil decoupling from Doctrine Common is a topic for a separate discussion and is not concern of this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

@michalmarcinkowski Sure, that's why I want to prevent coupling at the moment :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's stick to current convention to avoid inconsistency and if we decide to decouple we will do it everywhere at once.

@gonzalovilaseca
Copy link
Contributor

FWIW I'm working on a PR that gets rid of the abstract translation classes in favour of traits.

@michalmarcinkowski
Copy link
Contributor

@gonzalovilaseca that is great! If I will merge this PR will it make your rebase harder?

@gonzalovilaseca
Copy link
Contributor

@michalmarcinkowski Indeed ... but I might just copy this code to the trait, so go ahead, merge if you want and I'll find my way :-)

michalmarcinkowski added a commit that referenced this pull request Sep 23, 2015
@michalmarcinkowski michalmarcinkowski merged commit db369aa into Sylius:master Sep 23, 2015
@michalmarcinkowski
Copy link
Contributor

Thank you Magda! 👍

@CoderMaggie CoderMaggie deleted the translation-fluent-interfaces branch April 6, 2016 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Minor issues and PRs improving the current solutions (optimizations, typo fixes, etc.).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants