This repository has been archived by the owner on Jan 21, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
[WIP] Extended Zend Framework Coding Standard #1
Closed
+27,443
−37
Closed
Changes from 117 commits
Commits
Show all changes
225 commits
Select commit
Hold shift + click to select a range
ed2bd7d
Zend Framework Coding Standard - extended PSR-2. More Sniffs.
michalbundyra c55adc2
Removed redundant brackets
michalbundyra 4528d1e
Fix suggested type for arrays
michalbundyra 3ba6ca7
Package configuration
michalbundyra 34841a6
Added tests for TrailingArrayComma sniff
michalbundyra e895cbb
Use eolChar instead of "\n"
michalbundyra 1376b66
Comments fix
michalbundyra d60dba8
Added tests for UnusedUseStatement sniff
michalbundyra 815858f
Removed redundant brackets
michalbundyra 5bdde46
DocComment sniffs update + tests
michalbundyra 35288e5
Unused use statement fix - Annotations checks
michalbundyra fc18e69
Methods\LineAfter sniff update + tests
michalbundyra 12c0ebb
NamingConventions\ValidVariableName tests
michalbundyra 0748eb6
PHP\TypeCasting tests
michalbundyra 7bbd0a4
Added new rule: Squiz.WhiteSpace.CastSpacing.ContainsWhiteSpace
michalbundyra 17ae5d4
New sniff: Strings\NoConcatenationAtTheEnd + tests
michalbundyra 4a1b451
WhiteSpace\CommaSpacing sniff improvements + tests
michalbundyra baa1989
Updated rules:
michalbundyra 6746649
Added rule: Generic.NamingConventions.ConstructorName
michalbundyra 5314ee6
Added: PHP\LowerCaseKeyword Sniff + tests
michalbundyra c04a5fe
Tests fix - correct detecting testing files
michalbundyra 8ab47c4
Commenting\DocComment sniff fixes, added PHPDocs, test fix
michalbundyra 2da2480
Added PHP\CorrectClassNameCase sniff + tests
michalbundyra 45776da
Fix PHP\CorrectClassNameCase - skip "use" inside closures.
michalbundyra dc2afe8
Fix for UnusedUseStatement sniff
michalbundyra 0b14160
Added WhiteSpace\NoBlankLineAtStart sniff + tests
michalbundyra 8bd9b9d
Added Array\Format sniff + tests
michalbundyra 377f541
Added WhiteSpace\BlankLine sniff + tests and cs-fixes
michalbundyra aeb3011
Added new sniffs with tests
michalbundyra 9019d1a
Added ZendCodingStandard.PHP.InstantiatingParenthesis sniff + tests
michalbundyra 154bf21
PHP\InstantiatingParenthesis fix for anonymous classes and furureproo…
michalbundyra 76d30f5
Added PHP\RedundantSemicolon sniff + tests
michalbundyra 53797d3
Added new sniff `LogicalOperatorNotAtTheEndOfTheLine`
michalbundyra 9549ba1
Rename .fixed file
michalbundyra b488b16
Added traits sniffs with tests
michalbundyra 0eebc82
Added isGlobalUse method
michalbundyra 572fadc
Updated comments and PHPDocs
michalbundyra c5b45ad
Updated conditions
michalbundyra e20d51d
Removed redundant statement
michalbundyra 7aecb2b
Added more test cases for PHP\LowerCaseKeyword sniff
michalbundyra 29c5ef6
Added namespaces sniffs + tests
michalbundyra ce81157
Added more cases for Classes\UnusedUseStatement sniff
michalbundyra c264e18
Updated dependencies
michalbundyra 2f7334a
Enabled Squiz.WhiteSpace.LanguageConstructSpacing sniff
michalbundyra 8380db1
Moved sniff "Classes\UnusedUseStatement" to "Namespaces" namespace
michalbundyra aeac0e4
Allow empty lines in arrays
michalbundyra 7aa85c9
Updated to use PHP_CodeSniffer 3.0.0
michalbundyra 7c4c616
Optimize conditions - changed `substr` to `strpos`
michalbundyra 93994ea
Remove redundant brackets
michalbundyra 30a9d7f
FunctionComment sniff checks `@inheritDoc` tags
michalbundyra 93f27d4
Added ReturnValueWithoutBrackets sniff
michalbundyra cbab98d
Added default constant values in default phpunit configuration
michalbundyra 23c52b6
Fix phpunit tests with PHP_CodeSniffer 3.0.0
michalbundyra 402bd9d
Use property value instead of fixed string
michalbundyra 71158ea
PHP 5.6 compatibility checks
michalbundyra 6d26551
Default configuration in tests fix
michalbundyra 1cd328d
Added `@dataProvider` tag checks
michalbundyra e3595e0
Fix order of statements inside trait's curly brackets
michalbundyra 7c93e75
Updated to latest version of PHPUnit 6.2.1
michalbundyra 804c3fc
Tag `@dataProvider` should be above `@param` tag(s), not necessarily …
michalbundyra ea77ed6
Array/FormatSniff fix
michalbundyra 01388f5
Removed unnecessary parentheses
michalbundyra 61ff8af
New sniff: UnnecessaryParentheses
michalbundyra 4b34eb9
PHPDocs consistency - use `@inheritDoc` tag
michalbundyra efe3d0d
Strict comparisons
michalbundyra eabea35
Removed unused variable
michalbundyra dfb80c8
Improvements of FunctionComment sniff
michalbundyra f727152
Added missing token: `T_CLONE` which does not require parentheses
michalbundyra b799bcf
Allowed align values in multidimensional arrays with indexes
michalbundyra c85fb98
Added Formating Reference sniff
michalbundyra c82072a
Blank line in PHPDoc after description and before tags
michalbundyra 59aaab6
VariableComment sniff skip normal comment when there is blank line after
michalbundyra 8954525
CS fixes
michalbundyra 525f61c
One blank line after file PHPDocs
michalbundyra 66c607f
CS fixes
michalbundyra d02036d
Only one blank link allowed after file PHPDoc
michalbundyra dfbdfb9
Added sniff NoNullValues
michalbundyra 1cd1dc6
Updated to PHP_CodeSniffer 3.0.1
michalbundyra 0882b7b
Removed redundant comparision to `true`
michalbundyra bacdfda
Return type improvements + tests
michalbundyra 11854ff
Removed unused variables
michalbundyra 70b42fa
Methods\LineAfter sniff supports also anonymous classes
michalbundyra e79d16b
Added more test to increase sniffs coverage
michalbundyra ae163a6
Added missing error codes
michalbundyra 364db0d
Unused use sniff checks return types (PHP 7)
michalbundyra 19f5daf
Change to single token instead of arrays of token in "find" calls
michalbundyra 1645193
Removed old "todo"
michalbundyra c99480e
Parentheses are allowed with "list" method
michalbundyra 8366b44
CorrectClassNameCase sniff improvements
michalbundyra 7651f64
ReturnType sniff - PHP 7 and 7.1 (nullable types)
michalbundyra 1de64dd
ReturnType sniff moved from WhiteSpace to Formating
michalbundyra c9730a9
AlphabeticalSortedUses fix for single namespace in a file
michalbundyra 31ff8dc
Fixed alphabetical sorting of global uses and traits
michalbundyra 5127e4f
MultilineBrace sniff
michalbundyra 5f4c799
Fixed sorting global uses, traits and traits statements
michalbundyra 7c379bf
UnusedUseStatement sniff fix
michalbundyra c86c2a5
UnnecessaryParentheses sniff fix
michalbundyra ab76e6f
Added TernaryOperator sniff
michalbundyra 79f934e
Fixes in MultilineBrace sniff
michalbundyra 4aa2f2c
Renamed sniff LogicalOperatorNotAtTheEndOfTheLine -> BooleanOperator
michalbundyra 47af616
TernaryOperator sniff - nested ternary operator tests
michalbundyra c7c6b6b
MultilineBrace sniff - added test to check variable method calls
michalbundyra cb74414
Improvements of MultilineBrace sniff
michalbundyra 618ee11
Updated travis configuration
michalbundyra e4eebc4
Empty lines between use statements of different type (class, function…
michalbundyra 19e353b
Added InternalFunction sniff
michalbundyra 731bf85
Import PHP internal functions
michalbundyra 6955d3b
Updated README.md and added badges (travis build and coverage)
michalbundyra 47304d1
Renamed sniff InternalFunction to ImportInternalFunction and disabled…
michalbundyra bf10d1c
Removed redundant TODO comment
michalbundyra 9373f0f
Removed slack integration in travis configuration
michalbundyra f3e63f1
Fixed indents in sniff
michalbundyra a1157c6
Added *experimental* sniff WhiteSpace.ScopeIndent sniff
michalbundyra 8359875
ScopeIndent sniff checks also indents in arrays
michalbundyra d16680f
Updated to PHP_CodeSniffer 3.0.2
michalbundyra 2c6cf8c
Fix wrong token name
michalbundyra 52b435c
ScopeIndent sniff - fixed indent of closing bracket/parenthesis
michalbundyra 2854410
Removed cases from Arrays/Format sniff covered by ScopeIndent sniff
michalbundyra f806a77
Removed sniff ControlStructures/MultilineBrace in favor of ScopeInden…
michalbundyra 4af3053
CS fix - detected by ScopeIndent sniff
michalbundyra ec950b5
ReturnType sniff is now configurable
michalbundyra 7ba3a9f
ReturnType sniff: removed "double" and added "object" from simple ret…
michalbundyra 4666cd6
ReturnType sniff refactor and fix of removing non-whitespace tokens
michalbundyra 5ea427b
ReturnType sniff refactor
michalbundyra 730ba8b
Fixed .gitattributes - added missing 'export-ignore'
michalbundyra ffac5b6
Defined allowed simple type hints in sniff instead of using one from …
michalbundyra bfde1ad
Added comments in not implemented empty methods
michalbundyra c7cd4ac
Bumped PHPUnit to the latest version (^6.3)
michalbundyra 84254fb
Added non-fixable cases for ReturnType sniff
michalbundyra a7eddd7
PHP\TypeCasting sniff improvements
michalbundyra 0743bca
Added sniff to import internal PHP constants - disabled by default
michalbundyra ade1c6a
Import PHP internal constants
michalbundyra 828ee22
Renamed property
michalbundyra d1584c7
Moved condition to check if function is defined to return earlier
michalbundyra 7ae16bb
Single element array changed to one line
michalbundyra dd6c45c
Added bracket to clarify statement
michalbundyra 8960350
Spacing in PHPDocs - around tags and types
michalbundyra fb65d2e
Updated FunctionCommentSniff with latests PHP_CodeSniffer changes
michalbundyra 3327dbc
Added one more case to ScopeIndent sniff and simplified checks
michalbundyra 24930ff
DocComment sniff - property tagWithType is public
michalbundyra 601b54b
DocComment sniff - remove empty lines in doc comments
michalbundyra dfc1e08
Fixed typo in method name
michalbundyra 1220a24
Extracted namespace helper methods to internal trait
michalbundyra 92817e3
Added custom sniffs for function tags
michalbundyra 3019fbd
Updated comments for methods to pass with new sniffs
michalbundyra 27b724f
Added Commenting DataProviderTag sniff
michalbundyra 4e9465c
Added new sniff - Commenting NoInlineCommentAfterCurlyClose
michalbundyra 601ede7
Added new sniff - Commenting TagCase
michalbundyra d49fc71
Added new sniff - Commenting FunctionDisallowedTag
michalbundyra 434c7d2
Changed default number of spaces before colon to 1 in return type dec…
michalbundyra fa4c90f
Allow parenthesis on nested coalesce operator in ternaty operator
michalbundyra ff5a7f4
Removed PHP 5.6 compatibility checks mode in ruleset
michalbundyra c805c0f
`@param` tag is redundant for params with type hint and default null …
michalbundyra be67318
Updated to PHP_CodeSniffer 3.1.0 and fixed failing sniff
michalbundyra b5bf038
Fixed detecting thrown exception in methods
michalbundyra 0a4b63a
Updated Travis CI configuration
michalbundyra 08249aa
Updated dependencies - PHP_CodeSniffer 3.1.1
michalbundyra b1df502
Updated dependencies: PHP_CodeSniffer 3.2.2
michalbundyra 92c16b2
Member vars of nested class are now processed correctly
michalbundyra 7200810
Updated Functions Param and ReturnType Sniffs
michalbundyra a2bb0f8
Fixed ScopeIndent sniff
michalbundyra 212999a
Updated dependencies and Travis CI configuration
michalbundyra b877f17
Allow mixing array|iterable|\Generator|\Traversable with other types
michalbundyra 2aa1d14
Added support for defining array values
michalbundyra 8320881
Updated to PHP 7.1
michalbundyra 42c183f
Removed extension of Generic.PHP.LowerCaseKeyword as all fixes are me…
michalbundyra c84b297
Fixed replacing 'non-string' type hints
michalbundyra 4808418
PHP 7.1 features
michalbundyra 5cac362
Fixed doc-comment indent fixer with nested tags
michalbundyra 96fe4a6
Fixed calculating empty lines between tag with nested tags
michalbundyra 50e2b19
Added restriction for nested tags - currently allowed only `@var`
michalbundyra 5a87887
Enable ImportInternalConstant and ImportInternalFunction sniffs
michalbundyra 404b6c5
Added new sniffs
michalbundyra 79c3970
Arrays.FormatSniffs now extends AbstractArraySniff
michalbundyra 8ca8974
Removed duplicated sniff - Generic.Files.OneTraitPerFile
michalbundyra 31df9a2
Updated to PHP_CodeSniffer 3.2.3
michalbundyra a93f494
Removed unused while statement in UnusedUseStatementSniff
michalbundyra bb67bda
Disallow `@inheritDoc` and `{@inheritDoc}` tags
michalbundyra 4d11dfe
InstantiatingParenthesis sniff fix on instantiating from array values
michalbundyra dcc3497
Allow parenthesis after close square bracket
michalbundyra bc891eb
CorrectClassNameCase sniff fix for array values
michalbundyra 4bd1293
TagCase sniff is fixable
michalbundyra c534e79
New sniff - TagWithType - processing types with tags
michalbundyra 9958a1f
Updated VariableComment sniff to check class properties comments
michalbundyra b452bfe
Tag with content check moved to DocComment sniff
michalbundyra 2a2e49b
Multiline function comments
michalbundyra 30fd9b4
Added ConstVisibility sniff
michalbundyra 8dc0633
UnnecessaryParentheses sniff fix
michalbundyra c8d2093
UnnecessaryParentheses sniff fix
michalbundyra c8205ee
Require variable name with `@var` tag for non-class members
michalbundyra 285f397
Improve error message for missing parameter name in PHPDocs
michalbundyra d43afdb
Fixed error message - data providers without Provider suffix
michalbundyra ad85588
Added new sniff SingleSemicolon
michalbundyra 605a752
Better autofixing indents in doc comments tag descriptions
michalbundyra 15b4fdb
Do not use "parent" as param type hint/return type in interfaces
michalbundyra 176771d
Fixed loading imported classes/functions/constants
michalbundyra f8795bc
Better suggestion for class names (type hints, params, vars, throws, …
michalbundyra 4c3f464
Fixed issue with removing tags with description
michalbundyra 3ac062a
Added Throws sniff fixed file
michalbundyra fd40dd3
Import internal PHP constants and functions only in namespaced files
michalbundyra 0fef36c
Fixed place where imported function and constant are placed
michalbundyra 1e5fd8d
Fixed indents with "yield"
michalbundyra 12a083a
Added DeclareStrictTypes sniff
michalbundyra 70dfc76
Future-proof changes - tested with PHP_CodeSniffer dev-master
michalbundyra 4d261c5
More PHP 7.1 improvements
michalbundyra e9b9b9e
Updated PHPUnit configuration to not report risky tests
michalbundyra 4a137cf
Added new sniff Files.DeclareStrictTypes
michalbundyra 09c34a1
TrailingArrayCommaSniff improvements
michalbundyra ed58b09
Do not include removed use statements when processing fixed file
michalbundyra 55ed574
Updated doc comments
michalbundyra 21dc5d7
Return numTags+1 to not run this sniff anymore in the file
michalbundyra d6f4292
Use phpcs: annotations instead of @codingStandards*
michalbundyra 33addb1
Added phpcs.xsd schema in XML ruleset definitions
michalbundyra 1db8b64
Added PEAR.Commenting.InlineComment to disallow hash (#) comments
michalbundyra bec92d7
Added phpcs and @codingStandards* sniffs
michalbundyra 14a9253
Added Array.DoubleArrow sniff to check spacing around double arrow
michalbundyra 1ab48b1
Typo fix
michalbundyra de8c234
Update LICENSE.md
michalbundyra 4791944
Added support documents in docs/ directory
michalbundyra c6f36c0
Fixed spaces in README.md
michalbundyra 6288f38
Removed redundant PHPUnit whitelist config attr
michalbundyra e9a19c6
DeclareStrictTypes fix - changed how autofixer works
michalbundyra 5131a5a
Added Heredoc sniff - tag must be uppercase and cannot contain any sp…
michalbundyra 2800f34
Added more cases for ScopeIndent sniff
michalbundyra 4d14354
Improvements for Throw sniff
michalbundyra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
coverage_clover: clover.xml | ||
json_path: coveralls-upload.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.coveralls.yml | ||
.gitattributes export-ignore | ||
.gitignore export-ignore | ||
.travis.yml export-ignore | ||
phpcs.xml export-ignore | ||
phpunit.xml.dist export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
vendor/ | ||
phpunit.xml | ||
clover.xml | ||
coveralls-upload.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
sudo: false | ||
|
||
language: php | ||
|
||
cache: | ||
directories: | ||
- $HOME/.composer/cache | ||
- vendor | ||
|
||
env: | ||
global: | ||
- COMPOSER_ARGS="--no-interaction" | ||
- COVERAGE_DEPS="satooshi/php-coveralls" | ||
- LEGACY_DEPS="phpunit/phpunit" | ||
|
||
matrix: | ||
include: | ||
- php: 5.6 | ||
env: | ||
- DEPS=lowest | ||
- php: 5.6 | ||
env: | ||
- DEPS=locked | ||
- TEST_COVERAGE=true | ||
- php: 5.6 | ||
env: | ||
- DEPS=latest | ||
- php: 7 | ||
env: | ||
- DEPS=lowest | ||
- php: 7 | ||
env: | ||
- DEPS=locked | ||
- CS_CHECK=true | ||
- php: 7 | ||
env: | ||
- DEPS=latest | ||
- php: 7.1 | ||
env: | ||
- DEPS=lowest | ||
- php: 7.1 | ||
env: | ||
- DEPS=locked | ||
- php: 7.1 | ||
env: | ||
- DEPS=latest | ||
- php: nightly | ||
env: | ||
- DEPS=lowest | ||
- php: nightly | ||
env: | ||
- DEPS=locked | ||
- php: nightly | ||
env: | ||
- DEPS=latest | ||
allow_failures: | ||
- php: nightly | ||
|
||
before_install: | ||
- if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi | ||
- travis_retry composer self-update | ||
|
||
install: | ||
- travis_retry composer install $COMPOSER_ARGS --ignore-platform-reqs | ||
- if [[ $TRAVIS_PHP_VERSION =~ ^5.6 ]]; then travis_retry composer update $COMPOSER_ARGS --with-dependencies $LEGACY_DEPS ; fi | ||
- if [[ $DEPS == 'latest' ]]; then travis_retry composer update $COMPOSER_ARGS ; fi | ||
- if [[ $DEPS == 'lowest' ]]; then travis_retry composer update $COMPOSER_ARGS --prefer-lowest --prefer-stable ; fi | ||
- if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry composer require --dev $COMPOSER_ARGS $COVERAGE_DEPS ; fi | ||
- stty cols 120 | ||
- COLUMNS=120 composer show | ||
|
||
script: | ||
- if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage ; else composer test ; fi | ||
- if [[ $CS_CHECK == 'true' ]]; then composer cs-check ; fi | ||
|
||
after_script: | ||
- if [[ $TEST_COVERAGE == 'true' ]]; then composer upload-coverage ; fi | ||
|
||
notifications: | ||
email: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Shouldn't this append
export-ignore
?