-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Replace PrestaTrust property with setter #9451
Conversation
* @param bool $enable | ||
* @return $this | ||
*/ | ||
public function toggleService($enable) |
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.
Not sure toggle is the right name when you are not toggling but setting a value.
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.
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. :)
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.
setEnabled
& isEnabled
for accessor?
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.
+1 for setEnabled
/ isEnabled
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.
+1 too
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.
or something like configureActivation
, setActivationStatus
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.
well rather setActivated in that case since it's a boolean
public function toggleService($enable) | ||
{ | ||
$this->enabled = (bool) $enable; | ||
return $this; |
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.
Symfony convention recommends an empty line before any return statement
fe5c214
to
a979fd2
Compare
Thanks @Quetzacoalt91 and everyone for review! |
This change is