/** * Install the package. * * @since 0.1.0 * * @param InstalledRepositoryInterface $repo The repository from where the package was fetched. * @param PackageInterface $package The package to install. * * @throws InvalidArgumentException If the package name does not match the required pattern. */ public function install(InstalledRepositoryInterface $repo, PackageInterface $package) { $path = $this->getInstallPath($package); if ($this->io->isVerbose()) { $this->io->write(sprintf(_('Symlinking PHP Composter action %1$s'), $path), true); } parent::install($repo, $package); foreach ($this->getHooks($package) as $prioritizedHook => $method) { $array = explode('.', $prioritizedHook); if (count($array) > 1) { list($priority, $hook) = $array; } else { $hook = $array[0]; $priority = 10; } if ($this->io->isVeryVerbose()) { $this->io->write(sprintf(_('Adding method "%1$s" to hook "%2$s" with priority %3$s'), $method, $hook, $priority), true); } HookConfig::addEntry($hook, $method, $priority); } }