PERCS2x0Set.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. declare(strict_types=1);
  3. /*
  4. * This file is part of PHP CS Fixer.
  5. *
  6. * (c) Fabien Potencier <fabien@symfony.com>
  7. * Dariusz Rumiński <dariusz.ruminski@gmail.com>
  8. *
  9. * This source file is subject to the MIT license that is bundled
  10. * with this source code in the file LICENSE.
  11. */
  12. namespace PhpCsFixer\RuleSet\Sets;
  13. use PhpCsFixer\RuleSet\AbstractRuleSetDescription;
  14. /**
  15. * @internal
  16. *
  17. * PER Coding Style v2.0.
  18. *
  19. * @see https://github.com/php-fig/per-coding-style/blob/2.0.0/spec.md
  20. */
  21. final class PERCS2x0Set extends AbstractRuleSetDescription
  22. {
  23. public function getName(): string
  24. {
  25. return '@PER-CS2.0';
  26. }
  27. public function getRules(): array
  28. {
  29. return [
  30. '@PER-CS1.0' => true,
  31. 'array_indentation' => true,
  32. 'cast_spaces' => true,
  33. 'concat_space' => ['spacing' => 'one'],
  34. 'function_declaration' => [
  35. 'closure_fn_spacing' => 'none',
  36. ],
  37. 'method_argument_space' => true,
  38. 'single_line_empty_body' => true,
  39. ];
  40. }
  41. public function getDescription(): string
  42. {
  43. return 'Rules that follow `PER Coding Style 2.0 <https://www.php-fig.org/per/coding-style/>`_.';
  44. }
  45. }