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 PrestaTrust property with setter #9451

Merged

Conversation

Quetzacoalt91
Copy link
Member

@Quetzacoalt91 Quetzacoalt91 commented Aug 15, 2018

Questions Answers
Branch? develop
Description? From a previous review, it was requested to remove a public property and add a setter instead.
Type? improvement
Category? BO
BC breaks? Property visibility changed
Deprecations? Nope
Fixed ticket? Fixed #10082
How to test? Modify your config.yml to disable PrestaTrust, and add a dump in the setter to check everything is properly set.

This change is Reviewable

@prestonBot prestonBot added develop Branch Improvement Type: Improvement labels Aug 15, 2018
* @param bool $enable
* @return $this
*/
public function toggleService($enable)
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure toggle is the right name when you are not toggling but setting a value.

Copy link
Member Author

Choose a reason for hiding this comment

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

I have been looking for a name used for enabling OR disabling in the same method. Having two different methods (enable() / disable()) wasn't convenient here.

Suggestions are appreciated. :)

Copy link
Contributor

Choose a reason for hiding this comment

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

setEnabled & isEnabled for accessor?

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 for setEnabled / isEnabled

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 too

Copy link
Contributor

Choose a reason for hiding this comment

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

or something like configureActivation, setActivationStatus

Copy link
Contributor

Choose a reason for hiding this comment

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

well rather setActivated in that case since it's a boolean

public function toggleService($enable)
{
$this->enabled = (bool) $enable;
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.

Symfony convention recommends an empty line before any return statement

PierreRambaud
PierreRambaud previously approved these changes Aug 23, 2018
@PierreRambaud PierreRambaud added the Waiting for QA Status: action required, waiting for test feedback label Aug 23, 2018
@ntiepresta ntiepresta self-assigned this Aug 24, 2018
@ntiepresta ntiepresta added QA ✔️ Status: check done, code approved and removed Waiting for QA Status: action required, waiting for test feedback labels Aug 24, 2018
@ntiepresta ntiepresta removed their assignment Aug 24, 2018
@prestonBot prestonBot added develop Branch Improvement Type: Improvement labels Aug 24, 2018
@mickaelandrieu mickaelandrieu merged commit 2c81d9b into PrestaShop:develop Aug 24, 2018
@mickaelandrieu
Copy link
Contributor

Thanks @Quetzacoalt91 and everyone for review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
develop Branch Improvement Type: Improvement QA ✔️ Status: check done, code approved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants