aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/linters/src
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-08-15 07:50:54 +0900
committernsfisis <nsfisis@gmail.com>2026-08-15 07:50:54 +0900
commit55f385450407a3d8c6c7c90ec4dc8995f5277a94 (patch)
tree5986bcaa39026dadc960147e0c35440c1d63c81d /scripts/linters/src
parent548463bad1f72c97f68b47f54a263a4f4ad87b3a (diff)
downloadphp-shirabe-55f385450407a3d8c6c7c90ec4dc8995f5277a94.tar.gz
php-shirabe-55f385450407a3d8c6c7c90ec4dc8995f5277a94.tar.zst
php-shirabe-55f385450407a3d8c6c7c90ec4dc8995f5277a94.zip
fix(phar): match the stub token in any letter case
`__halt_compiler` is a PHP keyword, so a stub may spell the token in any letter case. The native phar reader compared the bytes exactly and rejected such an archive, and the lint that keeps a second token out of the executable missed lowercase ones, which would shadow the embedded bundle. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'scripts/linters/src')
-rw-r--r--scripts/linters/src/Linters/NoHaltCompilerLiteral.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/linters/src/Linters/NoHaltCompilerLiteral.php b/scripts/linters/src/Linters/NoHaltCompilerLiteral.php
index 30520ff7..30160886 100644
--- a/scripts/linters/src/Linters/NoHaltCompilerLiteral.php
+++ b/scripts/linters/src/Linters/NoHaltCompilerLiteral.php
@@ -20,7 +20,7 @@ final class NoHaltCompilerLiteral implements Linter
public function failureIntro(): string
{
- return "Found a literal `" . self::TOKEN . "`.\n"
+ return "Found a literal `" . self::TOKEN . "` (case-insensitive).\n"
. "The executable carries the Composer runtime bundle as a phar that PHP finds by\n"
. "scanning for the first occurrence of that token, and every literal here ends up in\n"
. "the same binary, so an earlier one shadows the bundle. Build the token at run time\n"
@@ -39,7 +39,7 @@ final class NoHaltCompilerLiteral implements Linter
}
foreach (file($path) as $idx => $raw) {
- if (!str_contains($raw, self::TOKEN)) {
+ if (stripos($raw, self::TOKEN) === false) {
continue;
}