.php-cs-fixer.dist.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * PHP-CS-Fixer config for ZipStream-PHP
  5. * @author Nicolas CARPi <nico-git@deltablot.email>
  6. * @copyright 2022 Nicolas CARPi
  7. * @see https://github.com/maennchen/ZipStream-PHP
  8. * @license MIT
  9. * @package maennchen/ZipStream-PHP
  10. */
  11. use PhpCsFixer\Config;
  12. use PhpCsFixer\Finder;
  13. $finder = Finder::create()
  14. ->exclude('.github')
  15. ->exclude('.phpdoc')
  16. ->exclude('docs')
  17. ->exclude('tools')
  18. ->exclude('vendor')
  19. ->in(__DIR__);
  20. $config = new Config();
  21. return $config->setRules([
  22. '@PER' => true,
  23. '@PER:risky' => true,
  24. '@PHP81Migration' => true,
  25. '@PHPUnit84Migration:risky' => true,
  26. 'array_syntax' => ['syntax' => 'short'],
  27. 'class_attributes_separation' => true,
  28. 'declare_strict_types' => true,
  29. 'dir_constant' => true,
  30. 'is_null' => true,
  31. 'no_homoglyph_names' => true,
  32. 'no_null_property_initialization' => true,
  33. 'no_php4_constructor' => true,
  34. 'no_unused_imports' => true,
  35. 'no_useless_else' => true,
  36. 'non_printable_character' => true,
  37. 'ordered_imports' => true,
  38. 'ordered_class_elements' => true,
  39. 'php_unit_construct' => true,
  40. 'pow_to_exponentiation' => true,
  41. 'psr_autoloading' => true,
  42. 'random_api_migration' => true,
  43. 'return_assignment' => true,
  44. 'self_accessor' => true,
  45. 'semicolon_after_instruction' => true,
  46. 'short_scalar_cast' => true,
  47. 'simplified_null_return' => true,
  48. 'single_blank_line_before_namespace' => true,
  49. 'single_class_element_per_statement' => true,
  50. 'single_line_comment_style' => true,
  51. 'single_quote' => true,
  52. 'space_after_semicolon' => true,
  53. 'standardize_not_equals' => true,
  54. 'strict_param' => true,
  55. 'ternary_operator_spaces' => true,
  56. 'trailing_comma_in_multiline' => true,
  57. 'trim_array_spaces' => true,
  58. 'unary_operator_spaces' => true,
  59. 'global_namespace_import' => [
  60. 'import_classes' => true,
  61. 'import_functions' => true,
  62. 'import_constants' => true,
  63. ],
  64. ])
  65. ->setFinder($finder)
  66. ->setRiskyAllowed(true);