Skip to content

Commit a8a5f45

Browse files
Backport type fixes
1 parent 8254f77 commit a8a5f45

File tree

5 files changed

+8
-51
lines changed

5 files changed

+8
-51
lines changed

Annotation/Route.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public function __construct(
132132
}
133133
}
134134

135-
public function setPath($path)
135+
public function setPath(string $path)
136136
{
137137
$this->path = $path;
138138
}
@@ -152,7 +152,7 @@ public function getLocalizedPaths(): array
152152
return $this->localizedPaths;
153153
}
154154

155-
public function setHost($pattern)
155+
public function setHost(string $pattern)
156156
{
157157
$this->host = $pattern;
158158
}
@@ -162,7 +162,7 @@ public function getHost()
162162
return $this->host;
163163
}
164164

165-
public function setName($name)
165+
public function setName(string $name)
166166
{
167167
$this->name = $name;
168168
}
@@ -172,7 +172,7 @@ public function getName()
172172
return $this->name;
173173
}
174174

175-
public function setRequirements($requirements)
175+
public function setRequirements(array $requirements)
176176
{
177177
$this->requirements = $requirements;
178178
}
@@ -182,7 +182,7 @@ public function getRequirements()
182182
return $this->requirements;
183183
}
184184

185-
public function setOptions($options)
185+
public function setOptions(array $options)
186186
{
187187
$this->options = $options;
188188
}
@@ -192,7 +192,7 @@ public function getOptions()
192192
return $this->options;
193193
}
194194

195-
public function setDefaults($defaults)
195+
public function setDefaults(array $defaults)
196196
{
197197
$this->defaults = $defaults;
198198
}
@@ -222,7 +222,7 @@ public function getMethods()
222222
return $this->methods;
223223
}
224224

225-
public function setCondition($condition)
225+
public function setCondition(?string $condition)
226226
{
227227
$this->condition = $condition;
228228
}

Loader/Configurator/RouteConfigurator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class RouteConfigurator
2424

2525
protected $parentConfigurator;
2626

