forked from composer/composer
-
Notifications
You must be signed in to change notification settings - Fork 2
/
RootPackageInterface.php
228 lines (201 loc) · 5.4 KB
/
RootPackageInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
<?php declare(strict_types=1);
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Package;
use Composer\Semver\Constraint\ConstraintInterface;
/**
* Defines additional fields that are only needed for the root package
*
* PackageInterface & derivatives are considered internal, you may use them in type hints but extending/implementing them is not recommended and not supported. Things may change without notice.
*
* @author Jordi Boggiano <j.boggiano@seld.be>
*
* @phpstan-import-type AutoloadRules from PackageInterface
* @phpstan-import-type DevAutoloadRules from PackageInterface
*/
interface RootPackageInterface extends CompletePackageInterface
{
/**
* Returns a set of package names and their aliases
*
* @return array<array{package: string, version: string, alias: string, alias_normalized: string}>
*/
public function getAliases(): array;
/**
* Returns the minimum stability of the package
*
* @return string
*/
public function getMinimumStability(): string;
/**
* Returns the stability flags to apply to dependencies
*
* array('foo/bar' => 'dev')
*
* @return array<string, BasePackage::STABILITY_*>
*/
public function getStabilityFlags(): array;
/**
* Returns a set of package names and source references that must be enforced on them
*
* array('foo/bar' => 'abcd1234')
*
* @return array<string, string>
*/
public function getReferences(): array;
/**
* Returns true if the root package prefers picking stable packages over unstable ones
*
* @return bool
*/
public function getPreferStable(): bool;
/**
* Returns the root package's configuration
*
* @return mixed[]
*/
public function getConfig(): array;
/**
* Set the required packages
*
* @param Link[] $requires A set of package links
*
* @return void
*/
public function setRequires(array $requires): void;
/**
* Set the recommended packages
*
* @param Link[] $devRequires A set of package links
*
* @return void
*/
public function setDevRequires(array $devRequires): void;
/**
* Set the conflicting packages
*
* @param Link[] $conflicts A set of package links
*
* @return void
*/
public function setConflicts(array $conflicts): void;
/**
* Set the provided virtual packages
*
* @param Link[] $provides A set of package links
*
* @return void
*/
public function setProvides(array $provides): void;
/**
* Set the packages this one replaces
*
* @param Link[] $replaces A set of package links
*
* @return void
*/
public function setReplaces(array $replaces): void;
/**
* Set the repositories
*
* @param mixed[] $repositories
*
* @return void
*/
public function setRepositories(array $repositories): void;
/**
* Set the autoload mapping
*
* @param array $autoload Mapping of autoloading rules
* @phpstan-param AutoloadRules $autoload
*
* @return void
*/
public function setAutoload(array $autoload): void;
/**
* Set the dev autoload mapping
*
* @param array $devAutoload Mapping of dev autoloading rules
* @phpstan-param DevAutoloadRules $devAutoload
*
* @return void
*/
public function setDevAutoload(array $devAutoload): void;
/**
* Set the stabilityFlags
*
* @param array<string, BasePackage::STABILITY_*> $stabilityFlags
*
* @return void
*/
public function setStabilityFlags(array $stabilityFlags): void;
/**
* Set the minimumStability
*
* @param string $minimumStability
*
* @return void
*/
public function setMinimumStability(string $minimumStability): void;
/**
* Set the preferStable
*
* @param bool $preferStable
*
* @return void
*/
public function setPreferStable(bool $preferStable): void;
/**
* Set the config
*
* @param mixed[] $config
*
* @return void
*/
public function setConfig(array $config): void;
/**
* Set the references
*
* @param array<string, string> $references
*
* @return void
*/
public function setReferences(array $references): void;
/**
* Set the aliases
*
* @param array<array{package: string, version: string, alias: string, alias_normalized: string}> $aliases
*
* @return void
*/
public function setAliases(array $aliases): void;
/**
* Set the suggested packages
*
* @param array<string, string> $suggests A set of package names/comments
*
* @return void
*/
public function setSuggests(array $suggests): void;
/**
* @param mixed[] $extra
*
* @return void
*/
public function setExtra(array $extra): void;
/**
* @return array<string, ConstraintInterface>
*/
public function getTemporaryConstraints(): array;
/**
* @param array<string, ConstraintInterface> $constraints
*/
public function setTemporaryConstraints(array $constraints): void;
}