PackageEvent.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /*
  3. * This file is part of Composer.
  4. *
  5. * (c) Nils Adermann <naderman@naderman.de>
  6. * Jordi Boggiano <j.boggiano@seld.be>
  7. *
  8. * For the full copyright and license information, please view the LICENSE
  9. * file that was distributed with this source code.
  10. */
  11. namespace Composer\Installer;
  12. use Composer\Composer;
  13. use Composer\IO\IOInterface;
  14. use Composer\DependencyResolver\Operation\OperationInterface;
  15. use Composer\DependencyResolver\PolicyInterface;
  16. use Composer\DependencyResolver\Request;
  17. use Composer\Repository\CompositeRepository;
  18. /**
  19. * The Package Event.
  20. *
  21. * @author Jordi Boggiano <j.boggiano@seld.be>
  22. */
  23. class PackageEvent extends InstallerEvent
  24. {
  25. /**
  26. * @var OperationInterface The package instance
  27. */
  28. private $operation;
  29. /**
  30. * Constructor.
  31. *
  32. * @param string $eventName
  33. * @param Composer $composer
  34. * @param IOInterface $io
  35. * @param bool $devMode
  36. * @param PolicyInterface $policy
  37. * @param RepositorySet $repositorySet
  38. * @param CompositeRepository $installedRepo
  39. * @param Request $request
  40. * @param OperationInterface[] $operations
  41. * @param OperationInterface $operation
  42. */
  43. public function __construct($eventName, Composer $composer, IOInterface $io, $devMode, PolicyInterface $policy, RepositorySet $repositorySet, CompositeRepository $installedRepo, Request $request, array $operations, OperationInterface $operation)
  44. {
  45. parent::__construct($eventName, $composer, $io, $devMode, $policy, $repositorySet, $installedRepo, $request, $operations);
  46. $this->operation = $operation;
  47. }
  48. /**
  49. * Returns the package instance.
  50. *
  51. * @return OperationInterface
  52. */
  53. public function getOperation()
  54. {
  55. return $this->operation;
  56. }
  57. }