Skip to content

Commit c8ae944

Browse files
committed
Fix minor bug in CLI file.
Signed-off-by: Yousha Aleayoub <yousha.a@hotmail.com>
1 parent fd2d272 commit c8ae944

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

bin/php-sl.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env php
12
<?php
23

34
/**
@@ -6,6 +7,10 @@
67
* @package PhpSecurityLinter
78
*/
89

10+
error_reporting(E_ALL);
11+
ini_set('display_errors', '1');
12+
ini_set('display_startup_errors', '1');
13+
914
if (PHP_SAPI !== 'cli') {
1015
fwrite(STDERR, "Error: This script can only be run from terminal.\n");
1116
exit(1);
@@ -38,7 +43,7 @@
3843
function showHelp(): void
3944
{
4045
echo <<<HELP
41-
PHP Security Linter 3.0.0.3
46+
PHP Security Linter
4247
Usage: php bin/php-sl.php [options]
4348
4449
Options:
@@ -160,7 +165,4 @@ function runCli(array $argv): int
160165
}
161166
}
162167

163-
// Only execute if run directly (not when included).
164-
if (realpath($argv[0]) === realpath(__FILE__)) {
165-
runCli($argv);
166-
}
168+
runCli($argv);

0 commit comments

Comments
 (0)