? ? Pending

User tests: Successful: Unsuccessful:

avatar mbabker
mbabker
1 Jul 2016

Summary of Changes

Adds support for the PHP-CS-Fixer tool as a means to help programmatically review and correct code style issues in PHP code. This initial implementation only includes the non-third-party libraries directory code.

Testing Instructions

Review the package's documentation to ensure the selected fixers are in line with the project's code style rules and review the changes made (sorry it's a lot of files but it's either that or do a PR for a couple directories at a time) to ensure they are consistent with the project's code style rules.

Note some changes in here are more for consistency and behavior than a PHPCS enforcement such as changing return null; to return; or the trailing comma on multi-line arrays.

avatar mbabker mbabker - open - 1 Jul 2016
avatar mbabker mbabker - change - 1 Jul 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 1 Jul 2016
Labels Added: ? ?
avatar photodude
photodude - comment - 2 Jul 2016

So this mostly just fixes coding standards issues related to PSR-1 and PSR-2?

avatar mbabker
mbabker - comment - 2 Jul 2016

Without writing custom fixers pretty much. It can also do some stuff we do
as a practice but not enforced in the standard like variable or array
key/value alignment. Considering we're one of the few who have standards
vastly opposite of PSR-2 there's only so much that can be pulled from the
source repo.

On Friday, July 1, 2016, Walt Sorensen notifications@github.com wrote:

So this mostly just fixes coding standards issues related to PSR-1 and
PSR-2?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#10992 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAWfoYQ7wnkEWNMcnim0llBqFC-Xua3yks5qRdiqgaJpZM4JDhHt
.

avatar brianteeman brianteeman - change - 2 Jul 2016
Labels
avatar brianteeman brianteeman - change - 2 Jul 2016
Category Code style
avatar laoneo
laoneo - comment - 3 Jul 2016

Thumbs up for the auto code fixer. To safely test this PR, why not breaking it into smaller peaces?

avatar photodude
photodude - comment - 3 Jul 2016

@laoneo We have another set of auto code fixers with the in development update to PHPCS2. There is still some work to be done verifying the code style coverage is valid and testing/verifying the fixers.

avatar pritalpatel pritalpatel - test_item - 4 Jul 2016 - Tested unsuccessfully
avatar pritalpatel
pritalpatel - comment - 4 Jul 2016

I have tested this item ? unsuccessfully on f4653fb

While I was trying to apply patch using patch tester first it took long time to apply then suddenly getting white page. Enabled error reporting to development but still not showing any error and just showing white/blank page. There is nothing in view source as well.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10992.

avatar pritalpatel
pritalpatel - comment - 4 Jul 2016

But when I have downloaded https://codeload.github.com/mbabker/joomla-cms/zip/phpcs-fixer and install joomla using it that works.
I have tested joomla backend using gherkin scenarios and found it working.
screen shot 2016-07-04 at 09 12 57

Note: I haven't tested as per given testing info.

Review the package's documentation to ensure the selected fixers are in line with the project's code style rules

but I have tested that after this patch joomla admin works normally or not.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10992.

avatar pritalpatel pritalpatel - test_item - 4 Jul 2016 - Tested successfully
avatar pritalpatel
pritalpatel - comment - 4 Jul 2016

I have tested this item successfully on f4653fb


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10992.

avatar pritalpatel
pritalpatel - comment - 4 Jul 2016

Also wants to mention that I haven't checked all the area of admin. I have checked Users, Content, Category, Access Group and levels.

avatar bertmert bertmert - test_item - 5 Jul 2016 - Tested successfully
avatar bertmert
bertmert - comment - 5 Jul 2016

I have tested this item successfully on f4653fb

Checked all applied fixers with description at https://github.com/FriendsOfPhp/PHP-CS-Fixer
and compared with coding standards http://joomla.github.io/coding-standards/?coding-standards/chapters/php.md

Applied patch 2days ago. Joomla worked fine without any issues 'til now.

Code review of all files of this PR.

Tested .php_cs configuration with several 3rd-party libraries and custom extensions and FE /components/ several hours and added "wrong code styles". Success.

Couldn't find any break of Joomla Coding Standards produced by PHP-CS-Fixer. Just "nicer" and more consistent code than before.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10992.

avatar brianteeman brianteeman - change - 5 Jul 2016
Status Pending Ready to Commit
Labels
avatar brianteeman
brianteeman - comment - 5 Jul 2016

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10992.

avatar joomla-cms-bot joomla-cms-bot - change - 5 Jul 2016
Labels Added: ?
avatar roland-d roland-d - change - 16 Jul 2016
Milestone Added:
avatar wilsonge
wilsonge - comment - 13 Aug 2016

@mbabker Rebase this please

avatar mbabker
mbabker - comment - 13 Aug 2016

Done

Add a Comment

Login with GitHub to post a comment