php-cs-fixer 1.1 KB

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