php-cs-fixer 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/usr/bin/env php
  2. <?php
  3. /*
  4. * This file is part of the PHP CS utility.
  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. /**
  13. * @author Fabien Potencier <fabien@symfony.com>
  14. * @author Dariusz Rumiński <dariusz.ruminski@gmail.com>
  15. */
  16. if (defined('HHVM_VERSION_ID')) {
  17. if (HHVM_VERSION_ID < 30900) {
  18. fwrite(STDERR, "HHVM needs to be a minimum version of HHVM 3.9.0\n");
  19. exit(1);
  20. }
  21. } elseif (!defined('PHP_VERSION_ID') || PHP_VERSION_ID < 50306 || PHP_VERSION_ID >= 70200) {
  22. fwrite(STDERR, "PHP needs to be a minimum version of PHP 5.3.6 and maximum version of PHP 7.1.*\n");
  23. exit(1);
  24. }
  25. set_error_handler(function ($severity, $message, $file, $line) {
  26. if ($severity & error_reporting()) {
  27. throw new ErrorException($message, 0, $severity, $file, $line);
  28. }
  29. });
  30. // installed via composer?
  31. if (file_exists($a = __DIR__.'/../../autoload.php')) {
  32. require_once $a;
  33. } else {
  34. require_once __DIR__.'/vendor/autoload.php';
  35. }
  36. use PhpCsFixer\Console\Application;
  37. $application = new Application();
  38. $application->run();