Skip to content

Commit

Permalink
Merge branch '1.0' into 1
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Nov 21, 2023
2 parents 47f0c4d + 8bd191f commit 4461814
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
11 changes: 7 additions & 4 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<?xml version="1.0"?>
<ruleset name="PSR12">
<rule ref="PSR12"/>
<rule ref="PSR1.Files.SideEffects.FoundWithSymbols">
<exclude-pattern>tests/bootstrap\.php</exclude-pattern>
</rule>
<rule ref="PSR12"/>
<rule ref="PSR1.Files.SideEffects.FoundWithSymbols">
<exclude-pattern>tests/bootstrap\.php</exclude-pattern>
</rule>

<file>./src</file>
<file>./tests</file>
</ruleset>
12 changes: 12 additions & 0 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php

// php_codesniffer autoloader

use PHP_CodeSniffer\Util\Tokens;

$autoloadCandidates = [
// running from package itself as root
__DIR__ . '/../vendor/squizlabs/php_codesniffer/autoload.php',
Expand All @@ -17,6 +20,15 @@
}
}

if (!$autoloaded) {
throw new RuntimeException("Couldn't find autoloader");
}

// Required to correctly run constant definitions in CI, though not needed locally for some reason.
// Referencing a static property on the Tokens class forces the file containing it to be autoloaded,
// which results in the constants (defined in the same file) being defined ahead of time.
Tokens::$operators;

if (!defined('PHP_CODESNIFFER_VERBOSITY')) {
define('PHP_CODESNIFFER_VERBOSITY', 0);
}
Expand Down

0 comments on commit 4461814

Please sign in to comment.