Skip to content

Commit 6dccbc5

Browse files
committed
Updated Rector to commit 4997962de1f53c449dadbef7025bffe5ca41e63c
rectorphp/rector-src@4997962 Bump PHPStan to 2.1.38 (#7879)
1 parent 2bfed63 commit 6dccbc5

36 files changed

Lines changed: 258 additions & 135 deletions

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
],
1010
"require": {
1111
"php": "^7.4|^8.0",
12-
"phpstan/phpstan": "^2.1.37"
12+
"phpstan/phpstan": "^2.1.38"
1313
},
1414
"autoload": {
1515
"files": [

rules/Carbon/NodeFactory/CarbonCallFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function createFromDateTimeString(FullyQualified $carbonFullyQualified, S
3232
$string->value = Strings::replace($string->value, self::STATIC_DATE_REGEX);
3333
// Handle add/sub multiple times
3434
while ($match = Strings::match($string->value, self::PLUS_MINUS_COUNT_REGEX)) {
35-
$methodCall = $this->createModifyMethodCall($carbonCall, new Int_((int) $match['count']), $match['unit'], $match['operator']);
35+
$methodCall = $this->createModifyMethodCall($carbonCall, new Int_((int) $match['count']), (string) $match['unit'], (string) $match['operator']);
3636
if ($methodCall instanceof MethodCall) {
3737
$carbonCall = $methodCall;
3838
$string->value = Strings::replace($string->value, self::PLUS_MINUS_COUNT_REGEX, '', 1);

rules/CodingStyle/Rector/Catch_/CatchExceptionNameMatchingTypeRector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ private function shouldSkipFollowingCatch(Catch_ $catch, string $newVariableName
129129
private function resolveNewVariableName(string $typeShortName): string
130130
{
131131
return Strings::replace(lcfirst($typeShortName), self::STARTS_WITH_ABBREVIATION_REGEX, static function (array $matches): string {
132-
$output = isset($matches[1]) ? strtolower((string) $matches[1]) : '';
132+
$output = isset($matches[1]) ? strtolower($matches[1]) : '';
133133
$output .= $matches[2] ?? '';
134134
return $output . ($matches[3] ?? '');
135135
});

rules/Naming/ExpectedNameResolver/InflectorSingularResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ private function singularizeCamelParts(string $currentName): string
8282
if (in_array($camelCase[self::CAMELCASE], ['is', 'has', 'cms', 'this'], \true)) {
8383
$value = $camelCase[self::CAMELCASE];
8484
} else {
85-
$value = $this->inflector->singularize($camelCase[self::CAMELCASE]);
85+
$value = $this->inflector->singularize((string) $camelCase[self::CAMELCASE]);
8686
}
8787
$resolvedName .= $value;
8888
}

rules/Naming/RectorNamingInflector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function singularize(string $name): string
2626
if ($matches === null) {
2727
return $this->inflector->singularize($name);
2828
}
29-
$singularized = $this->inflector->singularize($matches['prefix']);
29+
$singularized = $this->inflector->singularize((string) $matches['prefix']);
3030
$uninflectable = $matches['suffix'];
3131
return $singularized . $uninflectable;
3232
}

rules/Php55/RegexMatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ private function matchConcat(Concat $concat): ?Concat
9292
if (!isset($matches['modifiers'])) {
9393
return null;
9494
}
95-
if (strpos((string) $matches['modifiers'], 'e') === \false) {
95+
if (strpos($matches['modifiers'], 'e') === \false) {
9696
return null;
9797
}
9898
// replace last "e" in the code

src/Application/VersionResolver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ final class VersionResolver
1919
* @api
2020
* @var string
2121
*/
22-
public const PACKAGE_VERSION = 'a134f6a4f9025323710e707feb16a69c1e9bf9d7';
22+
public const PACKAGE_VERSION = '4997962de1f53c449dadbef7025bffe5ca41e63c';
2323
/**
2424
* @api
2525
* @var string
2626
*/
27-
public const RELEASE_DATE = '2026-02-03 22:32:11';
27+
public const RELEASE_DATE = '2026-02-03 23:37:44';
2828
/**
2929
* @var int
3030
*/

src/BetterPhpDocParser/PhpDocParser/BetterPhpDocParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public function parseTagValue(TokenIterator $tokenIterator, string $tag): PhpDoc
117117
$startAndEnd = new StartAndEnd($startPosition, $endPosition);
118118
$phpDocTagValueNode->setAttribute(PhpDocAttributeKey::START_AND_END, $startAndEnd);
119119
if ($phpDocTagValueNode instanceof GenericTagValueNode) {
120-
$phpDocTagValueNode->value = Strings::replace($phpDocTagValueNode->value, self::MULTI_NEW_LINES_REGEX, static fn(array $match) => $match['new_line']);
120+
$phpDocTagValueNode->value = Strings::replace($phpDocTagValueNode->value, self::MULTI_NEW_LINES_REGEX, static fn(array $match): string => (string) $match['new_line']);
121121
}
122122
return $phpDocTagValueNode;
123123
}

src/BetterPhpDocParser/Printer/PhpDocInfoPrinter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ private function printPhpDocNode(PhpDocNode $phpDocNode): string
165165
if (strncmp($output, '/**', strlen('/**')) === 0 && !StringUtils::isMatch($output, self::CLOSING_DOCBLOCK_REGEX)) {
166166
$output .= ' */';
167167
}
168-
return Strings::replace($output, self::NEW_LINE_WITH_SPACE_REGEX, static fn(array $match) => $match['new_line']);
168+
return Strings::replace($output, self::NEW_LINE_WITH_SPACE_REGEX, static fn(array $match): string => (string) $match['new_line']);
169169
}
170170
private function hasDocblockStart(string $output): bool
171171
{

src/FileSystem/FilePathHelper.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public function normalizePathAndSchema(string $originalPath): string
5959
$path = Strings::replace($normalizedPath, self::TWO_AND_MORE_SLASHES_REGEX, '/');
6060
$pathRoot = strncmp($path, '/', strlen('/')) === 0 ? $directorySeparator : '';
6161
$pathParts = explode('/', trim($path, '/'));
62+
/** @var string $scheme */
6263
$normalizedPathParts = $this->normalizePathParts($pathParts, $scheme);
6364
$pathStart = $scheme !== self::SCHEME_UNDEFINED ? $scheme . '://' : '';
6465
return PathNormalizer::normalize($pathStart . $pathRoot . implode($directorySeparator, $normalizedPathParts));

0 commit comments

Comments
 (0)