Esempio n. 1
0
 /**
  * Runs the chain and its all rules.
  * You can assign multiple chains to process one image
  *
  * run(chain1, chain2, ...)
  *
  * @param Chain $chain Chain object
  *
  * @return void
  */
 public function run(Chain $chain)
 {
     $this->_throwExceptionIfBaseDirectoryIsNotSet();
     $this->_throwExceptionIfNoImageIsFound();
     $chains = func_get_args();
     /** @var Chain $chain */
     foreach ($chains as $chain) {
         // Inject the file system to the rules
         $rules = $chain->getRules();
         /** @var Rule $rule */
         foreach ($rules as $rule) {
             $rule->setFileSystem($this->_fileSystem);
         }
         $chain->process($this->_image);
         $this->_formatFile($this->_image);
     }
 }