Skip to content

Commit

Permalink
Merge pull request #66 from TheDragonCode/1.x
Browse files Browse the repository at this point in the history
Added warning when running on old PHP version
  • Loading branch information
Andrey Helldar committed Mar 1, 2022
2 parents 5bbd9a4 + db115c3 commit 0501b6d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bin/codestyle
Expand Up @@ -7,6 +7,12 @@ use DragonCode\CodeStyler\Commands\EditorConfig;
use DragonCode\CodeStyler\Commands\Fix;
use Symfony\Component\Console\Application;

if (PHP_SAPI !== 'cli' || PHP_MAJOR_VERSION < 8) {
echo 'Warning: codestyle should be invoked via the CLI minimum version of PHP 8.0.0, not the ' . PHP_SAPI . ' ' . PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION;

exit(1);
}

error_reporting(E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED);

$possible_files = [
Expand All @@ -30,7 +36,7 @@ if (is_null($file)) {

require_once $file;

$application = new Application('PHP Code Styler');
$application = new Application('The Dragon Code Styler');

$application->add(new Check());
$application->add(new Fix());
Expand Down

0 comments on commit 0501b6d

Please sign in to comment.