ecs.php 969 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. declare(strict_types=1);
  3. use PhpCsFixer\Fixer\ClassNotation\OrderedTypesFixer;
  4. use PhpCsFixer\Fixer\Phpdoc\PhpdocTypesOrderFixer;
  5. use SlevomatCodingStandard\Sniffs\Whitespaces\DuplicateSpacesSniff;
  6. use Symplify\EasyCodingStandard\Config\ECSConfig;
  7. return static function (ECSConfig $ecsConfig): void {
  8. $ecsConfig->import(__DIR__ . '/vendor/brick/coding-standard/ecs.php');
  9. $libRootPath = realpath(__DIR__ . '/../..');
  10. $ecsConfig->paths(
  11. [
  12. $libRootPath . '/src',
  13. $libRootPath . '/tests',
  14. $libRootPath . '/phpunit.php',
  15. $libRootPath . '/random-tests.php',
  16. __FILE__,
  17. ],
  18. );
  19. $ecsConfig->skip([
  20. // Allows alignment in test providers
  21. DuplicateSpacesSniff::class => [$libRootPath . '/tests'],
  22. // We want to keep BigNumber|int|float|string order
  23. OrderedTypesFixer::class => null,
  24. PhpdocTypesOrderFixer::class => null,
  25. ]);
  26. };