/
RootPackage.php
146 lines (127 loc) · 3.18 KB
/
RootPackage.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
<?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;
/**
* The root package represents the project's composer.json and contains additional metadata
*
* @author Jordi Boggiano <j.boggiano@seld.be>
*/
class RootPackage extends CompletePackage implements RootPackageInterface
{
public const DEFAULT_PRETTY_VERSION = '1.0.0+no-version-set';
/** @var string */
protected $minimumStability = 'stable';
/** @var bool */
protected $preferStable = false;
/** @var array<string, BasePackage::STABILITY_*> Map of package name to stability constant */
protected $stabilityFlags = array();
/** @var mixed[] */
protected $config = array();
/** @var array<string, string> Map of package name to reference/commit hash */
protected $references = array();
/** @var array<array{package: string, version: string, alias: string, alias_normalized: string}> */
protected $aliases = array();
/** @var array<string, ConstraintInterface> */
protected $temporaryConstraints = [];
public function setTemporaryConstraints(array $constraints): void
{
$this->temporaryConstraints = $constraints;
}
public function getTemporaryConstraints(): array
{
return $this->temporaryConstraints;
}
/**
* @inheritDoc
*/
public function setMinimumStability(string $minimumStability): void
{
$this->minimumStability = $minimumStability;
}
/**
* @inheritDoc
*/
public function getMinimumStability(): string
{
return $this->minimumStability;
}
/**
* @inheritDoc
*/
public function setStabilityFlags(array $stabilityFlags): void
{
$this->stabilityFlags = $stabilityFlags;
}
/**
* @inheritDoc
*/
public function getStabilityFlags(): array
{
return $this->stabilityFlags;
}
/**
* @inheritDoc
*/
public function setPreferStable(bool $preferStable): void
{
$this->preferStable = $preferStable;
}
/**
* @inheritDoc
*/
public function getPreferStable(): bool
{
return $this->preferStable;
}
/**
* @inheritDoc
*/
public function setConfig(array $config): void
{
$this->config = $config;
}
/**
* @inheritDoc
*/
public function getConfig(): array
{
return $this->config;
}
/**
* @inheritDoc
*/
public function setReferences(array $references): void
{
$this->references = $references;
}
/**
* @inheritDoc
*/
public function getReferences(): array
{
return $this->references;
}
/**
* @inheritDoc
*/
public function setAliases(array $aliases): void
{
$this->aliases = $aliases;
}
/**
* @inheritDoc
*/
public function getAliases(): array
{
return $this->aliases;
}
}