phpcbf 1.3 KB

12345678910111213141516171819202122232425262728293031
  1. #!/usr/bin/env php
  2. <?php
  3. /**
  4. * PHP Code Beautifier and Fixer fixes violations of a defined coding standard.
  5. *
  6. * :WARNING:
  7. * This file MUST stay cross-version compatible with older PHP versions (min: PHP 5.3) to allow
  8. * for the requirements check to work correctly.
  9. *
  10. * The PHP 5.3 minimum is set as the previous PHPCS major (3.x) already had a PHP 5.4 minimum
  11. * requirement and didn't take parse errors caused due to the use of namespaces into account
  12. * in its requirements check, so running PHPCS 3.x on PHP < 5.3 would have failed with a parse
  13. * error already anyway, so PHP 5.3 seems reasonable to keep as the minimum for this.
  14. * :WARNING:
  15. *
  16. * @author Greg Sherwood <gsherwood@squiz.net>
  17. * @author Juliette Reinders Folmer <phpcs_nospam@adviesenzo.nl>
  18. * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600)
  19. * @copyright 2024 PHPCSStandards and contributors
  20. * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
  21. */
  22. // Check if the PHP version and extensions comply with the minimum requirements before anything else.
  23. require_once dirname(__DIR__).'/requirements.php';
  24. PHP_CodeSniffer\checkRequirements();
  25. require_once dirname(__DIR__).'/autoload.php';
  26. $runner = new PHP_CodeSniffer\Runner();
  27. $exitCode = $runner->runPHPCBF();
  28. exit($exitCode);