/** * @param PackageEvent $event */ public function onDisablePackage(PackageEvent $event) { $package = $event->getPackage(); if ($package->getRemote()->getAdapter() !== 'GitLab') { return; } $this->adapter->disableHook($package); }
/** * @param PackageEvent $event */ public function onCreatePackage(PackageEvent $event) { $package = $event->getPackage(); $config = $this->entityManager->getRepository('Terramar\\Packages\\Plugin\\Satis\\PackageConfiguration')->findOneBy(array('package' => $package)); if (!$config) { $config = new PackageConfiguration(); $config->setPackage($package); } $this->entityManager->persist($config); }
/** * Constructor. * * @param Package $package The updated package * @param string $repositoryPath The path to the cloned repository */ public function __construct(Package $package, $repositoryPath) { $this->repositoryPath = $repositoryPath; parent::__construct($package); }
/** * Constructor. * * @param Package $package The updated package * @param mixed $payload Any data received from the remote host */ public function __construct(Package $package, $payload) { $this->payload = $payload; parent::__construct($package); }
public function testGetPackage() { $this->assertSame($this->package, $this->sut->getPackage()); }