ManageOptions example

/** * Handler constructor. * * @param \Composer\Composer $composer * The Composer service. * @param \Composer\IO\IOInterface $io * The Composer I/O service. */
  public function __construct(Composer $composer, IOInterface $io) {
    $this->composer = $composer;
    $this->io = $io;
    $this->manageOptions = new ManageOptions($composer);
    $this->manageAllowedPackages = new AllowedPackages($composer$io$this->manageOptions);
  }

  /** * Registers post-package events if the 'require' command was called. */
  public function requireWasCalled() {
    // In order to differentiate between post-package events called after     // 'composer require' vs. the same events called at other times, we will     // only install our handler when a 'require' event is detected.     $this->postPackageListeners[] = $this->manageAllowedPackages;
  }
Home | Imprint | This part of the site doesn't use cookies.