public function setOutputFormat($outputFormat) { if (!$this->isValidOutputFormat($outputFormat)) { throw new InvalidFormat('Format ' . $outputFormat . ' is not supported'); } $this->outputFormat = $outputFormat; return $this; }