Event.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. /**
  15. * The base event class
  16. *
  17. * @author François Pluchino <francois.pluchino@opendisplay.com>
  18. */
  19. class Event
  20. {
  21. /**
  22. * @var string This event's name
  23. */
  24. private $name;
  25. /**
  26. * @var Composer The composer instance
  27. */
  28. private $composer;
  29. /**
  30. * @var IOInterface The IO instance
  31. */
  32. private $io;
  33. /**
  34. * Constructor.
  35. *
  36. * @param string $name The event name
  37. * @param Composer $composer The composer objet
  38. * @param IOInterface $io The IOInterface object
  39. */
  40. public function __construct($name, Composer $composer, IOInterface $io)
  41. {
  42. $this->name = $name;
  43. $this->composer = $composer;
  44. $this->io = $io;
  45. }
  46. /**
  47. * Returns the event's name.
  48. *
  49. * @return string The event name
  50. */
  51. public function getName()
  52. {
  53. return $this->name;
  54. }
  55. /**
  56. * Returns the composer instance.
  57. *
  58. * @return Composer
  59. */
  60. public function getComposer()
  61. {
  62. return $this->composer;
  63. }
  64. /**
  65. * Returns the IO instance.
  66. *
  67. * @return IOInterface
  68. */
  69. public function getIO()
  70. {
  71. return $this->io;
  72. }
  73. }