-
Notifications
You must be signed in to change notification settings - Fork 299
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
Fix: isEmpty() return true if it's empty #332
Conversation
Fixed: isEmpty() return always false
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.
Fix code according to PSR or symfony codestyles
@@ -93,6 +93,13 @@ public function getLocale() | |||
*/ | |||
public function isEmpty() | |||
{ | |||
return false; | |||
foreach (get_object_vars($this) as $var => $value) { | |||
if (in_array($var, array('id', 'translatable', 'locale'))) |
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.
please use short syntax array
continue; | ||
|
||
if (!empty($value)) | ||
return false; |
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.
please use enclosing brackets {}
if (!empty($value)) | ||
return false; | ||
} | ||
return true; |
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.
return statement should be separated by 1 space line
isempty(): Fix code according to PSR or symfony codestyles
LGTM 👍 /cc @cursedcoder |
this method is meant to be overriden. we just provide a dummy impl as sensible defaults. |
The function isEmpty() return always false... fix it