make ECS optional dependency to reduce amount of installed packages and allow own cs tools

Signed-off-by: Tomas Votruba <tomas.vot@gmail.com>
This commit is contained in:
Tomas Votruba 2018-11-30 17:16:16 +01:00
parent 8696ef2c62
commit 26253a0872
2 changed files with 9 additions and 2 deletions

View File

@ -21,12 +21,12 @@
"symfony/finder": "^3.4|^4.1",
"symfony/process": "^3.4|^4.1",
"symplify/better-phpdoc-parser": "^5.2",
"symplify/easy-coding-standard": "^5.2",
"symplify/package-builder": "^5.2",
"thecodingmachine/safe": "^0.1.6"
},
"require-dev": {
"phpunit/phpunit": "^7.4",
"symplify/easy-coding-standard": "^5.2",
"symplify/monorepo-builder": "^5.2",
"symplify/phpstan-extensions": "^5.2",
"thecodingmachine/phpstan-safe-rule": "^0.1.0",
@ -92,6 +92,9 @@
"tests/Rector/Namespace_/PseudoNamespaceToNamespaceRector/Source"
]
},
"suggest": {
"symplify/easy-coding-standard": "Required to enable '--with-style' option. Use in case you don't have PHP_CodeSniffer or PHP-CS-Fixer yet."
},
"scripts": {
"complete-check": [
"@check-cs",

View File

@ -47,6 +47,10 @@ final class AfterRectorCodingStyle
return;
}
throw new InvalidConfigurationException(sprintf('ECS bin file not found in "%s"', self::ECS_BIN_PATH));
throw new InvalidConfigurationException(sprintf(
'To active "--with-style" you need EasyCodingStandard.%sRun "composer require symplify/easy-coding-standard --dev" to get it.%sYou can also remove "--with-style" and run PHP_CodeSniffer or PHP-CS-Fixer on changed code instead.',
PHP_EOL,
PHP_EOL
));
}
}