.php-cs-fixer.php-lowest.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  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 < 7_04_00 || PHP_VERSION_ID >= 7_05_00) {
  13. fwrite(STDERR, "PHP CS Fixer's config for PHP-LOWEST can be executed only on lowest supported PHP version - ~7.4.0.\n");
  14. fwrite(STDERR, "Running it on higher PHP version would falsy expect more changes, eg `mixed` type on PHP 8.\n");
  15. exit(1);
  16. }
  17. $config = require __DIR__.'/.php-cs-fixer.dist.php';
  18. $config->getFinder()->notPath([
  19. // @TODO 4.0 change interface to be fully typehinted and remove the exceptions from this list
  20. 'src/DocBlock/Annotation.php',
  21. 'src/Doctrine/Annotation/Tokens.php',
  22. 'src/Tokenizer/Tokens.php',
  23. ]);
  24. $config->setRules([
  25. 'phpdoc_to_param_type' => true,
  26. 'phpdoc_to_return_type' => true,
  27. ]);
  28. return $config;