RootPackage.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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. * The root package represents the project's composer.json and contains additional metadata
  14. *
  15. * @author Jordi Boggiano <j.boggiano@seld.be>
  16. */
  17. class RootPackage extends CompletePackage implements RootPackageInterface
  18. {
  19. protected $minimumStability = 'stable';
  20. protected $preferStable = false;
  21. protected $stabilityFlags = array();
  22. protected $config = array();
  23. protected $references = array();
  24. protected $aliases = array();
  25. /**
  26. * Set the minimumStability
  27. *
  28. * @param string $minimumStability
  29. */
  30. public function setMinimumStability($minimumStability)
  31. {
  32. $this->minimumStability = $minimumStability;
  33. }
  34. /**
  35. * {@inheritDoc}
  36. */
  37. public function getMinimumStability()
  38. {
  39. return $this->minimumStability;
  40. }
  41. /**
  42. * Set the stabilityFlags
  43. *
  44. * @param array $stabilityFlags
  45. */
  46. public function setStabilityFlags(array $stabilityFlags)
  47. {
  48. $this->stabilityFlags = $stabilityFlags;
  49. }
  50. /**
  51. * {@inheritDoc}
  52. */
  53. public function getStabilityFlags()
  54. {
  55. return $this->stabilityFlags;
  56. }
  57. /**
  58. * Set the preferStable
  59. *
  60. * @param bool $preferStable
  61. */
  62. public function setPreferStable($preferStable)
  63. {
  64. $this->preferStable = $preferStable;
  65. }
  66. /**
  67. * {@inheritDoc}
  68. */
  69. public function getPreferStable()
  70. {
  71. return $this->preferStable;
  72. }
  73. /**
  74. * Set the config
  75. *
  76. * @param array $config
  77. */
  78. public function setConfig(array $config)
  79. {
  80. $this->config = $config;
  81. }
  82. /**
  83. * {@inheritDoc}
  84. */
  85. public function getConfig()
  86. {
  87. return $this->config;
  88. }
  89. /**
  90. * Set the references
  91. *
  92. * @param array $references
  93. */
  94. public function setReferences(array $references)
  95. {
  96. $this->references = $references;
  97. }
  98. /**
  99. * {@inheritDoc}
  100. */
  101. public function getReferences()
  102. {
  103. return $this->references;
  104. }
  105. /**
  106. * Set the aliases
  107. *
  108. * @param array $aliases
  109. */
  110. public function setAliases(array $aliases)
  111. {
  112. $this->aliases = $aliases;
  113. }
  114. /**
  115. * {@inheritDoc}
  116. */
  117. public function getAliases()
  118. {
  119. return $this->aliases;
  120. }
  121. }