Beispiel #1
0
 /**
  * Compresses the files (if necessary).
  *
  * @param Builder $builder The archive builder.
  *
  * @return BuildCommand For method chaining.
  *
  * @throws InvalidArgumentException If the algorithm is invalid.
  */
 private function compressFiles(Builder $builder)
 {
     $event = new PreCompressEvent($builder, constant('Phar::' . $this->config['build']['compress']));
     $this->dispatcher->dispatch(Events::PRE_BUILD_COMPRESS, $event);
     if (Builder::NONE !== $event->getAlgorithm()) {
         $builder->compressFiles($event->getAlgorithm());
     }
     $this->dispatcher->dispatch(Events::POST_BUILD_COMPRESS, new PostCompressEvent($builder, $event->getAlgorithm()));
     return $this;
 }