RootAliasPackage.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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\Package;
  12. /**
  13. * @author Jordi Boggiano <j.boggiano@seld.be>
  14. */
  15. class RootAliasPackage extends AliasPackage implements RootPackageInterface
  16. {
  17. public function __construct(RootPackageInterface $aliasOf, $version, $prettyVersion)
  18. {
  19. parent::__construct($aliasOf, $version, $prettyVersion);
  20. }
  21. /**
  22. * {@inheritDoc}
  23. */
  24. public function getAliases()
  25. {
  26. return $this->aliasOf->getAliases();
  27. }
  28. /**
  29. * {@inheritDoc}
  30. */
  31. public function getMinimumStability()
  32. {
  33. return $this->aliasOf->getMinimumStability();
  34. }
  35. /**
  36. * {@inheritDoc}
  37. */
  38. public function getStabilityFlags()
  39. {
  40. return $this->aliasOf->getStabilityFlags();
  41. }
  42. /**
  43. * {@inheritDoc}
  44. */
  45. public function getReferences()
  46. {
  47. return $this->aliasOf->getReferences();
  48. }
  49. /**
  50. * {@inheritDoc}
  51. */
  52. public function getPreferStable()
  53. {
  54. return $this->aliasOf->getPreferStable();
  55. }
  56. /**
  57. * {@inheritDoc}
  58. */
  59. public function getConfig()
  60. {
  61. return $this->aliasOf->getConfig();
  62. }
  63. /**
  64. * {@inheritDoc}
  65. */
  66. public function setRequires(array $require)
  67. {
  68. $this->requires = $this->replaceSelfVersionDependencies($require, 'requires');
  69. $this->aliasOf->setRequires($require);
  70. }
  71. /**
  72. * {@inheritDoc}
  73. */
  74. public function setDevRequires(array $devRequire)
  75. {
  76. $this->devRequires = $this->replaceSelfVersionDependencies($devRequire, 'devRequires');
  77. $this->aliasOf->setDevRequires($devRequire);
  78. }
  79. /**
  80. * {@inheritDoc}
  81. */
  82. public function setConflicts(array $conflicts)
  83. {
  84. $this->conflicts = $this->replaceSelfVersionDependencies($conflicts, 'conflicts');
  85. $this->aliasOf->setConflicts($conflicts);
  86. }
  87. /**
  88. * {@inheritDoc}
  89. */
  90. public function setProvides(array $provides)
  91. {
  92. $this->provides = $this->replaceSelfVersionDependencies($provides, 'provides');
  93. $this->aliasOf->setProvides($provides);
  94. }
  95. /**
  96. * {@inheritDoc}
  97. */
  98. public function setReplaces(array $replaces)
  99. {
  100. $this->replaces = $this->replaceSelfVersionDependencies($replaces, 'replaces');
  101. $this->aliasOf->setReplaces($replaces);
  102. }
  103. /**
  104. * {@inheritDoc}
  105. */
  106. public function setRepositories($repositories)
  107. {
  108. $this->aliasOf->setRepositories($repositories);
  109. }
  110. /**
  111. * {@inheritDoc}
  112. */
  113. public function setAutoload(array $autoload)
  114. {
  115. $this->aliasOf->setAutoload($autoload);
  116. }
  117. /**
  118. * {@inheritDoc}
  119. */
  120. public function setDevAutoload(array $devAutoload)
  121. {
  122. $this->aliasOf->setDevAutoload($devAutoload);
  123. }
  124. /**
  125. * {@inheritDoc}
  126. */
  127. public function setStabilityFlags(array $stabilityFlags)
  128. {
  129. $this->aliasOf->setStabilityFlags($stabilityFlags);
  130. }
  131. /**
  132. * {@inheritDoc}
  133. */
  134. public function setSuggests(array $suggests)
  135. {
  136. $this->aliasOf->setSuggests($suggests);
  137. }
  138. /**
  139. * {@inheritDoc}
  140. */
  141. public function setExtra(array $extra)
  142. {
  143. $this->aliasOf->setExtra($extra);
  144. }
  145. public function __clone()
  146. {
  147. parent::__clone();
  148. $this->aliasOf = clone $this->aliasOf;
  149. }
  150. }