InstallerEvent.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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\Request;
  16. use Composer\EventDispatcher\Event;
  17. use Composer\IO\IOInterface;
  18. use Composer\Repository\RepositoryInterface;
  19. use Composer\Repository\RepositorySet;
  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 bool
  37. */
  38. private $devMode;
  39. /**
  40. * @var PolicyInterface
  41. */
  42. private $policy;
  43. /**
  44. * @var RepositorySet
  45. */
  46. private $repositorySet;
  47. /**
  48. * @var RepositoryInterface
  49. */
  50. private $localRepo;
  51. /**
  52. * @var Request
  53. */
  54. private $request;
  55. /**
  56. * @var OperationInterface[]
  57. */
  58. private $operations;
  59. /**
  60. * Constructor.
  61. *
  62. * @param string $eventName
  63. * @param Composer $composer
  64. * @param IOInterface $io
  65. * @param bool $devMode
  66. * @param PolicyInterface $policy
  67. * @param RepositorySet $repositorySet
  68. * @param RepositoryInterface $localRepo
  69. * @param Request $request
  70. * @param OperationInterface[] $operations
  71. */
  72. public function __construct($eventName, Composer $composer, IOInterface $io, $devMode, PolicyInterface $policy, RepositorySet $repositorySet, RepositoryInterface $localRepo, Request $request, array $operations = array())
  73. {
  74. parent::__construct($eventName);
  75. $this->composer = $composer;
  76. $this->io = $io;
  77. $this->devMode = $devMode;
  78. $this->policy = $policy;
  79. $this->repositorySet = $repositorySet;
  80. $this->localRepo = $localRepo;
  81. $this->request = $request;
  82. $this->operations = $operations;
  83. }
  84. /**
  85. * @return Composer
  86. */
  87. public function getComposer()
  88. {
  89. return $this->composer;
  90. }
  91. /**
  92. * @return IOInterface
  93. */
  94. public function getIO()
  95. {
  96. return $this->io;
  97. }
  98. /**
  99. * @return bool
  100. */
  101. public function isDevMode()
  102. {
  103. return $this->devMode;
  104. }
  105. /**
  106. * @return PolicyInterface
  107. */
  108. public function getPolicy()
  109. {
  110. return $this->policy;
  111. }
  112. /**
  113. * @return RepositorySet
  114. */
  115. public function getRepositorySet()
  116. {
  117. return $this->repositorySet;
  118. }
  119. /**
  120. * @return RepositoryInterface
  121. */
  122. public function getLocalRepo()
  123. {
  124. return $this->localRepo;
  125. }
  126. /**
  127. * @return Request
  128. */
  129. public function getRequest()
  130. {
  131. return $this->request;
  132. }
  133. /**
  134. * @return OperationInterface[]
  135. */
  136. public function getOperations()
  137. {
  138. return $this->operations;
  139. }
  140. }