RootAliasPackage.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. * @param array $require
  58. * @return mixed
  59. */
  60. public function setRequires(array $require)
  61. {
  62. $this->requires = $this->replaceSelfVersionDependencies($require, 'requires');
  63. return $this->aliasOf->setRequires($require);
  64. }
  65. /**
  66. * @param array $devRequire
  67. * @return mixed
  68. */
  69. public function setDevRequires(array $devRequire)
  70. {
  71. $this->devRequires = $this->replaceSelfVersionDependencies($devRequire, 'devRequires');
  72. return $this->aliasOf->setDevRequires($devRequire);
  73. }
  74. public function __clone()
  75. {
  76. parent::__clone();
  77. $this->aliasOf = clone $this->aliasOf;
  78. }
  79. }