Skip to content

Commit 7d88728

Browse files
committed
Merge branch 'php8.4' of https://github.com/LongTermSupport/php-qa-ci into php8.4
2 parents 8481906 + 670470a commit 7d88728

7 files changed

Lines changed: 230 additions & 162 deletions

composer.lock

Lines changed: 222 additions & 156 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/PHPStan/Rules/RequireExplicitDIAttributeRule.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
final class RequireExplicitDIAttributeRule implements Rule
9090
{
9191
public const string IDENTIFIER_REQUIRE_EXPLICIT_DI_ATTRIBUTE = RuleIdentifierInterface::PREFIX . '.requireExplicitDIAttribute';
92+
9293
public const string IDENTIFIER_CONFLICTING_DI_ATTRIBUTES = RuleIdentifierInterface::PREFIX . '.conflictingDIAttributes';
9394

9495
private const array ALLOWED_NAMESPACES_WITHOUT_ATTRIBUTE = [

src/PHPStan/Rules/RequireReadonlyServiceRule.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public function processNode(Node $node, Scope $scope): array
136136
// legitimate mutable state (e.g. lazy-initialised caches) and
137137
// cannot be made readonly without extracting that state.
138138
foreach ($node->stmts as $stmt) {
139-
if ($stmt instanceof \PhpParser\Node\Stmt\Property && !$stmt->isReadonly()) {
139+
if ($stmt instanceof Node\Stmt\Property && !$stmt->isReadonly()) {
140140
return [];
141141
}
142142
}
@@ -176,5 +176,4 @@ private function isDoctrineEntity(Class_ $node): bool
176176

177177
return false;
178178
}
179-
180179
}

src/PHPStan/Rules/RequireRuleIdentifierConstantRule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public function processNode(Node $node, Scope $scope): array
9999
\sprintf(
100100
'PHPStan rule identifier "%s" is a magic string. '
101101
. 'Declare it as a class constant composed from RuleIdentifierInterface::PREFIX '
102-
. '(e.g. public const string IDENTIFIER = RuleIdentifierInterface::PREFIX . \'.something\') '
102+
. "(e.g. public const string IDENTIFIER = RuleIdentifierInterface::PREFIX . '.something') "
103103
. 'and pass the constant to ->identifier() instead.',
104104
$firstArg->value->value,
105105
),

src/PHPStan/Rules/RequireTypeSuffixRule.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
final class RequireTypeSuffixRule implements Rule
2929
{
3030
public const string IDENTIFIER_INTERFACE_SUFFIX = RuleIdentifierInterface::PREFIX . '.interfaceSuffix';
31+
3132
public const string IDENTIFIER_ENUM_SUFFIX = RuleIdentifierInterface::PREFIX . '.enumSuffix';
33+
3234
public const string IDENTIFIER_TRAIT_SUFFIX = RuleIdentifierInterface::PREFIX . '.traitSuffix';
3335

3436
/**

src/PHPStan/Rules/RequireVariadicForSingleListParamRule.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ private function isDeclaredAsArray(mixed $type): bool
120120
private function hasListAnnotation(string $docComment, string $paramName): bool
121121
{
122122
// Matches: @param list<T> $paramName or list<T<U>> $paramName (one level of nesting)
123-
$escapedName = \preg_quote($paramName, '/');
123+
$escapedName = preg_quote($paramName, '/');
124124
$pattern = '/@param\s+list\s*<(?:[^<>]|<[^>]*>)*>\s+\$' . $escapedName . '\b/';
125125

126-
return (bool) \preg_match($pattern, $docComment);
126+
return (bool)\Safe\preg_match($pattern, $docComment);
127127
}
128128
}

tests/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@
4242
// unit-testing custom PHPStan rules directly — without running the full
4343
// static-analysis pipeline.
4444
$phpstanPhar = \dirname(__DIR__) . '/vendor-phar/phpstan.phar';
45-
if (\file_exists($phpstanPhar)) {
45+
if (file_exists($phpstanPhar)) {
4646
require_once 'phar://' . $phpstanPhar . '/vendor/autoload.php';
4747
}

0 commit comments

Comments
 (0)