` ruleset directive.
*/
if (defined('PHPCOMPATIBILITY_PHPCS_ALIASES_SET') === false) {
define('PHPCOMPATIBILITY_PHPCS_ALIASES_SET', true);
/*
* Register an autoloader.
*
* {@internal When `installed_paths` is set via the ruleset, this autoloader
* is needed to run the sniffs.
* Upstream issue: {@link https://github.com/squizlabs/PHP_CodeSniffer/issues/1591} }
*
* @since 8.0.0
*/
spl_autoload_register(function ($className) {
// Only try & load our own classes.
if (stripos($className, 'PHPCompatibility') !== 0) {
return;
}
$file = realpath(__DIR__) . DIRECTORY_SEPARATOR . strtr($className, '\\', DIRECTORY_SEPARATOR) . '.php';
if (file_exists($file)) {
include_once $file;
}
});
}