27-
public function __construct(RouteCollection $collection, $route, string $name = '', CollectionConfigurator $parentConfigurator = null, array $prefixes = null)
27+
public function __construct(RouteCollection $collection, RouteCollection $route, string $name = '', CollectionConfigurator $parentConfigurator = null, array $prefixes = null)
2828
{
2929
$this->collection = $collection;
3030
$this->route = $route;

Loader/XmlFileLoader.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,6 @@ public function load($file, string $type = null)
6969
/**
7070
* Parses a node from a loaded XML file.
7171
*
72-
* @param \DOMElement $node Element to parse
73-
* @param string $path Full path of the XML file being processed
74-
* @param string $file Loaded file name
75-
*
7672
* @throws \InvalidArgumentException When the XML is invalid
7773
*/
7874
protected function parseNode(RouteCollection $collection, \DOMElement $node, string $path, string $file)
@@ -104,9 +100,6 @@ public function supports($resource, string $type = null)
104100
/**
105101
* Parses a route and adds it to the RouteCollection.
106102
*
107-
* @param \DOMElement $node Element to parse that represents a Route
108-
* @param string $path Full path of the XML file being processed
109-
*
110103
* @throws \InvalidArgumentException When the XML is invalid
111104
*/
112105
protected function parseRoute(RouteCollection $collection, \DOMElement $node, string $path)
@@ -144,10 +137,6 @@ protected function parseRoute(RouteCollection $collection, \DOMElement $node, st
144137
/**
145138
* Parses an import and adds the routes in the resource to the RouteCollection.
146139
*
147-
* @param \DOMElement $node Element to parse that represents a Route
148-
* @param string $path Full path of the XML file being processed
149-
* @param string $file Loaded file name
150-
*
151140
* @throws \InvalidArgumentException When the XML is invalid
152141
*/
153142
protected function parseImport(RouteCollection $collection, \DOMElement $node, string $path, string $file)
@@ -220,10 +209,6 @@ protected function parseImport(RouteCollection $collection, \DOMElement $node, s
220209
}
221210

222211
/**
223-
* Loads an XML file.
224-
*
225-
* @param string $file An XML file path
226-
*
227212
* @return \DOMDocument
228213
*
229214
* @throws \InvalidArgumentException When loading of XML file fails because of syntax errors

Loader/YamlFileLoader.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,6 @@ public function supports($resource, string $type = null)
106106

107107
/**
108108
* Parses a route and adds it to the RouteCollection.
109-
*
110-
* @param string $name Route name
111-
* @param array $config Route definition
112-
* @param string $path Full path of the YAML file being processed
113109
*/
114110
protected function parseRoute(RouteCollection $collection, string $name, array $config, string $path)
115111
{
@@ -154,10 +150,6 @@ protected function parseRoute(RouteCollection $collection, string $name, array $
154150

155151
/**
156152
* Parses an import and adds the routes in the resource to the RouteCollection.
157-
*
158-
* @param array $config Route definition
159-
* @param string $path Full path of the YAML file being processed
160-
* @param string $file Loaded file name
161153
*/
162154
protected function parseImport(RouteCollection $collection, array $config, string $path, string $file)
163155
{

Route.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,6 @@ public function getPath()
120120
}
121121

122122
/**
123-
* Sets the pattern for the path.
124-
*
125123
* @return $this
126124
*/
127125
public function setPath(string $pattern)
@@ -145,8 +143,6 @@ public function getHost()
145143
}
146144

147145
/**
148-
* Sets the pattern for the host.
149-
*
150146
* @return $this
151147
*/
152148
public function setHost(?string $pattern)
@@ -270,8 +266,6 @@ public function setOption(string $name, $value)
270266
}
271267

272268
/**
273-
* Get an option value.
274-
*
275269
* @return mixed The option value or null when not given
276270
*/
277271
public function getOption(string $name)
@@ -280,8 +274,6 @@ public function getOption(string $name)
280274
}
281275

282276
/**
283-
* Checks if an option has been set.
284-
*
285277
* @return bool true if the option is set, false otherwise
286278
*/
287279
public function hasOption(string $name)
@@ -325,8 +317,6 @@ public function addDefaults(array $defaults)
325317
}
326318

327319
/**
328-
* Gets a default value.
329-
*
330320
* @return mixed The default value or null when not given
331321
*/
332322
public function getDefault(string $name)
@@ -335,8 +325,6 @@ public function getDefault(string $name)
335325
}
336326

337327
/**
338-
* Checks if a default value is set for the given variable.
339-
*
340328
* @return bool true if the default value is set, false otherwise
341329
*/
342330
public function hasDefault(string $name)
@@ -399,8 +387,6 @@ public function addRequirements(array $requirements)
399387
}
400388

401389
/**
402-
* Returns the requirement for the given key.
403-
*
404390
* @return string|null The regex or null when not given
405391
*/
406392
public function getRequirement(string $key)
@@ -409,8 +395,6 @@ public function getRequirement(string $key)
409395
}
410396

411397
/**
412-
* Checks if a requirement is set for the given key.
413-
*
414398
* @return bool true if a requirement is specified, false otherwise
415399
*/
416400
public function hasRequirement(string $key)
@@ -419,8 +403,6 @@ public function hasRequirement(string $key)
419403
}
420404

421405
/**
422-
* Sets a requirement for the given key.
423-
*
424406
* @return $this
425407
*/
426408
public function setRequirement(string $key, string $regex)
@@ -444,8 +426,6 @@ public function getCondition()
444426
}
445427

446428
/**
447-
* Sets the condition.
448-
*
449429
* @return $this
450430
*/
451431
public function setCondition(?string $condition)

0 commit comments

Comments
 (0)