items = $items; $this->sealed = $sealed; $this->unsealedType = $unsealedType; $this->kind = $kind; } /** * @param ArrayShapeItemNode[] $items * @param self::KIND_* $kind */ public static function createSealed(array $items, string $kind = self::KIND_ARRAY): self { return new self($items, true, null, $kind); } /** * @param ArrayShapeItemNode[] $items * @param self::KIND_* $kind */ public static function createUnsealed(array $items, ?ArrayShapeUnsealedTypeNode $unsealedType, string $kind = self::KIND_ARRAY): self { return new self($items, false, $unsealedType, $kind); } public function __toString(): string { $items = $this->items; if (! $this->sealed) { $items[] = '...' . $this->unsealedType; } return $this->kind . '{' . implode(', ', $items) . '}'; } /** * @param array $properties */ public static function __set_state(array $properties): self { $instance = new self($properties['items'], $properties['sealed'], $properties['unsealedType'], $properties['kind']); if (isset($properties['attributes'])) { foreach ($properties['attributes'] as $key => $value) { $instance->setAttribute($key, $value); } } return $instance; } }