/** * @param CompressorInterface $compressor * * @throws \RuntimeException * * @return $this */ public function setCompressor(CompressorInterface $compressor) { if (!$compressor->isSupported()) { throw new \RuntimeException('Unsupported type of compressor: ' . $compressor->getName()); } $this->compressor = $compressor; return $this; }
/** * @param CompressorInterface $compressor * * @return $this */ public function attach(CompressorInterface $compressor) { $this->children[$compressor->getName()] = $compressor; return $this; }