Exemplo n.º 1
0
 /**
  * @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;
 }
Exemplo n.º 2
0
 /**
  * @param CompressorInterface $compressor
  *
  * @return $this
  */
 public function attach(CompressorInterface $compressor)
 {
     $this->children[$compressor->getName()] = $compressor;
     return $this;
 }