Skip to content

Commit 44f05ab

Browse files
authored
Fix #517 by always loading CodeSniffer tokens (#542)
It avoid undefined token when removing some PHPCs rules while other sniff expect the token is defined without loading them
1 parent f5a0ce6 commit 44f05ab

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Domain/Kernel.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ public static function bootstrap(): void
4242
if (! defined('PHP_CODESNIFFER_VERBOSITY')) {
4343
define('PHP_CODESNIFFER_VERBOSITY', 0);
4444
}
45+
46+
/**
47+
* Require Tokens utils From PHP Codesniffer.
48+
*/
49+
require_once file_exists(__DIR__ . '/../../vendor/squizlabs/php_codesniffer/src/Util/Tokens.php')
50+
? __DIR__ . '/../../vendor/squizlabs/php_codesniffer/src/Util/Tokens.php'
51+
: __DIR__ . '/../../../../../vendor/squizlabs/php_codesniffer/src/Util/Tokens.php';
4552
}
4653

4754
/**

0 commit comments

Comments
 (0)