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

Fix: isEmpty() return true if it's empty #332

Merged
merged 11 commits into from
Oct 12, 2016
Merged

Conversation

corentinheadoo
Copy link
Contributor

The function isEmpty() return always false... fix it

Copy link
Contributor

@cursedcoder cursedcoder left a 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')))
Copy link
Contributor

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;
Copy link
Contributor

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;
Copy link
Contributor

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

corentin added 4 commits October 12, 2016 10:06
@Pierstoval
Copy link

LGTM 👍 /cc @cursedcoder

@cursedcoder cursedcoder merged commit 1113f4f into KnpLabs:master Oct 12, 2016
@docteurklein
Copy link
Contributor

docteurklein commented Oct 16, 2016

this method is meant to be overriden. we just provide a dummy impl as sensible defaults.
do we want a "smart" isEmpty?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants