diff --git a/config/config.php b/config/config.php index 119b224..7d36dfa 100644 --- a/config/config.php +++ b/config/config.php @@ -109,7 +109,7 @@ UselessFunctionDocCommentSniff::class . '.UselessDocComment' => null, UseDeclarationSniff::class . '.UseAfterBrace' => null, AnonClassDeclarationSniff::class . '.SpaceAfterKeyword' => null, - ControlStructureSpacingSniff::class.'.LineAfterClose'=>null + ControlStructureSpacingSniff::class . '.LineAfterClose' => null, ] ); }; diff --git a/correct/TestClass.php b/correct/TestClass.php index 285673e..6d917a2 100644 --- a/correct/TestClass.php +++ b/correct/TestClass.php @@ -7,6 +7,8 @@ use Zing\CodingStandard\Correct\Concerns\Testable; use Zing\CodingStandard\Correct\Concerns\TraitA; use Zing\CodingStandard\Correct\Concerns\TraitB; +use function count; +use const PHP_EOL; class TestClass implements TestableContract { @@ -107,4 +109,14 @@ public function logicalOperators(): bool { return random_int(0, 1) !== 0 && random_int(0, 1) !== 0; } + + public function useFunction() + { + return count([]); + } + + public function useConst() + { + return PHP_EOL; + } } diff --git a/ecs.php b/ecs.php index 52986ae..f920030 100644 --- a/ecs.php +++ b/ecs.php @@ -10,12 +10,12 @@ $containerConfigurator->import(__DIR__.'/config/config.php'); $parameters = $containerConfigurator->parameters(); $parameters->set(Option::SETS, [ - SetList::PSR_12, SetList::PHP_70, SetList::PHP_71, SetList::DEAD_CODE, SetList::CLEAN_CODE, SetList::COMMON, + SetList::PSR_12, ]); $parameters->set(Option::PATHS, [ 'config', diff --git a/wrong/TestClass.php b/wrong/TestClass.php index 4710934..c3c97d3 100644 --- a/wrong/TestClass.php +++ b/wrong/TestClass.php @@ -2,6 +2,8 @@ namespace Zing\CodingStandard\Correct; +use const PHP_EOL; +use function count; use Zing\CodingStandard\Correct\Concerns\Testable; use Zing\CodingStandard\Correct\Concerns\TraitA; use Zing\CodingStandard\Correct\Concerns\TraitB; @@ -92,4 +94,14 @@ public function logicalOperators():bool { return random_int(0, 1) !== 0 and random_int(0, 1) !== 0; } + + public function useFunction() + { + return count([]); + } + + public function useConst() + { + return PHP_EOL; + } } \ No newline at end of file