Skip to content

Commit

Permalink
Use ported version of sniffs in coding style, relax ECS dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
OndraM committed Nov 26, 2020
1 parent ab96b10 commit 3cda75e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 27 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -5,6 +5,7 @@
<!-- There is always Unreleased section on the top. Subsections (Added, Changed, Fixed, Removed) should be added as needed. -->

## Unreleased
- Replace `Symplify\CodingStandard\Sniffs\Naming\[AbstractClassNameSniff, ClassNameSuffixByParentSniff, InterfaceNameSniff and TraitNameSniff]` with equivalent versions backported to this repository.

## 2.1.0 - 2020-11-25
- Add various dangerous function calls to list of forbidden functions.
Expand Down
23 changes: 15 additions & 8 deletions composer.json
Expand Up @@ -12,13 +12,17 @@
"require": {
"php": "^7.2",
"friendsofphp/php-cs-fixer": "^2.16.3",
"symplify/auto-bind-parameter": "<7.2.20",
"symplify/autowire-array-parameter": "<7.2.20",
"symplify/coding-standard": "<7.2.20",
"symplify/easy-coding-standard": "^7.2.3",
"symplify/package-builder": "<7.2.20",
"symplify/set-config-resolver": "<7.2.20",
"symplify/smart-file-system": "<7.2.20"
"slevomat/coding-standard": "^6.4.1",
"symplify/auto-bind-parameter": "<8.1.21",
"symplify/autowire-array-parameter": "<8.1.21",
"symplify/coding-standard": "<8.1.21",
"symplify/console-color-diff": "<8.1.21",
"symplify/easy-coding-standard": "<8.1.21",
"symplify/package-builder": "<8.1.21",
"symplify/parameter-name-guard": "<8.1.21",
"symplify/phpstan-extensions": "<8.1.21",
"symplify/set-config-resolver": "<8.1.21",
"symplify/smart-file-system": "<8.1.21"
},
"require-dev": {
"j13k/yaml-lint": "dev-master",
Expand Down Expand Up @@ -52,9 +56,12 @@
"@test"
],
"analyze": [
"vendor/bin/ecs check src/ tests/ -vv --ansi",
"vendor/bin/ecs check src/ tests/ --ansi",
"vendor/bin/phpstan.phar analyze -c phpstan.neon --ansi"
],
"fix": [
"./vendor/bin/ecs check ./src/ ./tests/ --ansi --fix"
],
"lint": [
"for FILE_NAME in *.yml *.yaml; do vendor/bin/yaml-lint \"$FILE_NAME\"; done",
"vendor/bin/yaml-sort-checker"
Expand Down
27 changes: 8 additions & 19 deletions easy-coding-standard.yaml
Expand Up @@ -7,6 +7,14 @@ imports:
services:
# Function http_build_query() should always have specified `$arg_separator` parameter
Lmc\CodingStandard\Fixer\SpecifyArgSeparatorFixer: ~
# Abstract class should have prefix "Abstract"
Lmc\CodingStandard\Sniffs\Naming\AbstractClassNameSniff: ~
# Classes should have suffix by theirs parent class/interface
Lmc\CodingStandard\Sniffs\Naming\ClassNameSuffixByParentSniff:
# Interface should have suffix "Interface"
Lmc\CodingStandard\Sniffs\Naming\InterfaceNameSniff: ~
# Trait should have suffix "Trait"
Lmc\CodingStandard\Sniffs\Naming\TraitNameSniff: ~

# Class and Interface names should be unique in a project, they should never be duplicated
PHP_CodeSniffer\Standards\Generic\Sniffs\Classes\DuplicateClassNameSniff: ~
Expand Down Expand Up @@ -250,25 +258,6 @@ services:
SlevomatCodingStandard\Sniffs\Exceptions\ReferenceThrowableOnlySniff: ~
# The @param, @return, @var and inline @var annotations should keep standard format
Symplify\CodingStandard\Fixer\Commenting\ParamReturnAndVarTagMalformsFixer: ~
# Abstract class should have prefix "Abstract"
Symplify\CodingStandard\Sniffs\Naming\AbstractClassNameSniff: ~
# Classes should have suffix by theirs parent class/interface
Symplify\CodingStandard\Sniffs\Naming\ClassNameSuffixByParentSniff:
defaultParentClassToSuffixMap:
'*Command': 'Command'
'*Controller': 'Controller'
'*Repository': 'Repository'
'*Presenter': 'Presenter'
'*Request': 'Request'
'*Response': 'Response'
'*FixerInterface': 'Fixer'
'*Sniff': 'Sniff'
'*Exception': 'Exception'
'*Handler': 'Handler'
# Interface should have suffix "Interface"
Symplify\CodingStandard\Sniffs\Naming\InterfaceNameSniff: ~
# Trait should have suffix "Trait"
Symplify\CodingStandard\Sniffs\Naming\TraitNameSniff: ~

parameters:
skip:
Expand Down

0 comments on commit 3cda75e

Please sign in to comment.