Skip to content

Commit

Permalink
Add ordered imports test
Browse files Browse the repository at this point in the history
  • Loading branch information
zingimmick committed Jul 28, 2020
1 parent b106a1a commit 0e9604c
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
UselessFunctionDocCommentSniff::class . '.UselessDocComment' => null,
UseDeclarationSniff::class . '.UseAfterBrace' => null,
AnonClassDeclarationSniff::class . '.SpaceAfterKeyword' => null,
ControlStructureSpacingSniff::class.'.LineAfterClose'=>null
ControlStructureSpacingSniff::class . '.LineAfterClose' => null,
]
);
};
12 changes: 12 additions & 0 deletions correct/TestClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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;
}
}
2 changes: 1 addition & 1 deletion ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
12 changes: 12 additions & 0 deletions wrong/TestClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}

0 comments on commit 0e9604c

Please sign in to comment.