Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/target-repository/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
],
"require": {
"php": "^7.4|^8.0",
"phpstan/phpstan": "^2.1.37"
"phpstan/phpstan": "^2.1.38"
},
"autoload": {
"files": [
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"nikic/php-parser": "^5.7",
"ondram/ci-detector": "^4.2",
"phpstan/phpdoc-parser": "^2.3",
"phpstan/phpstan": "^2.1.37",
"phpstan/phpstan": "^2.1.38",
"react/event-loop": "^1.6",
"react/promise": "^3.3",
"react/socket": "^1.17",
Expand All @@ -36,7 +36,7 @@
"symfony/console": "^6.4.24",
"symfony/filesystem": "^7.0",
"symfony/finder": "^6.4",
"symfony/process": "^6.4|7.0.*",
"symfony/process": "^6.4|^7.4",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This got 7.4 already, since we don't use lowest and latest on CI.

https://github.com/rectorphp/rector-src/actions/runs/21650569728/job/62413793406#step:4:180

"symplify/easy-parallel": "^11.2.2",
"symplify/rule-doc-generator-contracts": "^11.2",
"webmozart/assert": "^2.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
use Rector\TypeDeclaration\Rector\FunctionLike\AddClosureParamTypeForArrayMapRector;
use Rector\ValueObject\PhpVersionFeature;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig
->rules([AddClosureParamTypeForArrayMapRector::class]);

$rectorConfig->phpVersion(PhpVersionFeature::UNION_TYPES);
};
return RectorConfig::configure()
->withRules([AddClosureParamTypeForArrayMapRector::class])
->withPhpVersion(PhpVersionFeature::UNION_TYPES);
4 changes: 2 additions & 2 deletions rules/Carbon/NodeFactory/CarbonCallFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public function createFromDateTimeString(
$methodCall = $this->createModifyMethodCall(
$carbonCall,
new Int_((int) $match['count']),
$match['unit'],
$match['operator']
(string) $match['unit'],
(string) $match['operator']
);
if ($methodCall instanceof MethodCall) {
$carbonCall = $methodCall;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ private function resolveNewVariableName(string $typeShortName): string
lcfirst($typeShortName),
self::STARTS_WITH_ABBREVIATION_REGEX,
static function (array $matches): string {
$output = isset($matches[1]) ? strtolower((string) $matches[1]) : '';
$output = isset($matches[1]) ? strtolower($matches[1]) : '';
$output .= $matches[2] ?? '';

return $output . ($matches[3] ?? '');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ private function singularizeCamelParts(string $currentName): string
if (in_array($camelCase[self::CAMELCASE], ['is', 'has', 'cms', 'this'], true)) {
$value = $camelCase[self::CAMELCASE];
} else {
$value = $this->inflector->singularize($camelCase[self::CAMELCASE]);
$value = $this->inflector->singularize((string) $camelCase[self::CAMELCASE]);
}

$resolvedName .= $value;
Expand Down
2 changes: 1 addition & 1 deletion rules/Naming/RectorNamingInflector.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function singularize(string $name): string
return $this->inflector->singularize($name);
}

$singularized = $this->inflector->singularize($matches['prefix']);
$singularized = $this->inflector->singularize((string) $matches['prefix']);
$uninflectable = $matches['suffix'];

return $singularized . $uninflectable;
Expand Down
2 changes: 1 addition & 1 deletion rules/Php55/RegexMatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private function matchConcat(Concat $concat): ?Concat
return null;
}

if (! \str_contains((string) $matches['modifiers'], 'e')) {
if (! \str_contains($matches['modifiers'], 'e')) {
return null;
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/check-before-after-same-fixtures.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private function hasFileSameBeforeAndAfterPart(SplFileInfo $fixtureFile): bool
return false;
}

return trim((string) $parts[0]) === trim((string) $parts[1]);
return trim($parts[0]) === trim($parts[1]);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/BetterPhpDocParser/PhpDocParser/BetterPhpDocParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public function parseTagValue(TokenIterator $tokenIterator, string $tag): PhpDoc
$phpDocTagValueNode->value = Strings::replace(
$phpDocTagValueNode->value,
self::MULTI_NEW_LINES_REGEX,
static fn (array $match) => $match['new_line']
static fn (array $match): string => (string) $match['new_line']
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/BetterPhpDocParser/Printer/PhpDocInfoPrinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ private function printPhpDocNode(PhpDocNode $phpDocNode): string
return Strings::replace(
$output,
self::NEW_LINE_WITH_SPACE_REGEX,
static fn (array $match) => $match['new_line']
static fn (array $match): string => (string) $match['new_line']
);
}

Expand Down
1 change: 1 addition & 0 deletions src/FileSystem/FilePathHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public function normalizePathAndSchema(string $originalPath): string
$pathRoot = str_starts_with($path, '/') ? $directorySeparator : '';
$pathParts = explode('/', trim($path, '/'));

/** @var string $scheme */
$normalizedPathParts = $this->normalizePathParts($pathParts, $scheme);

$pathStart = ($scheme !== self::SCHEME_UNDEFINED ? $scheme . '://' : '');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -509,9 +509,11 @@ private function processAssign(Assign|AssignOp|AssignRef $assign, MutatingScope
private function processArray(List_|Array_ $array, MutatingScope $mutatingScope): void
{
foreach ($array->items as $arrayItem) {
if ($arrayItem instanceof ArrayItem) {
$this->processArrayItem($arrayItem, $mutatingScope);
if (! $arrayItem instanceof ArrayItem) {
continue;
}

$this->processArrayItem($arrayItem, $mutatingScope);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/PhpParser/Parser/InlineCodeParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ private function resolveConcatValue(Concat $concat): string
return Strings::replace(
$string,
self::VARIABLE_IN_SINGLE_QUOTED_REGEX,
static fn (array $match) => $match['variable']
static fn (array $match): string => (string) $match['variable']
);
}
}