RootPackageInterface.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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. * Defines additional fields that are only needed for the root package
  14. *
  15. * @author Jordi Boggiano <j.boggiano@seld.be>
  16. */
  17. interface RootPackageInterface extends CompletePackageInterface
  18. {
  19. /**
  20. * Returns a set of package names and their aliases
  21. *
  22. * @return array
  23. */
  24. public function getAliases();
  25. /**
  26. * Returns the minimum stability of the package
  27. *
  28. * @return string
  29. */
  30. public function getMinimumStability();
  31. /**
  32. * Returns the stability flags to apply to dependencies
  33. *
  34. * array('foo/bar' => 'dev')
  35. *
  36. * @return array
  37. */
  38. public function getStabilityFlags();
  39. /**
  40. * Returns a set of package names and source references that must be enforced on them
  41. *
  42. * array('foo/bar' => 'abcd1234')
  43. *
  44. * @return array
  45. */
  46. public function getReferences();
  47. /**
  48. * Returns true if the root package prefers picking stable packages over unstable ones
  49. *
  50. * @return bool
  51. */
  52. public function getPreferStable();
  53. /**
  54. * Returns the root package's configuration
  55. *
  56. * @return array
  57. */
  58. public function getConfig();
  59. /**
  60. * Set the required packages
  61. *
  62. * @param Link[] $requires A set of package links
  63. */
  64. public function setRequires(array $requires);
  65. /**
  66. * Set the recommended packages
  67. *
  68. * @param Link[] $devRequires A set of package links
  69. */
  70. public function setDevRequires(array $devRequires);
  71. /**
  72. * Set the conflicting packages
  73. *
  74. * @param Link[] $conflicts A set of package links
  75. */
  76. public function setConflicts(array $conflicts);
  77. /**
  78. * Set the provided virtual packages
  79. *
  80. * @param Link[] $provides A set of package links
  81. */
  82. public function setProvides(array $provides);
  83. /**
  84. * Set the packages this one replaces
  85. *
  86. * @param Link[] $replaces A set of package links
  87. */
  88. public function setReplaces(array $replaces);
  89. /**
  90. * Set the repositories
  91. *
  92. * @param array $repositories
  93. */
  94. public function setRepositories($repositories);
  95. /**
  96. * Set the autoload mapping
  97. *
  98. * @param array $autoload Mapping of autoloading rules
  99. */
  100. public function setAutoload(array $autoload);
  101. /**
  102. * Set the dev autoload mapping
  103. *
  104. * @param array $devAutoload Mapping of dev autoloading rules
  105. */
  106. public function setDevAutoload(array $devAutoload);
  107. /**
  108. * Set the stabilityFlags
  109. *
  110. * @param array $stabilityFlags
  111. */
  112. public function setStabilityFlags(array $stabilityFlags);
  113. /**
  114. * Set the suggested packages
  115. *
  116. * @param array $suggests A set of package names/comments
  117. */
  118. public function setSuggests(array $suggests);
  119. /**
  120. * @param array $extra
  121. */
  122. public function setExtra(array $extra);
  123. }