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
4 changes: 4 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -340,3 +340,7 @@ parameters:
identifier: rector.upgradeDowngradeRegisteredInSet
count: 1
path: rules/Php74/Rector/Double/RealToFloatTypeCastRector.php

-
message: '#Offset float\|int\|string might not exist on string#'
path: rules/Php70/EregToPcreTransformer.php
2 changes: 2 additions & 0 deletions rules/CodingStyle/Rector/Stmt/NewlineAfterStatementRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ private function processAddNewLine(
continue;
}

/** @var Stmt $stmt */
$endLine = $stmt->getEndLine();
/** @var Stmt $nextStmt */
$line = $nextStmt->getStartLine();
$rangeLine = $line - $endLine;

Expand Down
4 changes: 4 additions & 0 deletions rules/Php70/Rector/FuncCall/CallUserMethodRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ public function refactor(Node $node): ?Node
return null;
}

if (! isset(self::OLD_TO_NEW_FUNCTIONS[$this->getName($node)])) {
return null;
}

$newName = self::OLD_TO_NEW_FUNCTIONS[$this->getName($node)];
$node->name = new Name($newName);

Expand Down
4 changes: 4 additions & 0 deletions rules/Php73/Rector/FuncCall/ArrayKeyFirstLastRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ private function processArrayKeyFirstLast(
continue;
}

if (! isset(self::PREVIOUS_TO_NEW_FUNCTIONS[$this->getName($stmt->expr)])) {
continue;
}

$newName = self::PREVIOUS_TO_NEW_FUNCTIONS[$this->getName($stmt->expr)];
$keyFuncCall->name = new Name($newName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public function provideMinPhpVersion(): int
private function resolveNamedPositions(FuncCall $funcCall, array $args): array
{
$functionName = $this->getName($funcCall);
$argNames = NameNullToStrictNullFunctionMap::FUNCTION_TO_PARAM_NAMES[$functionName];
$argNames = NameNullToStrictNullFunctionMap::FUNCTION_TO_PARAM_NAMES[$functionName] ?? [];
$positions = [];

foreach ($args as $position => $arg) {
Expand Down
Loading