Skip to content

Commit 2a04883

Browse files
Backport type fixes
1 parent 3a3c2f1 commit 2a04883

File tree

4 files changed

+2
-61
lines changed

4 files changed

+2
-61
lines changed

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

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

3838
/**

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
}

Route.php

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,6 @@ public function unserialize($serialized)
116116
}
117117

118118
/**
119-
* Returns the pattern for the path.
120-
*
121119
* @return string The path pattern
122120
*/
123121
public function getPath()
@@ -128,8 +126,6 @@ public function getPath()
128126
/**
129127
* Sets the pattern for the path.
130128
*
131-
* This method implements a fluent interface.
132-
*
133129
* @param string $pattern The path pattern
134130
*
135131
* @return $this
@@ -158,8 +154,6 @@ public function setPath($pattern)
158154
}
159155

160156
/**
161-
* Returns the pattern for the host.
162-
*
163157
* @return string The host pattern
164158
*/
165159
public function getHost()
@@ -170,8 +164,6 @@ public function getHost()
170164
/**
171165
* Sets the pattern for the host.
172166
*
173-
* This method implements a fluent interface.
174-
*
175167
* @param string $pattern The host pattern
176168
*
177169
* @return $this
@@ -199,8 +191,6 @@ public function getSchemes()
199191
* Sets the schemes (e.g. 'https') this route is restricted to.
200192
* So an empty array means that any scheme is allowed.
201193
*
202-
* This method implements a fluent interface.
203-
*
204194
* @param string|string[] $schemes The scheme or an array of schemes
205195
*
206196
* @return $this
@@ -240,8 +230,6 @@ public function getMethods()
240230
* Sets the HTTP methods (e.g. 'POST') this route is restricted to.
241231
* So an empty array means that any method is allowed.
242232
*
243-
* This method implements a fluent interface.
244-
*
245233
* @param string|string[] $methods The method or an array of methods
246234
*
247235
* @return $this
@@ -255,8 +243,6 @@ public function setMethods($methods)
255243
}
256244

257245
/**
258-
* Returns the options.
259-
*
260246
* @return array The options
261247
*/
262248
public function getOptions()
@@ -265,10 +251,6 @@ public function getOptions()
265251
}
266252

267253
/**
268-
* Sets the options.
269-
*
270-
* This method implements a fluent interface.
271-
*
272254
* @return $this
273255
*/
274256
public function setOptions(array $options)
@@ -281,10 +263,6 @@ public function setOptions(array $options)
281263
}
282264

283265
/**
284-
* Adds options.
285-
*
286-
* This method implements a fluent interface.
287-
*
288266
* @return $this
289267
*/
290268
public function addOptions(array $options)
@@ -300,8 +278,6 @@ public function addOptions(array $options)
300278
/**
301279
* Sets an option value.
302280
*
303-
* This method implements a fluent interface.
304-
*
305281
* @param string $name An option name
306282
* @param mixed $value The option value
307283
*
@@ -340,8 +316,6 @@ public function hasOption($name)
340316
}
341317

342318
/**
343-
* Returns the defaults.
344-
*
345319
* @return array The defaults
346320
*/
347321
public function getDefaults()
@@ -350,12 +324,6 @@ public function getDefaults()
350324
}
351325

352326
/**
353-
* Sets the defaults.
354-
*
355-
* This method implements a fluent interface.
356-
*
357-
* @param array $defaults The defaults
358-
*
359327
* @return $this
360328
*/
361329
public function setDefaults(array $defaults)
@@ -366,12 +334,6 @@ public function setDefaults(array $defaults)
366334
}
367335

368336
/**
369-
* Adds defaults.
370-
*
371-
* This method implements a fluent interface.
372-
*
373-
* @param array $defaults The defaults
374-
*
375337
* @return $this
376338
*/
377339
public function addDefaults(array $defaults)
@@ -433,8 +395,6 @@ public function setDefault($name, $default)
433395
}
434396

435397
/**
436-
* Returns the requirements.
437-
*
438398
* @return array The requirements
439399
*/
440400
public function getRequirements()
@@ -443,12 +403,6 @@ public function getRequirements()
443403
}
444404

445405
/**
446-
* Sets the requirements.
447-
*
448-
* This method implements a fluent interface.
449-
*
450-
* @param array $requirements The requirements
451-
*
452406
* @return $this
453407
*/
454408
public function setRequirements(array $requirements)
@@ -459,12 +413,6 @@ public function setRequirements(array $requirements)
459413
}
460414

461415
/**
462-
* Adds requirements.
463-
*
464-
* This method implements a fluent interface.
465-
*
466-
* @param array $requirements The requirements
467-
*
468416
* @return $this
469417
*/
470418
public function addRequirements(array $requirements)
@@ -526,8 +474,6 @@ public function setRequirement($key, $regex)
526474
}
527475

528476
/**
529-
* Returns the condition.
530-
*
531477
* @return string The condition
532478
*/
533479
public function getCondition()
@@ -538,8 +484,6 @@ public function getCondition()
538484
/**
539485
* Sets the condition.
540486
*
541-
* This method implements a fluent interface.
542-
*
543487
* @param string $condition The condition
544488
*
545489
* @return $this

0 commit comments

Comments
 (0)