Skip to content

Commit

Permalink
Update Array_ annotations, items are nullable (#696)
Browse files Browse the repository at this point in the history
When used to destructure, items are optional. E.g. `[$a, , $b] = [1, 2, 3];`.
  • Loading branch information
rainbow-alex committed Aug 8, 2020
1 parent f845568 commit 54fc023
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/PhpParser/Node/Expr/Array_.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ class Array_ extends Expr
const KIND_LONG = 1; // array() syntax
const KIND_SHORT = 2; // [] syntax

/** @var ArrayItem[] Items */
/** @var (ArrayItem|null)[] Items */
public $items;

/**
* Constructs an array node.
*
* @param ArrayItem[] $items Items of the array
* @param (ArrayItem|null)[] $items Items of the array
* @param array $attributes Additional attributes
*/
public function __construct(array $items = [], array $attributes = []) {
Expand Down

0 comments on commit 54fc023

Please sign in to comment.