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

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /*
  3. * This file is part of PHP CS Fixer.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. * Dariusz Rumiński <dariusz.ruminski@gmail.com>
  7. *
  8. * This source file is subject to the MIT license that is bundled
  9. * with this source code in the file LICENSE.
  10. */
  11. if (PHP_VERSION_ID <= 70103 || PHP_VERSION_ID >= 70200) {
  12. fwrite(STDERR, "PHP CS Fixer's config for PHP-LOWEST can be executed only on lowest supported PHP version - 7.1.*.\n");
  13. fwrite(STDERR, "Running it on higher PHP version would falsy expect more changes, eg `mixed` type on PHP 8.\n");
  14. exit(1);
  15. }
  16. $config = require '.php-cs-fixer.dist.php';
  17. $config->getFinder()->notPath([
  18. // @TODO 4.0 change interface to be fully typehinted and remove the exceptions from this list
  19. 'src/DocBlock/Annotation.php',
  20. 'src/Tokenizer/Tokens.php',
  21. ]);
  22. $config->setRules([
  23. 'phpdoc_to_param_type' => true, // EXPERIMENTAL rule, helping to ensure usage of 7.0+ typing
  24. 'phpdoc_to_return_type' => true, // EXPERIMENTAL rule, helping to ensure usage of 7.0+ typing
  25. ]);
  26. return $config;