isWrappedInBrackets = $isWrappedInBrackets; parent::__construct($types); } /** * Preserve common format */ public function __toString() : string { if (!$this->isWrappedInBrackets) { return \implode('|', $this->types); } return '(' . \implode('|', $this->types) . ')'; } public function isWrappedInBrackets() : bool { return $this->isWrappedInBrackets; } }