.php-cs-fixer.php-lowest.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  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 < 70205 || PHP_VERSION_ID >= 70300) {
  13. fwrite(STDERR, "PHP CS Fixer's config for PHP-LOWEST can be executed only on lowest supported PHP version - ~7.2.5.\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/Tokenizer/Tokens.php',
  22. ]);
  23. $config->setRules([
  24. 'phpdoc_to_param_type' => true, // EXPERIMENTAL rule, helping to ensure usage of 7.0+ typing
  25. 'phpdoc_to_return_type' => true, // EXPERIMENTAL rule, helping to ensure usage of 7.0+ typing
  26. ]);
  27. return $config;