From 62eb567bd82de266b5ad6c9735a437ea6c14cab4 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Sat, 11 Oct 2025 16:31:12 +0100 Subject: [PATCH 01/27] Define polyfilled constants from Tokenizer as int The value of these constants are not stable, and therefore already cannot be relied upon. This is because the specific values that PHP assigns can change with different versions of PHP. PHPCS does not use the values of these constants (other than to look up their name using the Tokens::tokenName() method). There are other tools which also polyfill these constants. Some of those tools also perform validation on the value for these constants. In order to play nicely with the arbitrary validation that other tools perform on these constants, we are switching from string values to integer values. All PHPCS 'native' tokens currently have reliable values. In line with PHP T_* constants, the values of these tokens should never be relied upon. In a future version of PHPCS, the values for these tokens will switch from strings to integers. Existing tests already cover the use of these constants and do not require adjustment for the code being changed here. --- src/Util/Tokens.php | 158 +++++++++++------------ tests/Core/Util/Tokens/TokenNameTest.php | 1 + 2 files changed, 77 insertions(+), 82 deletions(-) diff --git a/src/Util/Tokens.php b/src/Util/Tokens.php index 62c918c31b..0ffff5a7a5 100644 --- a/src/Util/Tokens.php +++ b/src/Util/Tokens.php @@ -10,6 +10,7 @@ namespace PHP_CodeSniffer\Util; +// PHPCS native tokens. define('T_NONE', 'PHPCS_T_NONE'); define('T_OPEN_CURLY_BRACKET', 'PHPCS_T_OPEN_CURLY_BRACKET'); define('T_CLOSE_CURLY_BRACKET', 'PHPCS_T_CLOSE_CURLY_BRACKET'); @@ -70,84 +71,6 @@ define('T_TYPE_OPEN_PARENTHESIS', 'PHPCS_T_TYPE_OPEN_PARENTHESIS'); define('T_TYPE_CLOSE_PARENTHESIS', 'PHPCS_T_TYPE_CLOSE_PARENTHESIS'); -/* - * {@internal IMPORTANT: all PHP native polyfilled tokens MUST be added to the - * `PHP_CodeSniffer\Tests\Core\Util\Tokens\TokenNameTest::dataPolyfilledPHPNativeTokens()` test method!} - */ - -// Some PHP 7.4 tokens, replicated for lower versions. -if (defined('T_COALESCE_EQUAL') === false) { - define('T_COALESCE_EQUAL', 'PHPCS_T_COALESCE_EQUAL'); -} - -if (defined('T_BAD_CHARACTER') === false) { - define('T_BAD_CHARACTER', 'PHPCS_T_BAD_CHARACTER'); -} - -if (defined('T_FN') === false) { - define('T_FN', 'PHPCS_T_FN'); -} - -// Some PHP 8.0 tokens, replicated for lower versions. -if (defined('T_NULLSAFE_OBJECT_OPERATOR') === false) { - define('T_NULLSAFE_OBJECT_OPERATOR', 'PHPCS_T_NULLSAFE_OBJECT_OPERATOR'); -} - -if (defined('T_NAME_QUALIFIED') === false) { - define('T_NAME_QUALIFIED', 'PHPCS_T_NAME_QUALIFIED'); -} - -if (defined('T_NAME_FULLY_QUALIFIED') === false) { - define('T_NAME_FULLY_QUALIFIED', 'PHPCS_T_NAME_FULLY_QUALIFIED'); -} - -if (defined('T_NAME_RELATIVE') === false) { - define('T_NAME_RELATIVE', 'PHPCS_T_NAME_RELATIVE'); -} - -if (defined('T_MATCH') === false) { - define('T_MATCH', 'PHPCS_T_MATCH'); -} - -if (defined('T_ATTRIBUTE') === false) { - define('T_ATTRIBUTE', 'PHPCS_T_ATTRIBUTE'); -} - -// Some PHP 8.1 tokens, replicated for lower versions. -if (defined('T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG') === false) { - define('T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG', 'PHPCS_T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG'); -} - -if (defined('T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG') === false) { - define('T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG', 'PHPCS_T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG'); -} - -if (defined('T_READONLY') === false) { - define('T_READONLY', 'PHPCS_T_READONLY'); -} - -if (defined('T_ENUM') === false) { - define('T_ENUM', 'PHPCS_T_ENUM'); -} - -// Some PHP 8.4 tokens, replicated for lower versions. -if (defined('T_PUBLIC_SET') === false) { - define('T_PUBLIC_SET', 'PHPCS_T_PUBLIC_SET'); -} - -if (defined('T_PROTECTED_SET') === false) { - define('T_PROTECTED_SET', 'PHPCS_T_PROTECTED_SET'); -} - -if (defined('T_PRIVATE_SET') === false) { - define('T_PRIVATE_SET', 'PHPCS_T_PRIVATE_SET'); -} - -// Some PHP 8.5 tokens, replicated for lower versions. -if (defined('T_VOID_CAST') === false) { - define('T_VOID_CAST', 'PHPCS_T_VOID_CAST'); -} - // Tokens used for parsing doc blocks. define('T_DOC_COMMENT_STAR', 'PHPCS_T_DOC_COMMENT_STAR'); define('T_DOC_COMMENT_WHITESPACE', 'PHPCS_T_DOC_COMMENT_WHITESPACE'); @@ -163,6 +86,8 @@ define('T_PHPCS_IGNORE', 'PHPCS_T_PHPCS_IGNORE'); define('T_PHPCS_IGNORE_FILE', 'PHPCS_T_PHPCS_IGNORE_FILE'); +Tokens::polyfillTokenizerConstants(); + final class Tokens { @@ -612,6 +537,13 @@ final class Tokens T_YIELD_FROM => T_YIELD_FROM, ]; + /** + * Mapping table for polyfilled constants + * + * @var array + */ + private static $polyfillMappingTable = []; + /** * The token weightings. * @@ -943,12 +875,12 @@ final class Tokens */ public static function tokenName($token) { - if (is_string($token) === false) { - // PHP-supplied token name. - return token_name($token); + if (is_string($token) === true) { + // PHPCS native token. + return substr($token, 6); } - return substr($token, 6); + return (self::$polyfillMappingTable[$token] ?? token_name($token)); } @@ -991,4 +923,66 @@ public static function getHighestWeightedToken(array $tokens) return $highestType; } + + + /** + * Polyfill tokenizer (T_*) constants. + * + * {@internal IMPORTANT: all PHP native polyfilled tokens MUST be added to the + * `PHP_CodeSniffer\Tests\Core\Util\Tokens\TokenNameTest::dataPolyfilledPHPNativeTokens()` test method!} + * + * @return void + */ + public static function polyfillTokenizerConstants(): void + { + // Ideally this would be a private class constant. We cannot do that + // here as the constants that we are polyfilling in this method are + // used in some of the class constants for this class. If we reference + // any class constants or properties before this method has fully run, + // PHP will intitialise the class, leading to warnings about undefined + // T_* constants. + $tokensToPolyfill = [ + 'T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG', + 'T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG', + 'T_ATTRIBUTE', + 'T_BAD_CHARACTER', + 'T_COALESCE_EQUAL', + 'T_ENUM', + 'T_FN', + 'T_MATCH', + 'T_NAME_FULLY_QUALIFIED', + 'T_NAME_QUALIFIED', + 'T_NAME_RELATIVE', + 'T_NULLSAFE_OBJECT_OPERATOR', + 'T_PRIVATE_SET', + 'T_PROTECTED_SET', + 'T_PUBLIC_SET', + 'T_READONLY', + 'T_VOID_CAST', + ]; + + // + // The PHP manual suggests "using big numbers like 10000" for + // polyfilled T_* constants. We have arbitrarily chosen to start our + // numbering scheme from 135_000. + $nextTokenNumber = 135000; + + $polyfillMappingTable = []; + + foreach ($tokensToPolyfill as $tokenName) { + if (defined($tokenName) === false) { + while (isset($polyfillMappingTable[$nextTokenNumber]) === true) { + $nextTokenNumber++; + } + + define($tokenName, $nextTokenNumber); + } + + $polyfillMappingTable[constant($tokenName)] = $tokenName; + } + + // Be careful to not reference this class anywhere in this method until + // *after* all constants have been polyfilled. + self::$polyfillMappingTable = $polyfillMappingTable; + } } diff --git a/tests/Core/Util/Tokens/TokenNameTest.php b/tests/Core/Util/Tokens/TokenNameTest.php index 43198266d1..5c5689f546 100644 --- a/tests/Core/Util/Tokens/TokenNameTest.php +++ b/tests/Core/Util/Tokens/TokenNameTest.php @@ -16,6 +16,7 @@ * Tests for the \PHP_CodeSniffer\Util\Tokens::tokenName() method. * * @covers \PHP_CodeSniffer\Util\Tokens::tokenName + * @covers \PHP_CodeSniffer\Util\Tokens::polyfillTokenizerConstants */ final class TokenNameTest extends TestCase { From af09543a431896f711c0cb53d2525d517af2f510 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Fri, 14 Nov 2025 16:47:24 +0000 Subject: [PATCH 02/27] Reorder PHP constants for better maintainability --- src/Util/Tokens.php | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/Util/Tokens.php b/src/Util/Tokens.php index 0ffff5a7a5..35d0959dc6 100644 --- a/src/Util/Tokens.php +++ b/src/Util/Tokens.php @@ -942,22 +942,31 @@ public static function polyfillTokenizerConstants(): void // PHP will intitialise the class, leading to warnings about undefined // T_* constants. $tokensToPolyfill = [ - 'T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG', - 'T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG', - 'T_ATTRIBUTE', + // PHP 7.4 native tokens. 'T_BAD_CHARACTER', 'T_COALESCE_EQUAL', - 'T_ENUM', 'T_FN', + + // PHP 8.0 native tokens. + 'T_ATTRIBUTE', 'T_MATCH', 'T_NAME_FULLY_QUALIFIED', 'T_NAME_QUALIFIED', 'T_NAME_RELATIVE', 'T_NULLSAFE_OBJECT_OPERATOR', + + // PHP 8.1 native tokens. + 'T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG', + 'T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG', + 'T_ENUM', + 'T_READONLY', + + // PHP 8.4 native tokens. 'T_PRIVATE_SET', 'T_PROTECTED_SET', 'T_PUBLIC_SET', - 'T_READONLY', + + // PHP 8.5 native tokens. 'T_VOID_CAST', ]; From 7b972cbd4a135f145fd00c6b005870f20d0f66e7 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Fri, 14 Nov 2025 18:45:41 +0000 Subject: [PATCH 03/27] Better protect against collisions --- src/Util/Tokens.php | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/Util/Tokens.php b/src/Util/Tokens.php index 35d0959dc6..aee637107b 100644 --- a/src/Util/Tokens.php +++ b/src/Util/Tokens.php @@ -976,15 +976,38 @@ public static function polyfillTokenizerConstants(): void // numbering scheme from 135_000. $nextTokenNumber = 135000; + // This variable is necessary to avoid collisions with any other + // libraries which also polyfill T_* constants. + // array_flip()/isset() because in_array() is slow. + $existingConstants = array_flip(get_defined_constants(true)['tokenizer']); + foreach ((get_defined_constants(true)['user'] ?? []) as $k => $v) { + if (isset($k[2]) === false || $k[0] !== 'T' || $k[1] !== '_') { + // We only care about T_* constants. + continue; + } + + if (isset($existingConstants[$v]) === true) { + throw new \Exception("Externally polyfilled tokenizer constant value collision detected! $k has the same value as {$existingConstants[$v]}"); + } + + $existingConstants[$v] = $k; + } + $polyfillMappingTable = []; foreach ($tokensToPolyfill as $tokenName) { + if (isset(get_defined_constants(true)['tokenizer'][$tokenName]) === true) { + // This is a PHP native token, which is already defined by PHP. + continue; + } + if (defined($tokenName) === false) { - while (isset($polyfillMappingTable[$nextTokenNumber]) === true) { + while (isset($existingConstants[$nextTokenNumber]) === true) { $nextTokenNumber++; } define($tokenName, $nextTokenNumber); + $existingConstants[$nextTokenNumber] = $tokenName; } $polyfillMappingTable[constant($tokenName)] = $tokenName; From fb73709fbb96564b30bbc0a5a186ff30fcd53129 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Mon, 22 Dec 2025 17:48:02 +0000 Subject: [PATCH 04/27] Add tests for new tokenizer constant code --- phpunit.xml.dist | 3 +++ ...yfillTokenizerConstants-collision-php.phpt | 18 +++++++++++++++++ ...fillTokenizerConstants-collision-user.phpt | 20 +++++++++++++++++++ .../polyfillTokenizerConstants-number.phpt | 14 +++++++++++++ ...polyfillTokenizerConstants-skip-names.phpt | 17 ++++++++++++++++ 5 files changed, 72 insertions(+) create mode 100644 tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-php.phpt create mode 100644 tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-user.phpt create mode 100644 tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-number.phpt create mode 100644 tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-skip-names.phpt diff --git a/phpunit.xml.dist b/phpunit.xml.dist index a3a6255492..a6d9abea55 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -31,6 +31,9 @@ ./src/Standards/Squiz/Tests/ ./src/Standards/Zend/Tests/ + + tests/EndToEndPhpt/ + diff --git a/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-php.phpt b/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-php.phpt new file mode 100644 index 0000000000..89a8c85d12 --- /dev/null +++ b/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-php.phpt @@ -0,0 +1,18 @@ +--TEST-- +Detect when the value of a polyfilled PHP token collides with a value already used by an existing internal PHP token. +--SKIPIF-- +=")) { + echo "skip because tokens used in this test already exist in PHP 8.4 so we cannot test polyfilling them", PHP_EOL; +} +--FILE-- +=")) { + echo "skip because tokens used in this test already exist in PHP 8.4 so we cannot test polyfilling them", PHP_EOL; +} +--FILE-- +=")) { + echo "skip because tokens used in this test already exist in PHP 8.4 so we cannot test polyfilling them", PHP_EOL; +} +--FILE-- +=")) { + echo "skip because tokens used in this test already exist in PHP 8.4 so we cannot test polyfilling them", PHP_EOL; +} +--FILE-- + Date: Thu, 15 Jan 2026 22:46:46 +0000 Subject: [PATCH 05/27] Update tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-php.phpt Co-authored-by: Juliette <663378+jrfnl@users.noreply.github.com> --- .../Util/Tokens/polyfillTokenizerConstants-collision-php.phpt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-php.phpt b/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-php.phpt index 89a8c85d12..e8fdf94017 100644 --- a/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-php.phpt +++ b/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-php.phpt @@ -2,8 +2,8 @@ Detect when the value of a polyfilled PHP token collides with a value already used by an existing internal PHP token. --SKIPIF-- =")) { - echo "skip because tokens used in this test already exist in PHP 8.4 so we cannot test polyfilling them", PHP_EOL; +if (version_compare(PHP_VERSION, '8.4', '>=') === true) { + echo 'skip because tokens used in this test already exist in PHP 8.4 so we cannot test polyfilling them', PHP_EOL; } --FILE-- Date: Thu, 15 Jan 2026 22:46:56 +0000 Subject: [PATCH 06/27] Update tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-php.phpt Co-authored-by: Juliette <663378+jrfnl@users.noreply.github.com> --- .../Util/Tokens/polyfillTokenizerConstants-collision-php.phpt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-php.phpt b/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-php.phpt index e8fdf94017..f898472e1a 100644 --- a/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-php.phpt +++ b/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-php.phpt @@ -8,7 +8,7 @@ if (version_compare(PHP_VERSION, '8.4', '>=') === true) { --FILE-- Date: Thu, 15 Jan 2026 22:47:10 +0000 Subject: [PATCH 07/27] Update src/Util/Tokens.php Co-authored-by: Juliette <663378+jrfnl@users.noreply.github.com> --- src/Util/Tokens.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Util/Tokens.php b/src/Util/Tokens.php index aee637107b..ae9e4876f1 100644 --- a/src/Util/Tokens.php +++ b/src/Util/Tokens.php @@ -538,7 +538,7 @@ final class Tokens ]; /** - * Mapping table for polyfilled constants + * Mapping table for polyfilled constants. * * @var array */ From 94800a7ea5fa30a0318dbd791e1892e9d01795b0 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Thu, 15 Jan 2026 22:47:30 +0000 Subject: [PATCH 08/27] Update tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-skip-names.phpt Co-authored-by: Juliette <663378+jrfnl@users.noreply.github.com> --- .../Util/Tokens/polyfillTokenizerConstants-skip-names.phpt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-skip-names.phpt b/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-skip-names.phpt index 520c487b38..2c89c04ae2 100644 --- a/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-skip-names.phpt +++ b/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-skip-names.phpt @@ -8,9 +8,9 @@ if (version_compare(PHP_VERSION, "8.4", ">=")) { --FILE-- Date: Thu, 15 Jan 2026 22:47:47 +0000 Subject: [PATCH 09/27] Update tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-skip-names.phpt Co-authored-by: Juliette <663378+jrfnl@users.noreply.github.com> --- .../Util/Tokens/polyfillTokenizerConstants-skip-names.phpt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-skip-names.phpt b/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-skip-names.phpt index 2c89c04ae2..6fd313664f 100644 --- a/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-skip-names.phpt +++ b/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-skip-names.phpt @@ -11,7 +11,7 @@ if (version_compare(PHP_VERSION, "8.4", ">=")) { define('T_', T_STRING); // Too short. define('ONE', T_STRING); // First character is not 'T'. define('TWO', T_STRING); // Second character is not '_'. -require('src/Util/Tokens.php'); +require 'src/Util/Tokens.php'; echo 'No conflicts', PHP_EOL; --EXPECT-- No conflicts From e21f08da89adc320f6c39db6d7917694a4f9d902 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Thu, 15 Jan 2026 22:48:07 +0000 Subject: [PATCH 10/27] Update tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-skip-names.phpt Co-authored-by: Juliette <663378+jrfnl@users.noreply.github.com> --- .../Util/Tokens/polyfillTokenizerConstants-skip-names.phpt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-skip-names.phpt b/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-skip-names.phpt index 6fd313664f..429090a0dd 100644 --- a/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-skip-names.phpt +++ b/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-skip-names.phpt @@ -2,8 +2,8 @@ Value collision with a non-tokenizer constant should not cause an error. --SKIPIF-- =")) { - echo "skip because tokens used in this test already exist in PHP 8.4 so we cannot test polyfilling them", PHP_EOL; +if (version_compare(PHP_VERSION, '8.4', '>=') === true) { + echo 'skip because tokens used in this test already exist in PHP 8.4 so we cannot test polyfilling them', PHP_EOL; } --FILE-- Date: Thu, 15 Jan 2026 22:48:19 +0000 Subject: [PATCH 11/27] Update tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-user.phpt Co-authored-by: Juliette <663378+jrfnl@users.noreply.github.com> --- .../Tokens/polyfillTokenizerConstants-collision-user.phpt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-user.phpt b/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-user.phpt index cfdafb24e7..9bc0d1f5a2 100644 --- a/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-user.phpt +++ b/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-user.phpt @@ -2,8 +2,8 @@ Detect when two or more polyfilled PHP tokens have the same value. --SKIPIF-- =")) { - echo "skip because tokens used in this test already exist in PHP 8.4 so we cannot test polyfilling them", PHP_EOL; +if (version_compare(PHP_VERSION, '8.4', '>=') === true) { + echo 'skip because tokens used in this test already exist in PHP 8.4 so we cannot test polyfilling them', PHP_EOL; } --FILE-- Date: Thu, 15 Jan 2026 22:48:53 +0000 Subject: [PATCH 12/27] Update tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-user.phpt Co-authored-by: Juliette <663378+jrfnl@users.noreply.github.com> --- .../Util/Tokens/polyfillTokenizerConstants-collision-user.phpt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-user.phpt b/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-user.phpt index 9bc0d1f5a2..497073c8c4 100644 --- a/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-user.phpt +++ b/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-user.phpt @@ -10,7 +10,7 @@ if (version_compare(PHP_VERSION, '8.4', '>=') === true) { define('T_PRIVATE_SET', 10000); define('T_PROTECTED_SET', 10000); define('T_PUBLIC_SET', 10000); -require('src/Util/Tokens.php'); +require 'src/Util/Tokens.php'; --EXPECTF-- Fatal error: Uncaught Exception: Externally polyfilled tokenizer constant value collision detected! T_PROTECTED_SET has the same value as T_PRIVATE_SET in %s:%d Stack trace: From 1b78d806de285386dd279028113f7858ec18dec1 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Thu, 15 Jan 2026 22:49:06 +0000 Subject: [PATCH 13/27] Update tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-number.phpt Co-authored-by: Juliette <663378+jrfnl@users.noreply.github.com> --- .../Util/Tokens/polyfillTokenizerConstants-number.phpt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-number.phpt b/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-number.phpt index 413de798fa..c3d8f07644 100644 --- a/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-number.phpt +++ b/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-number.phpt @@ -2,8 +2,8 @@ Detect when an external party defines a PHP token polyfill with a number that we would have used. --SKIPIF-- =")) { - echo "skip because tokens used in this test already exist in PHP 8.4 so we cannot test polyfilling them", PHP_EOL; +if (version_compare(PHP_VERSION, '8.4', '>=') === true) { + echo 'skip because tokens used in this test already exist in PHP 8.4 so we cannot test polyfilling them', PHP_EOL; } --FILE-- Date: Thu, 15 Jan 2026 22:49:19 +0000 Subject: [PATCH 14/27] Update tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-number.phpt Co-authored-by: Juliette <663378+jrfnl@users.noreply.github.com> --- .../Util/Tokens/polyfillTokenizerConstants-number.phpt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-number.phpt b/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-number.phpt index c3d8f07644..bc6975c72f 100644 --- a/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-number.phpt +++ b/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-number.phpt @@ -8,7 +8,7 @@ if (version_compare(PHP_VERSION, '8.4', '>=') === true) { --FILE-- Date: Thu, 15 Jan 2026 22:52:00 +0000 Subject: [PATCH 15/27] Add End2EndPhpt test suite to legacy configuration --- phpunit-lte9.xml.dist | 3 +++ 1 file changed, 3 insertions(+) diff --git a/phpunit-lte9.xml.dist b/phpunit-lte9.xml.dist index db04053844..b00fc6d8c8 100644 --- a/phpunit-lte9.xml.dist +++ b/phpunit-lte9.xml.dist @@ -25,6 +25,9 @@ ./src/Standards/Squiz/Tests/ ./src/Standards/Zend/Tests/ + + tests/EndToEndPhpt/ + From 333f9496b2a095c8d83f3ec5f768aa157545e1aa Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Thu, 15 Jan 2026 22:58:11 +0000 Subject: [PATCH 16/27] Update tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-php.phpt Co-authored-by: Juliette <663378+jrfnl@users.noreply.github.com> --- .../Util/Tokens/polyfillTokenizerConstants-collision-php.phpt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-php.phpt b/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-php.phpt index f898472e1a..a501b5c52b 100644 --- a/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-php.phpt +++ b/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-php.phpt @@ -13,6 +13,6 @@ require 'src/Util/Tokens.php'; Fatal error: Uncaught Exception: Externally polyfilled tokenizer constant value collision detected! T_PUBLIC_SET has the same value as T_STRING in %s:%d Stack trace: #0 %s(%d): PHP_CodeSniffer\Util\Tokens::polyfillTokenizerConstants() -#1 Standard input code(%d): require('...') +#1 Standard input code(%d): require('%s') #2 {main} thrown in %s on line %d From d32733da5d5e6a65c60ddd1e62f1f4d4aa38a9eb Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Thu, 15 Jan 2026 22:58:30 +0000 Subject: [PATCH 17/27] Update tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-user.phpt Co-authored-by: Juliette <663378+jrfnl@users.noreply.github.com> --- .../Util/Tokens/polyfillTokenizerConstants-collision-user.phpt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-user.phpt b/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-user.phpt index 497073c8c4..e45ac03f1f 100644 --- a/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-user.phpt +++ b/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-user.phpt @@ -15,6 +15,6 @@ require 'src/Util/Tokens.php'; Fatal error: Uncaught Exception: Externally polyfilled tokenizer constant value collision detected! T_PROTECTED_SET has the same value as T_PRIVATE_SET in %s:%d Stack trace: #0 %s(%d): PHP_CodeSniffer\Util\Tokens::polyfillTokenizerConstants() -#1 Standard input code(%d): require('...') +#1 Standard input code(%d): require('%s') #2 {main} thrown in %s on line %d From 7bf9c0837fb08069b170a641fc69d55e77e5e9da Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Thu, 15 Jan 2026 23:13:26 +0000 Subject: [PATCH 18/27] Avoid calling function in loops --- src/Util/Tokens.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Util/Tokens.php b/src/Util/Tokens.php index ae9e4876f1..f7ca28a94b 100644 --- a/src/Util/Tokens.php +++ b/src/Util/Tokens.php @@ -979,8 +979,9 @@ public static function polyfillTokenizerConstants(): void // This variable is necessary to avoid collisions with any other // libraries which also polyfill T_* constants. // array_flip()/isset() because in_array() is slow. - $existingConstants = array_flip(get_defined_constants(true)['tokenizer']); - foreach ((get_defined_constants(true)['user'] ?? []) as $k => $v) { + $allDefinedConstants = get_defined_constants(true); + $existingConstants = array_flip($allDefinedConstants['tokenizer']); + foreach (($allDefinedConstants['user'] ?? []) as $k => $v) { if (isset($k[2]) === false || $k[0] !== 'T' || $k[1] !== '_') { // We only care about T_* constants. continue; @@ -996,7 +997,7 @@ public static function polyfillTokenizerConstants(): void $polyfillMappingTable = []; foreach ($tokensToPolyfill as $tokenName) { - if (isset(get_defined_constants(true)['tokenizer'][$tokenName]) === true) { + if (isset($allDefinedConstants['tokenizer'][$tokenName]) === true) { // This is a PHP native token, which is already defined by PHP. continue; } From de1c64b1b40a291b62b284ac4537524f2c7ad31a Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Thu, 15 Jan 2026 23:41:02 +0000 Subject: [PATCH 19/27] Fix test for PHP < 8.0 --- .../Util/Tokens/polyfillTokenizerConstants-number.phpt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-number.phpt b/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-number.phpt index bc6975c72f..06d78439ca 100644 --- a/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-number.phpt +++ b/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-number.phpt @@ -9,6 +9,11 @@ if (version_compare(PHP_VERSION, '8.4', '>=') === true) { 135000) { + echo 'Success.', PHP_EOL; +} else { + echo 'Failure - ', T_PRIVATE_SET, PHP_EOL; +} --EXPECT-- -135001 +Success. From 50a5e7aa75a212b44d65359f3515a56a305ba1f0 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Thu, 15 Jan 2026 23:41:54 +0000 Subject: [PATCH 20/27] Fix test for test suite paths --- .../Util/Tokens/polyfillTokenizerConstants-collision-php.phpt | 2 +- .../Util/Tokens/polyfillTokenizerConstants-collision-user.phpt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-php.phpt b/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-php.phpt index a501b5c52b..031ab29126 100644 --- a/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-php.phpt +++ b/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-php.phpt @@ -13,6 +13,6 @@ require 'src/Util/Tokens.php'; Fatal error: Uncaught Exception: Externally polyfilled tokenizer constant value collision detected! T_PUBLIC_SET has the same value as T_STRING in %s:%d Stack trace: #0 %s(%d): PHP_CodeSniffer\Util\Tokens::polyfillTokenizerConstants() -#1 Standard input code(%d): require('%s') +#1 %s(%d): require('%s') #2 {main} thrown in %s on line %d diff --git a/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-user.phpt b/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-user.phpt index e45ac03f1f..2a1f8e590a 100644 --- a/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-user.phpt +++ b/tests/EndToEndPhpt/Util/Tokens/polyfillTokenizerConstants-collision-user.phpt @@ -15,6 +15,6 @@ require 'src/Util/Tokens.php'; Fatal error: Uncaught Exception: Externally polyfilled tokenizer constant value collision detected! T_PROTECTED_SET has the same value as T_PRIVATE_SET in %s:%d Stack trace: #0 %s(%d): PHP_CodeSniffer\Util\Tokens::polyfillTokenizerConstants() -#1 Standard input code(%d): require('%s') +#1 %s(%d): require('%s') #2 {main} thrown in %s on line %d From 4d7703763d3bba8f017d57be90920b53f9f63727 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Fri, 6 Mar 2026 19:57:54 +0000 Subject: [PATCH 21/27] Avoid running phpt tests with coverage When PHPUnit runs in coverage mode, it pre-loads all files. The files being tested in the End2EndPhpt test suite need to be able to run code _before_ any PHP_CodeSniffer classes are loaded, this isn't compatible. To avoid this, we are moving this test suite to the 'end to end' test stage, where we do not run code coverage. --- .github/workflows/end-to-end-tests.yml | 11 +++++++++++ phpunit-e2e.xml.dist | 18 ++++++++++++++++++ phpunit-lte9.xml.dist | 3 --- phpunit.xml.dist | 3 --- 4 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 phpunit-e2e.xml.dist diff --git a/.github/workflows/end-to-end-tests.yml b/.github/workflows/end-to-end-tests.yml index d301978759..404342aaf2 100644 --- a/.github/workflows/end-to-end-tests.yml +++ b/.github/workflows/end-to-end-tests.yml @@ -48,6 +48,17 @@ jobs: ini-values: "error_reporting=-1, display_errors=On, display_startup_errors=On" coverage: none + # Install dependencies and handle caching in one go. + # @link https://github.com/marketplace/actions/install-php-dependencies-with-composer + - name: Install Composer dependencies + uses: "ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520" # 3.1.1 + with: + composer-options: ${{ matrix.php == '8.6' && '--ignore-platform-req=php+' || '' }} + custom-cache-suffix: $(date -u "+%Y-%m") + + - name: 'PHPUnit: run end-to-end tests (phpt)' + run: php "vendor/bin/phpunit" -c phpunit-e2e.xml.dist --no-coverage + - name: "Install bashunit" shell: bash run: | diff --git a/phpunit-e2e.xml.dist b/phpunit-e2e.xml.dist new file mode 100644 index 0000000000..a00b3b7e7b --- /dev/null +++ b/phpunit-e2e.xml.dist @@ -0,0 +1,18 @@ + + + + + tests/EndToEndPhpt/ + + + diff --git a/phpunit-lte9.xml.dist b/phpunit-lte9.xml.dist index b00fc6d8c8..db04053844 100644 --- a/phpunit-lte9.xml.dist +++ b/phpunit-lte9.xml.dist @@ -25,9 +25,6 @@ ./src/Standards/Squiz/Tests/ ./src/Standards/Zend/Tests/ - - tests/EndToEndPhpt/ - diff --git a/phpunit.xml.dist b/phpunit.xml.dist index a6d9abea55..a3a6255492 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -31,9 +31,6 @@ ./src/Standards/Squiz/Tests/ ./src/Standards/Zend/Tests/ - - tests/EndToEndPhpt/ - From 02a83b17fa230d6a0140ae95a4a4f370eda86b29 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Fri, 6 Mar 2026 20:12:13 +0000 Subject: [PATCH 22/27] Introduce phpt tests in contributing guide --- .github/CONTRIBUTING.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 945d306246..f40d7d6d3e 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -399,6 +399,8 @@ To run the tests specific to the use of `PHP_CODESNIFFER_CBF === true`: ### Writing End-to-End Tests +#### Bashunit + Bash-based end-to-end tests can be written using the [Bashunit](https://bashunit.typeddevs.com/) test tooling using version 0.26.0 or higher. To install bashunit, follow the [installation guide](https://bashunit.typeddevs.com/installation). @@ -413,6 +415,20 @@ You can then run the bashunit tests on Linux/Mac/WSL, like so: When writing end-to-end tests, please use fixtures for the "files under scan" to make the tests stable. These fixtures can be placed in the `tests/EndToEnd/Fixtures` subdirectory. +#### phpt + +PHP-based end-to-end tests can be written using the `phpt` format. This is the format that PHP uses for its own tests. We use PHPUnit to run these tests. + +```bash +vendor/bin/phpunit -c phpunit-e2e.xml.dist +``` + +The following resources may be helpful when writing `phpt`-style tests: + +* +* +* +* ### Submitting Your Pull Request From f11637eb06bceb795c5297bc3caf03c0deb48b0c Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Mon, 9 Mar 2026 12:34:55 +0000 Subject: [PATCH 23/27] Use 'nightly' version to match matrix --- .github/workflows/end-to-end-tests.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/end-to-end-tests.yml b/.github/workflows/end-to-end-tests.yml index 404342aaf2..25c2b2749c 100644 --- a/.github/workflows/end-to-end-tests.yml +++ b/.github/workflows/end-to-end-tests.yml @@ -29,7 +29,6 @@ jobs: matrix: php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5', 'nightly'] - # yamllint disable-line rule:line-length name: "E2E PHP: ${{ matrix.php }}" continue-on-error: ${{ matrix.php == 'nightly' }} @@ -53,7 +52,7 @@ jobs: - name: Install Composer dependencies uses: "ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520" # 3.1.1 with: - composer-options: ${{ matrix.php == '8.6' && '--ignore-platform-req=php+' || '' }} + composer-options: ${{ matrix.php == 'nightly' && '--ignore-platform-req=php+' || '' }} custom-cache-suffix: $(date -u "+%Y-%m") - name: 'PHPUnit: run end-to-end tests (phpt)' From 595cae8fe8b65bccaa39799f883c8603c3f14828 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Mon, 9 Mar 2026 12:39:14 +0000 Subject: [PATCH 24/27] Add code comment to explain use of '--no-coverage' --- .github/workflows/end-to-end-tests.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/end-to-end-tests.yml b/.github/workflows/end-to-end-tests.yml index 25c2b2749c..4aa7312826 100644 --- a/.github/workflows/end-to-end-tests.yml +++ b/.github/workflows/end-to-end-tests.yml @@ -56,6 +56,11 @@ jobs: custom-cache-suffix: $(date -u "+%Y-%m") - name: 'PHPUnit: run end-to-end tests (phpt)' + # We have included '--no-coverage' here to make sure that we do not run with coverage enabled + # by mistake, if the Xdebug extension gets loaded in future. These tests are not compatible + # with how PHPUnit runs when coverage is enabled. This is because PHPUnit pre-loads all PHP + # files as part of its coverage initialisation process, and these tests specifically test the + # code which is used during the PHP_CodeSniffer bootstrap step. run: php "vendor/bin/phpunit" -c phpunit-e2e.xml.dist --no-coverage - name: "Install bashunit" From c39cb5b324c82962cf6cfddeb09b0fa533bfd7d7 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Mon, 9 Mar 2026 12:44:36 +0000 Subject: [PATCH 25/27] Remove settings which are not cross-version compatible While it would be great to have these here, the simplicity of supporting all PHPUnit versions in one file is more valuable to us at this stage. We have checked that PHP deprecations in the bootstrap stage are reported when running PHPUnit unit tests. --- phpunit-e2e.xml.dist | 4 ---- 1 file changed, 4 deletions(-) diff --git a/phpunit-e2e.xml.dist b/phpunit-e2e.xml.dist index a00b3b7e7b..2e989c9084 100644 --- a/phpunit-e2e.xml.dist +++ b/phpunit-e2e.xml.dist @@ -5,10 +5,6 @@ backupGlobals="true" beStrictAboutOutputDuringTests="true" beStrictAboutTestsThatDoNotTestAnything="true" - convertErrorsToExceptions="true" - convertWarningsToExceptions="true" - convertNoticesToExceptions="true" - convertDeprecationsToExceptions="true" > From f806de49898f2de1dc9aca526f2d7cdb881e78a3 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Mon, 9 Mar 2026 12:59:17 +0000 Subject: [PATCH 26/27] Split GitHub Action workflow into separate jobs --- .github/workflows/end-to-end-tests.yml | 52 +++++++++++++++++--------- 1 file changed, 35 insertions(+), 17 deletions(-) diff --git a/.github/workflows/end-to-end-tests.yml b/.github/workflows/end-to-end-tests.yml index 4aa7312826..c15ee0c910 100644 --- a/.github/workflows/end-to-end-tests.yml +++ b/.github/workflows/end-to-end-tests.yml @@ -15,21 +15,50 @@ on: # Allow manually triggering the workflow. workflow_dispatch: +# Cancels all previous workflow runs for the same branch that have not yet completed. +concurrency: + # The concurrency group contains the workflow name and the branch name. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: bash-tests: - # Cancels all previous runs of this particular job for the same branch that have not yet completed. - concurrency: - # The concurrency group contains the workflow name, job name, job index and the branch name. - group: ${{ github.workflow }}-${{ github.job }}-${{ strategy.job-index }}-${{ github.ref }} - cancel-in-progress: true + runs-on: 'ubuntu-latest' + + strategy: + matrix: + php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5', 'nightly'] + + name: "E2E PHP(bash): ${{ matrix.php }}" + + continue-on-error: ${{ matrix.php == 'nightly' }} + + steps: + - name: Prepare git to leave line endings alone + run: git config --global core.autocrlf input + + - name: Checkout code + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + + - name: "Install bashunit" + shell: bash + run: | + curl -s https://bashunit.typeddevs.com/install.sh > install.sh + chmod +x install.sh + ./install.sh + + - name: "Run bashunit tests" + shell: bash + run: "./lib/bashunit -p tests/EndToEnd" + phpt-tests: runs-on: 'ubuntu-latest' strategy: matrix: php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5', 'nightly'] - name: "E2E PHP: ${{ matrix.php }}" + name: "E2E PHP(phpt): ${{ matrix.php }}" continue-on-error: ${{ matrix.php == 'nightly' }} @@ -62,14 +91,3 @@ jobs: # files as part of its coverage initialisation process, and these tests specifically test the # code which is used during the PHP_CodeSniffer bootstrap step. run: php "vendor/bin/phpunit" -c phpunit-e2e.xml.dist --no-coverage - - - name: "Install bashunit" - shell: bash - run: | - curl -s https://bashunit.typeddevs.com/install.sh > install.sh - chmod +x install.sh - ./install.sh - - - name: "Run bashunit tests" - shell: bash - run: "./lib/bashunit -p tests/EndToEnd" From 20e02ccbdf491d7ac0d61d329c8a7dac858c3884 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Mon, 9 Mar 2026 13:11:26 +0000 Subject: [PATCH 27/27] Refine test names --- .github/workflows/end-to-end-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/end-to-end-tests.yml b/.github/workflows/end-to-end-tests.yml index 9b4f1d97a5..2e685e6007 100644 --- a/.github/workflows/end-to-end-tests.yml +++ b/.github/workflows/end-to-end-tests.yml @@ -29,7 +29,7 @@ jobs: matrix: php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5', 'nightly'] - name: "E2E PHP(bash): ${{ matrix.php }}" + name: "E2E Bash PHP: ${{ matrix.php }}" continue-on-error: ${{ matrix.php == 'nightly' }} @@ -60,7 +60,7 @@ jobs: matrix: php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5', 'nightly'] - name: "E2E PHP(phpt): ${{ matrix.php }}" + name: "E2E phpt PHP: ${{ matrix.php }}" continue-on-error: ${{ matrix.php == 'nightly' }}