.php-cs-fixer.php-highest.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. if (PHP_VERSION_ID < 8_03_00 || PHP_VERSION_ID >= 8_04_00) {
  13. fwrite(STDERR, "PHP CS Fixer's config for PHP-HIGHEST can be executed only on highest supported PHP version - 8.3.*.\n");
  14. fwrite(STDERR, "Running it on lower PHP version would prevent calling migration rules.\n");
  15. exit(1);
  16. }
  17. $config = require __DIR__.'/.php-cs-fixer.dist.php';
  18. $config->setRules(array_merge($config->getRules(), [
  19. '@PHP83Migration' => true,
  20. '@PHP82Migration:risky' => true,
  21. 'phpdoc_to_property_type' => [ // experimental
  22. 'types_map' => [
  23. 'TFixerInputConfig' => 'array',
  24. 'TFixerComputedConfig' => 'array',
  25. 'TFixer' => '\PhpCsFixer\AbstractFixer',
  26. ],
  27. ],
  28. 'fully_qualified_strict_types' => ['import_symbols' => true],
  29. 'php_unit_attributes' => false, // as is not yet supported by PhpCsFixerInternal/configurable_fixer_template
  30. ]));
  31. return $config;