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

A Little Housekeeping #751

Merged
merged 1 commit into from
Jan 14, 2015
Merged

A Little Housekeeping #751

merged 1 commit into from
Jan 14, 2015

Conversation

XWB
Copy link
Contributor

@XWB XWB commented Jan 14, 2015

This bundle can use a little cleanup. I used https://github.com/FriendsOfPHP/PHP-CS-Fixer to resolve most issues.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.68%) when pulling 43b1ddd on XWB:php-cs-fixer into acc9604 on ruflin:master.

@@ -100,7 +96,7 @@ public function getScript()
return $this->_data;
}

return null;
return;
Copy link
Owner

Choose a reason for hiding this comment

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

I assume this is done automatically by the cleanup script. I'm not a fan of "empty" return, but if we have an automated way to cleanup things, I can also "life" with this version.

@ruflin
Copy link
Owner

ruflin commented Jan 14, 2015

@XWB I like almost all changes except the return null; and ' . ' without space. It also changes some of the standards we used before but I prefer to have an automatic script that fixes the coding issues and it aligned with a standard. We should include this in our build file if possible.

ruflin added a commit that referenced this pull request Jan 14, 2015
@ruflin ruflin merged commit 45e383e into ruflin:master Jan 14, 2015
@XWB
Copy link
Contributor Author

XWB commented Jan 14, 2015

I assume this is done automatically by the cleanup script.

Correct, though we can tweak the script a bit. The following options are available:

php php-cs-fixer.phar fix /path/to/project --level=psr0
php php-cs-fixer.phar fix /path/to/project --level=psr1
php php-cs-fixer.phar fix /path/to/project --level=psr2
php php-cs-fixer.phar fix /path/to/project --level=symfony

According to http://cs.sensiolabs.org/, the level symfony includes:

* concat_without_spaces [symfony] Concatenation should be used
without spaces.
* empty_return [symfony] A return statement wishing
to return nothing should be simply "return".

The Symfony fixer is not be required for ruflin/elastica so we could ignore it in future clean-ups.

@XWB
Copy link
Contributor Author

XWB commented Jan 14, 2015

@ruflin I didn't expect you to merge this PR so quickly :P

If you want, you could revert the commit (or remove it and force update the master branch) and I can send a new PR without the Symfony code standard (see comment above).

@ruflin
Copy link
Owner

ruflin commented Jan 15, 2015

As the Symfony bundle is one of the biggest Elastica users, I don't think we need to revert anything. I prefer to have a reliable checker for the styles. What happens if you now apply only the first three? Would that lead to any changes?

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.

3 participants