This commit is contained in:
crazywhalecc
2022-07-03 12:19:01 +08:00
committed by Jerry Ma
parent 5459d1c5ff
commit b1e37943df
2 changed files with 7 additions and 4 deletions

View File

@@ -72,7 +72,10 @@
], ],
"config": { "config": {
"optimize-autoloader": true, "optimize-autoloader": true,
"sort-packages": true "sort-packages": true,
"allow-plugins": {
"phpstan/extension-installer": true
}
}, },
"extra": { "extra": {
"hooks": { "hooks": {

View File

@@ -156,16 +156,16 @@ function match_args(string $pattern, string $subject)
$exp = explode('*', $pattern); $exp = explode('*', $pattern);
$i = 0; $i = 0;
foreach ($exp as $k => $v) { foreach ($exp as $k => $v) {
if (empty($v) && $k === 0) { if ($v === '' && $k === 0) {
continue; continue;
} }
if (empty($v) && $k === count($exp) - 1) { if ($v === '' && $k === count($exp) - 1) {
$subject .= '^EOL'; $subject .= '^EOL';
$v = '^EOL'; $v = '^EOL';
} }
$cur_var = ''; $cur_var = '';
$ori = $i; $ori = $i;
while (($a = mb_substr($subject, $i, mb_strlen($v))) !== $v && !empty($a)) { while (($a = mb_substr($subject, $i, mb_strlen($v))) !== $v && $a !== '') {
$cur_var .= mb_substr($subject, $i, 1); $cur_var .= mb_substr($subject, $i, 1);
++$i; ++$i;
} }