Skip to content

Commit 5b8b76e

Browse files
Guard scripts from being run in non-CLI contexts
1 parent 479e327 commit 5b8b76e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Resources/bin/check-unused-known-tags.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
* file that was distributed with this source code.
1010
*/
1111

12+
if ('cli' !== \PHP_SAPI) {
13+
throw new Exception('This script must be run from the command line.');
14+
}
15+
1216
require dirname(__DIR__, 6).'/vendor/autoload.php';
1317

1418
use Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Compiler\UnusedTagsPassUtils;

0 commit comments

Comments
 (0)