*/ protected array $contents; /** @psalm-param non-empty-array $contents */ public function __construct(string $label, array $contents, ?string $name = null, bool $implicit_label = false) { if ([] === $contents) { throw new InvalidArgumentException("ContainerRepresentation can't take empty list"); } parent::__construct($label, $name, $implicit_label); $this->contents = $contents; } /** @psalm-return non-empty-array */ public function getContents(): array { return $this->contents; } public function getLabel(): string { return parent::getLabel().' ('.\count($this->contents).')'; } }