Skip to content

Commit 54fc023

Browse files
authored
Update Array_ annotations, items are nullable (nikic#696)
When used to destructure, items are optional. E.g. `[$a, , $b] = [1, 2, 3];`.
1 parent f845568 commit 54fc023

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/PhpParser/Node/Expr/Array_.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ class Array_ extends Expr
1010
const KIND_LONG = 1; // array() syntax
1111
const KIND_SHORT = 2; // [] syntax
1212

13-
/** @var ArrayItem[] Items */
13+
/** @var (ArrayItem|null)[] Items */
1414
public $items;
1515

1616
/**
1717
* Constructs an array node.
1818
*
19-
* @param ArrayItem[] $items Items of the array
19+
* @param (ArrayItem|null)[] $items Items of the array
2020
* @param array $attributes Additional attributes
2121
*/
2222
public function __construct(array $items = [], array $attributes = []) {

0 commit comments

Comments
 (0)