Skip to content

First round of changes needed for PHPCS-2 migration#101

Closed
photodude wants to merge 1 commit intojoomla:phpcs-2from
photodude:master
Closed

First round of changes needed for PHPCS-2 migration#101
photodude wants to merge 1 commit intojoomla:phpcs-2from
photodude:master

Conversation

@photodude
Copy link
Copy Markdown
Contributor

This PR includes the first round of code changes to provide support for PHPCS version 2.x

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

If you don't actually provide any fixing code, then reporting error/warning as fixable would fail coding standard tests. You don't have any tests in the standard and that's why you don't see the difference.

Nobody really removed addError or addWarning methods. And there can be situations, when error can't be fixed at all where they can be used.

@aik099
Copy link
Copy Markdown

aik099 commented Apr 9, 2015

I think, that file removal in favor of build-in sniffs mentioned in ruleset.xml should be done as separate PR associated with #104 task.

@photodude
Copy link
Copy Markdown
Contributor Author

I would agree only PR #102 associated with issue #104 is specific to the current master branch compatible with the PHPCS-1.5x version
This PR is related to development for a PHPCS-2.x compatible version. Unfortunately that means some duplication during development.

- [ ] ConcatenationSpacingSniff (see issue #104 )
- [ ] SuperfluousWhitespaceSniff (see issue #104 )

For removals related to code standards with the PHPCS-1.5.x compatible master branch see PR #102

@photodude
Copy link
Copy Markdown
Contributor Author

Reference issue #53

@aik099
Copy link
Copy Markdown

aik099 commented Apr 21, 2015

Merge conflict here. Probably you need to rebase and squash.

Increased notional limit to 150 chars.

Reorder to better match the Squiz/ruleset.xml

This improves readability when migrating versions
Also increased the max line the comment to 150 chars long since it was that way in the code

Match Squiz standard CastSpacingSniff.php

- Since we are not making any specific changes here, this file should likely be eliminated and just include the Squiz standard

add Squiz.WhiteSpace.CastSpacingSniff rule so duplication can be eliminated.

This file is identical to the Squiz standard CastSpacingSniff.php

- added rule to the ruleset and delete the unnecessary file

rebuild from source with modifications

- add T_FUNCTION, and T_CLASS, to array of tokens
- remove parenthesis_opener checks (as was done previously)
- add T_COMMENT and T_WHILE to the $tokens[$trailingContent] checks (as was done previously)

nothing special here, replace with generic rule

add Generic.WhiteSpace.DisallowSpaceIndentSniff rule

This is now a Joomla class sniff

nothing special here, replace with generic rule

- add Generic.PHP.LowerCaseConstantSniff rule

nothing special here, replace with Squiz rule

nothing special here, replace with Squiz rule

nothing special here, replace with PEAR rule

Update rules to use source standards to eliminate unnecessary duplication

add comment about the removed section "parenthesis_opener"

- by adding a comment about what was intentionally removed we will help the coding standard be able to make changes quicker when the source standard changes or has bug fixes applied.

T_DOC_COMMENT token has also been removed

The T_DOC_COMMENT token has also been removed, replaced instead by T_DOC_COMMENT_OPEN_TAG

T_DOC_COMMENT token has also been removed

The T_DOC_COMMENT token has also been removed, replaced instead by T_DOC_COMMENT_OPEN_TAG

T_DOC_COMMENT token has been removed

The T_DOC_COMMENT token has been removed, replaced instead by T_DOC_COMMENT_OPEN_TAG

T_DOC_COMMENT token has been removed

The T_DOC_COMMENT token has been removed, replaced instead by T_DOC_COMMENT_OPEN_TAG

T_DOC_COMMENT token has been removed

The T_DOC_COMMENT token has been removed, replaced instead by T_DOC_COMMENT_OPEN_TAG

Add PSR2.ControlStructures.ElseIfDeclaration rule

Replace with PSR2.ControlStructures.ElseIfDeclaration rule

Sniff is not part of the rule names

copy PR joomla#106 Better documentation of differences from core standards
@photodude
Copy link
Copy Markdown
Contributor Author

close and reopen with rebase and squashed commits as PR #109

@photodude photodude closed this Apr 25, 2015
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.

2 participants