Skip to content

Commit

Permalink
phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Aug 30, 2021
1 parent be87501 commit b3c9938
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/PhpParser/Node/NodeFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -575,10 +575,6 @@ public function createClassConstant(string $name, Expr $expr, int $modifier): Cl
private function createArrayItem($item, string | int | null $key = null): ArrayItem
{
$arrayItem = null;
if ($item === null) {
$item = $this->createNull();
$arrayItem = new ArrayItem($item);
}

if ($item instanceof Variable
|| $item instanceof MethodCall
Expand All @@ -599,7 +595,7 @@ private function createArrayItem($item, string | int | null $key = null): ArrayI
$arrayItem = new ArrayItem($this->createArray($item));
}

if ($item instanceof ClassConstFetch) {
if ($item === null || $item instanceof ClassConstFetch) {
$itemValue = BuilderHelpers::normalizeValue($item);
$arrayItem = new ArrayItem($itemValue);
}
Expand Down

0 comments on commit b3c9938

Please sign in to comment.