phar-stub.php 965 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. *
  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 (defined('HHVM_VERSION_ID')) {
  12. if (HHVM_VERSION_ID < 30500) {
  13. fwrite(STDERR, "HHVM needs to be a minimum version of HHVM 3.5.0\n");
  14. exit(1);
  15. }
  16. } elseif (!defined('PHP_VERSION_ID') || PHP_VERSION_ID < 50306) {
  17. fwrite(STDERR, "PHP needs to be a minimum version of PHP 5.3.6\n");
  18. exit(1);
  19. }
  20. set_error_handler(function ($severity, $message, $file, $line) {
  21. if ($severity & error_reporting()) {
  22. throw new ErrorException($message, 0, $severity, $file, $line);
  23. }
  24. });
  25. Phar::mapPhar('php-cs-fixer.phar');
  26. require_once 'phar://php-cs-fixer.phar/vendor/autoload.php';
  27. use Symfony\CS\Console\Application;
  28. $application = new Application();
  29. $application->run();
  30. __HALT_COMPILER();