InstallerEvent.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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\DependencyResolver\PolicyInterface;
  14. use Composer\DependencyResolver\Operation\OperationInterface;
  15. use Composer\DependencyResolver\Pool;
  16. use Composer\DependencyResolver\Request;
  17. use Composer\EventDispatcher\Event;
  18. use Composer\IO\IOInterface;
  19. use Composer\Repository\CompositeRepository;
  20. /**
  21. * An event for all installer.
  22. *
  23. * @author François Pluchino <francois.pluchino@gmail.com>
  24. */
  25. class InstallerEvent extends Event
  26. {
  27. /**
  28. * @var Composer
  29. */
  30. private $composer;
  31. /**
  32. * @var IOInterface
  33. */
  34. private $io;
  35. /**
  36. * @var PolicyInterface
  37. */
  38. private $policy;
  39. /**
  40. * @var Pool
  41. */
  42. private $pool;
  43. /**
  44. * @var CompositeRepository
  45. */
  46. private $installedRepo;
  47. /**
  48. * @var Request
  49. */
  50. private $request;
  51. /**
  52. * @var OperationInterface[]
  53. */
  54. private $operations;
  55. /**
  56. * Constructor.
  57. *
  58. * @param string $eventName
  59. * @param Composer $composer
  60. * @param IOInterface $io
  61. * @param PolicyInterface $policy
  62. * @param Pool $pool
  63. * @param CompositeRepository $installedRepo
  64. * @param Request $request
  65. * @param OperationInterface[] $operations
  66. */
  67. public function __construct($eventName, Composer $composer, IOInterface $io, PolicyInterface $policy, Pool $pool, CompositeRepository $installedRepo, Request $request, array $operations = array())
  68. {
  69. parent::__construct($eventName);
  70. $this->composer = $composer;
  71. $this->io = $io;
  72. $this->policy = $policy;
  73. $this->pool = $pool;
  74. $this->installedRepo = $installedRepo;
  75. $this->request = $request;
  76. $this->operations = $operations;
  77. }
  78. /**
  79. * @return Composer
  80. */
  81. public function getComposer()
  82. {
  83. return $this->composer;
  84. }
  85. /**
  86. * @return IOInterface
  87. */
  88. public function getIO()
  89. {
  90. return $this->io;
  91. }
  92. /**
  93. * @return PolicyInterface
  94. */
  95. public function getPolicy()
  96. {
  97. return $this->policy;
  98. }
  99. /**
  100. * @return Pool
  101. */
  102. public function getPool()
  103. {
  104. return $this->pool;
  105. }
  106. /**
  107. * @return CompositeRepository
  108. */
  109. public function getInstalledRepo()
  110. {
  111. return $this->installedRepo;
  112. }
  113. /**
  114. * @return Request
  115. */
  116. public function getRequest()
  117. {
  118. return $this->request;
  119. }
  120. /**
  121. * @return OperationInterface[]
  122. */
  123. public function getOperations()
  124. {
  125. return $this->operations;
  126. }
  127. }