Skip to content
Closed
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
6 changes: 0 additions & 6 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,6 @@ parameters:
identifier: offsetAccess.nonArray
path: src/PhpParser/NodeTraverser/RectorNodeTraverser.php

# known non-empty class method
-
identifier: offsetAccess.notFound
message: '#Offset 0 might not exist on array<PhpParser\\Node\\Stmt>\|null#'
path: rules/DeadCode/Rector/ClassMethod/RemoveParentDelegatingConstructorRector.php

-
identifier: offsetAccess.notFound
message: '#Offset float\|int\|string might not exist on string#'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,10 @@ private function matchParentConstructorCallArgs(Stmt $stmt): ?array

private function isParameterAndArgCountAndOrderIdentical(ClassMethod $classMethod): bool
{
$soleStmt = $classMethod->stmts[0];
$soleStmt = $classMethod->stmts[0] ?? null;
if (! $soleStmt instanceof Stmt) {
return false;
}

$parentCallArgs = $this->matchParentConstructorCallArgs($soleStmt);
if ($parentCallArgs === null) {
Expand Down
Loading