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

12345678910111213141516171819202122232425262728293031323334353637
  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 < 70400 || PHP_VERSION_ID >= 70500) {
  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. 'src/Runner/Runner.php',
  24. ]);
  25. $config->setRules([
  26. 'phpdoc_to_param_type' => true,
  27. 'phpdoc_to_return_type' => true,
  28. ]);
  29. return $config;