1<?php
2
3/*
4 * This file is part of Composer.
5 *
6 * (c) Nils Adermann <naderman@naderman.de>
7 *     Jordi Boggiano <j.boggiano@seld.be>
8 *
9 * For the full copyright and license information, please view the LICENSE
10 * file that was distributed with this source code.
11 */
12
13namespace Composer\Package;
14
15/**
16 * Defines additional fields that are only needed for the root package
17 *
18 * @author Jordi Boggiano <j.boggiano@seld.be>
19 */
20interface RootPackageInterface extends CompletePackageInterface
21{
22    /**
23     * Returns a set of package names and their aliases
24     *
25     * @return array
26     */
27    public function getAliases();
28
29    /**
30     * Returns the minimum stability of the package
31     *
32     * @return string
33     */
34    public function getMinimumStability();
35
36    /**
37     * Returns the stability flags to apply to dependencies
38     *
39     * array('foo/bar' => 'dev')
40     *
41     * @return array
42     */
43    public function getStabilityFlags();
44
45    /**
46     * Returns a set of package names and source references that must be enforced on them
47     *
48     * array('foo/bar' => 'abcd1234')
49     *
50     * @return array
51     */
52    public function getReferences();
53
54    /**
55     * Returns true if the root package prefers picking stable packages over unstable ones
56     *
57     * @return bool
58     */
59    public function getPreferStable();
60
61    /**
62     * Returns the root package's configuration
63     *
64     * @return array
65     */
66    public function getConfig();
67
68    /**
69     * Set the required packages
70     *
71     * @param Link[] $requires A set of package links
72     */
73    public function setRequires(array $requires);
74
75    /**
76     * Set the recommended packages
77     *
78     * @param Link[] $devRequires A set of package links
79     */
80    public function setDevRequires(array $devRequires);
81
82    /**
83     * Set the conflicting packages
84     *
85     * @param Link[] $conflicts A set of package links
86     */
87    public function setConflicts(array $conflicts);
88
89    /**
90     * Set the provided virtual packages
91     *
92     * @param Link[] $provides A set of package links
93     */
94    public function setProvides(array $provides);
95
96    /**
97     * Set the packages this one replaces
98     *
99     * @param Link[] $replaces A set of package links
100     */
101    public function setReplaces(array $replaces);
102
103    /**
104     * Set the repositories
105     *
106     * @param array $repositories
107     */
108    public function setRepositories($repositories);
109
110    /**
111     * Set the autoload mapping
112     *
113     * @param array $autoload Mapping of autoloading rules
114     */
115    public function setAutoload(array $autoload);
116
117    /**
118     * Set the dev autoload mapping
119     *
120     * @param array $devAutoload Mapping of dev autoloading rules
121     */
122    public function setDevAutoload(array $devAutoload);
123
124    /**
125     * Set the stabilityFlags
126     *
127     * @param array $stabilityFlags
128     */
129    public function setStabilityFlags(array $stabilityFlags);
130
131    /**
132     * Set the suggested packages
133     *
134     * @param array $suggests A set of package names/comments
135     */
136    public function setSuggests(array $suggests);
137
138    /**
139     * @param array $extra
140     */
141    public function setExtra(array $extra);
142}
143