1 | <?php namespace nyx\console\output\formatting\styles; |
||
24 | class Map extends collections\Collection |
||
25 | { |
||
26 | /** |
||
27 | * The traits of a Styles Map. |
||
28 | */ |
||
29 | use collections\traits\Collection; |
||
30 | |||
31 | /** |
||
32 | * Returns a Style identified by its name. |
||
33 | * |
||
34 | * @param string $name The name of the Style to return. |
||
35 | * @param mixed $default The default value to return when the given Style does not exist in the Collection. |
||
36 | * @return interfaces\Style The Style or the default value given if the Style couldn't be found. |
||
37 | */ |
||
38 | public function get(string $name, $default = null) : ?interfaces\Style |
||
42 | |||
43 | /** |
||
44 | * Sets the given Style in the Collection. |
||
45 | * |
||
46 | * @param string $name The name the Style should be set as. |
||
47 | * @param mixed $value The Style to set. |
||
|
|||
48 | * @return $this |
||
49 | */ |
||
50 | public function set(string $name, interfaces\Style $style) : Map |
||
56 | |||
57 | /** |
||
58 | * Checks whether the given Style identified by its name exists in the Collection. |
||
59 | * |
||
60 | * @param string $name The name of the Style to check for. |
||
61 | * @return bool True if the Style exists in the Collection, false otherwise. |
||
62 | */ |
||
63 | public function has(string $name) : bool |
||
67 | |||
68 | /** |
||
69 | * Checks whether the given Style exists in the Collection. |
||
70 | * |
||
71 | * @param interfaces\Style $style The Style to search for. |
||
72 | * @return bool True if the Style exists in the Collection, false otherwise. |
||
73 | */ |
||
74 | public function contains(interfaces\Style $style) : bool |
||
78 | |||
79 | /** |
||
80 | * Removes a Style from the Collection by its name. |
||
81 | * |
||
82 | * @param string $name The name of the Style to remove. |
||
83 | * @return $this |
||
84 | */ |
||
85 | public function remove(string $name) : Map |
||
91 | |||
92 | /** |
||
93 | * {@inheritdoc} |
||
94 | */ |
||
95 | public function replace($items) : collections\interfaces\Collection |
||
105 | |||
106 | /** |
||
107 | * Returns the name a given Style is set as within the Collection. |
||
108 | * |
||
109 | * @param interfaces\Style $style The Style to search for. |
||
110 | * @return string The name of the Style or null if it couldn't be found. |
||
111 | */ |
||
112 | public function name(interfaces\Style $style) : ?string |
||
122 | |||
123 | /** |
||
124 | * @see Map::get() |
||
125 | */ |
||
126 | public function __get(string $name) : ?interfaces\Style |
||
130 | |||
131 | /** |
||
132 | * @see Map::set() |
||
133 | */ |
||
134 | public function __set(string $name, interfaces\Style $style) : Map |
||
138 | |||
139 | /** |
||
140 | * @see Map::has() |
||
141 | */ |
||
142 | public function __isset(string $name) : bool |
||
146 | |||
147 | /** |
||
148 | * @see Map::remove() |
||
149 | */ |
||
150 | public function __unset(string $name) : Map |
||
154 | |||
155 | /** |
||
156 | * {@inheritdoc} |
||
157 | */ |
||
158 | public function offsetGet($name) : interfaces\Style |
||
162 | |||
163 | /** |
||
164 | * {@inheritdoc} |
||
165 | */ |
||
166 | public function offsetSet($name, $item) : Map |
||
170 | |||
171 | /** |
||
172 | * {@inheritdoc} |
||
173 | */ |
||
174 | public function offsetExists($name) : bool |
||
178 | |||
179 | /** |
||
180 | * {@inheritdoc} |
||
181 | */ |
||
182 | public function offsetUnset($name) : Map |
||
186 | } |
||
187 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.