PackageEvent.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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\Script;
  12. use Composer\Composer;
  13. use Composer\IO\IOInterface;
  14. use Composer\DependencyResolver\Operation\OperationInterface;
  15. /**
  16. * The Package Event.
  17. *
  18. * @author Jordi Boggiano <j.boggiano@seld.be>
  19. */
  20. class PackageEvent extends Event
  21. {
  22. /**
  23. * @var OperationInterface The package instance
  24. */
  25. private $operation;
  26. /**
  27. * Constructor.
  28. *
  29. * @param string $name The event name
  30. * @param Composer $composer The composer object
  31. * @param IOInterface $io The IOInterface object
  32. * @param boolean $devMode Whether or not we are in dev mode
  33. * @param OperationInterface $operation The operation object
  34. */
  35. public function __construct($name, Composer $composer, IOInterface $io, $devMode, OperationInterface $operation)
  36. {
  37. parent::__construct($name, $composer, $io, $devMode);
  38. $this->operation = $operation;
  39. }
  40. /**
  41. * Returns the package instance.
  42. *
  43. * @return OperationInterface
  44. */
  45. public function getOperation()
  46. {
  47. return $this->operation;
  48. }
  49. }