bump to ECS 4

This commit is contained in:
Tomas Votruba 2018-04-02 00:40:05 +02:00
parent 534e688fba
commit e15cbbf58d
3 changed files with 27 additions and 28 deletions

View File

@ -20,11 +20,11 @@
"symfony/console": "^4.0",
"symfony/dependency-injection": "^4.0",
"symfony/finder": "^4.0",
"symplify/better-reflection-docblock": "^3.2",
"symplify/package-builder": "^3.2"
"symplify/better-reflection-docblock": "^4.0",
"symplify/package-builder": "^4.0"
},
"require-dev": {
"symplify/easy-coding-standard": "^3.2.28",
"symplify/easy-coding-standard": "^4.0",
"phpstan/phpstan-shim": "^0.9",
"phpunit/phpunit": "^7.0",
"slam/php-cs-fixer-extensions": "^1.13",
@ -70,5 +70,7 @@
],
"config": {
"sort-packages": true
}
},
"minimum-stability": "beta",
"prefer-stable": true
}

View File

@ -1,21 +1,19 @@
includes:
- vendor/symplify/easy-coding-standard/config/psr2.neon
- vendor/symplify/easy-coding-standard/config/php71.neon
- vendor/symplify/easy-coding-standard/config/symplify.neon
- vendor/symplify/easy-coding-standard/config/common.neon
- vendor/symplify/easy-coding-standard/config/clean-code.neon
imports:
- { resource: 'vendor/symplify/easy-coding-standard/config/psr2.yml' }
- { resource: 'vendor/symplify/easy-coding-standard/config/php71.yml' }
- { resource: 'vendor/symplify/easy-coding-standard/config/symplify.yml' }
- { resource: 'vendor/symplify/easy-coding-standard/config/common.yml' }
- { resource: 'vendor/symplify/easy-coding-standard/config/clean-code.yml' }
checkers:
services:
# Metrics
PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff:
absoluteLineLimit: 120
PHP_CodeSniffer\Standards\Generic\Sniffs\Metrics\CyclomaticComplexitySniff:
absoluteComplexity: 6
PHP_CodeSniffer\Standards\Generic\Sniffs\Metrics\NestingLevelSniff:
absoluteNestingLevel: 3
# Class should be Final or Abstract
- SlamCsFixer\FinalInternalClassFixer
SlamCsFixer\FinalInternalClassFixer: ~
Symplify\CodingStandard\Sniffs\DependencyInjection\NoClassInstantiationSniff:
extraAllowedClasses:
@ -42,14 +40,13 @@ parameters:
skip:
Symplify\CodingStandard\Fixer\Php\ClassStringToClassConstantFixer:
# classes might not exist
- */src/Rector/Contrib/*/*Rector.php
- */packages/NodeTypeResolver/**/PerNodeTypeResolver/**TypeResolver.php
- */packages/NodeTypeResolver/**/PerNodeTypeResolver/**TypeResolver/*Test.php
- packages/BetterReflection/src/Reflector/SmartClassReflector.php
- src/Rector/AbstractPHPUnitRector.php
- '*/src/Rector/Contrib/*/*Rector.php'
- '*/packages/NodeTypeResolver/**/PerNodeTypeResolver/**TypeResolver.php'
- '*/packages/NodeTypeResolver/**/PerNodeTypeResolver/**TypeResolver/*Test.php'
- 'packages/BetterReflection/src/Reflector/SmartClassReflector.php'
- 'src/Rector/AbstractPHPUnitRector.php'
skip_codes:
# empty arguments passing
PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\ValidDefaultValueSniff.NotAtEnd:
- src/Rector/Dynamic/Configuration/ArgumentReplacerRecipe.php
- src/Rector/Contrib/PHPUnit/SpecificMethod/AssertTrueFalseToSpecificMethodRector.php
- 'src/Rector/Dynamic/Configuration/ArgumentReplacerRecipe.php'
- 'src/Rector/Contrib/PHPUnit/SpecificMethod/AssertTrueFalseToSpecificMethodRector.php'

View File

@ -1,22 +1,22 @@
checkers:
# remove unused "use" statements
- PhpCsFixer\Fixer\Import\NoUnusedImportsFixer
PhpCsFixer\Fixer\Import\NoUnusedImportsFixer: ~
# order use statements A-Z
- PhpCsFixer\Fixer\Import\OrderedImportsFixer
PhpCsFixer\Fixer\Import\OrderedImportsFixer: ~
# remove leading slash ("\") at imports
- PhpCsFixer\Fixer\Import\NoLeadingImportSlashFixer
PhpCsFixer\Fixer\Import\NoLeadingImportSlashFixer: ~
# remove extra spaces from DocBlocks
- PhpCsFixer\Fixer\Comment\NoTrailingWhitespaceInCommentFixer
PhpCsFixer\Fixer\Comment\NoTrailingWhitespaceInCommentFixer: ~
# clean empty doc blocks, e.g. after annotation removal
- PhpCsFixer\Fixer\Phpdoc\NoEmptyPhpdocFixer
PhpCsFixer\Fixer\Phpdoc\NoEmptyPhpdocFixer: ~
# import all namespaces
Symplify\CodingStandard\Fixer\Import\ImportNamespacedNameFixer:
include_doc_blocks: true
# add spaces between class elements
- PhpCsFixer\Fixer\ClassNotation\ClassAttributesSeparationFixer
PhpCsFixer\Fixer\ClassNotation\ClassAttributesSeparationFixer: ~