From 54fc023b25ed549626e5b7c5e0706c045c4230b7 Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 8 Aug 2020 10:04:21 +0200 Subject: [PATCH] Update Array_ annotations, items are nullable (#696) When used to destructure, items are optional. E.g. `[$a, , $b] = [1, 2, 3];`. --- lib/PhpParser/Node/Expr/Array_.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/PhpParser/Node/Expr/Array_.php b/lib/PhpParser/Node/Expr/Array_.php index fbe207e..e6eaa28 100644 --- a/lib/PhpParser/Node/Expr/Array_.php +++ b/lib/PhpParser/Node/Expr/Array_.php @@ -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 = []) {