Skip to content

Commit f5c198c

Browse files
Merge branch '5.2' into 5.3
* 5.2: Backport type fixes Fix CS Avoid triggering the autoloader in Deprecation::isLegacy() fix markdown markup Backport type fixes uzb translation [DependencyInjection] Fix doc blocks [DependencyInjection] Turn $defaultDeprecationTemplate into a constant [Form] better form doc types to support static analysis
2 parents 368e813 + a8a5f45 commit f5c198c

File tree

8 files changed

+10
-112
lines changed

8 files changed

+10
-112
lines changed

Annotation/Route.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public function __construct(
150150
}
151151
}
152152

153-
public function setPath($path)
153+
public function setPath(string $path)
154154
{
155155
$this->path = $path;
156156
}
@@ -170,7 +170,7 @@ public function getLocalizedPaths(): array
170170
return $this->localizedPaths;
171171
}
172172

173-
public function setHost($pattern)
173+
public function setHost(string $pattern)
174174
{
175175
$this->host = $pattern;
176176
}
@@ -180,7 +180,7 @@ public function getHost()
180180
return $this->host;
181181
}
182182

183-
public function setName($name)
183+
public function setName(string $name)
184184
{
185185
$this->name = $name;
186186
}
@@ -190,7 +190,7 @@ public function getName()
190190
return $this->name;
191191
}
192192

193-
public function setRequirements($requirements)
193+
public function setRequirements(array $requirements)
194194
{
195195
$this->requirements = $requirements;
196196
}
@@ -200,7 +200,7 @@ public function getRequirements()
200200
return $this->requirements;
201201
}
202202

203-
public function setOptions($options)
203+
public function setOptions(array $options)
204204
{
205205
$this->options = $options;
206206
}
@@ -210,7 +210,7 @@ public function getOptions()
210210
return $this->options;
211211
}
212212

213-
public function setDefaults($defaults)
213+
public function setDefaults(array $defaults)
214214
{
215215
$this->defaults = $defaults;
216216
}
@@ -240,7 +240,7 @@ public function getMethods()
240240
return $this->methods;
241241
}
242242

243-
public function setCondition($condition)
243+
public function setCondition(?string $condition)
244244
{
245245
$this->condition = $condition;
246246
}

Loader/AnnotationFileLoader.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ class AnnotationFileLoader extends FileLoader
2626
{
2727
protected $loader;
2828

29-
/**
30-
* @throws \RuntimeException
31-
*/
3229
public function __construct(FileLocatorInterface $locator, AnnotationClassLoader $loader)
3330
{
3431
if (!\function_exists('token_get_all')) {

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/ContainerLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function __construct(ContainerInterface $container, string $env = null)
3333
*/
3434
public function supports($resource, string $type = null)
3535
{
36-
return 'service' === $type;
36+
return 'service' === $type && \is_string($resource);
3737
}
3838

3939
/**

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)
@@ -114,9 +110,6 @@ public function supports($resource, string $type = null)
114110
/**
115111
* Parses a route and adds it to the RouteCollection.
116112
*
117-
* @param \DOMElement $node Element to parse that represents a Route
118-
* @param string $path Full path of the XML file being processed
119-
*
120113
* @throws \InvalidArgumentException When the XML is invalid
121114
*/
122115
protected function parseRoute(RouteCollection $collection, \DOMElement $node, string $path)
@@ -154,10 +147,6 @@ protected function parseRoute(RouteCollection $collection, \DOMElement $node, st
154147
/**
155148
* Parses an import and adds the routes in the resource to the RouteCollection.
156149
*
157-
* @param \DOMElement $node Element to parse that represents a Route
158-
* @param string $path Full path of the XML file being processed
159-
* @param string $file Loaded file name
160-
*
161150
* @throws \InvalidArgumentException When the XML is invalid
162151
*/
163152
protected function parseImport(RouteCollection $collection, \DOMElement $node, string $path, string $file)
@@ -230,10 +219,6 @@ protected function parseImport(RouteCollection $collection, \DOMElement $node, s
230219
}
231220

232221
/**
233-
* Loads an XML file.
234-
*
235-
* @param string $file An XML file path
236-
*
237222
* @return \DOMDocument
238223
*
239224
* @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
@@ -124,10 +124,6 @@ public function supports($resource, string $type = null)
124124

125125
/**
126126
* Parses a route and adds it to the RouteCollection.
127-
*
128-
* @param string $name Route name
129-
* @param array $config Route definition
130-
* @param string $path Full path of the YAML file being processed
131127
*/
132128
protected function parseRoute(RouteCollection $collection, string $name, array $config, string $path)
133129
{
@@ -172,10 +168,6 @@ protected function parseRoute(RouteCollection $collection, string $name, array $
172168

173169
/**
174170
* Parses an import and adds the routes in the resource to the RouteCollection.
175-
*
176-
* @param array $config Route definition
177-
* @param string $path Full path of the YAML file being processed
178-
* @param string $file Loaded file name
179171
*/
180172
protected function parseImport(RouteCollection $collection, array $config, string $path, string $file)
181173
{

Matcher/Dumper/StaticPrefixCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ private function getCommonPrefix(string $prefix, string $anotherPrefix): array
195195
return [substr($prefix, 0, $i), substr($prefix, 0, $staticLength ?? $i)];
196196
}
197197

198-
public static function handleError($type, $msg)
198+
public static function handleError(int $type, string $msg)
199199
{
200200
return false !== strpos($msg, 'Compilation failed: lookbehind assertion is not fixed length');
201201
}

0 commit comments

Comments
 (0)