/** * Signs the archive. * * @param Builder $builder The archive builder. * * @return BuildCommand For method chaining. */ private function sign(Builder $builder) { $event = new PreSignEvent($builder, constant('Phar::' . $this->config['build']['signature']['algorithm']), $this->config['build']['signature']['file']); $this->dispatcher->dispatch(Events::PRE_BUILD_SIGN, $event); $builder->setSignatureAlgorithm($event->getAlgorithm(), $event->getPath()); $this->dispatcher->dispatch(Events::POST_BUILD_SIGN, new PostSignEvent($builder, $event->getAlgorithm(), $event->getPath())); return $this; }