Skip to content

Commit 827f59f

Browse files
committed
Add missing return types
1 parent d4999fe commit 827f59f

File tree

7 files changed

+16
-7
lines changed

7 files changed

+16
-7
lines changed

Loader/AnnotationClassLoader.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,9 @@ protected function createRoute(string $path, array $defaults, array $requirement
358358
return new Route($path, $defaults, $requirements, $options, $host, $schemes, $methods, $condition);
359359
}
360360

361+
/**
362+
* @return void
363+
*/
361364
abstract protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, object $annot);
362365

363366
/**

Matcher/UrlMatcher.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,9 @@ protected function mergeDefaults(array $params, array $defaults): array
255255
return $defaults;
256256
}
257257

258+
/**
259+
* @return ExpressionLanguage
260+
*/
258261
protected function getExpressionLanguage()
259262
{
260263
if (null === $this->expressionLanguage) {

Router.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@ public function getOption(string $key): mixed
178178
return $this->options[$key];
179179
}
180180

181+
/**
182+
* @return RouteCollection
183+
*/
181184
public function getRouteCollection()
182185
{
183186
return $this->collection ??= $this->loader->load($this->resource, $this->options['resource_type']);

Tests/Loader/PhpFileLoaderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ public function testImportAttributesWithPsr4Prefix(string $configFile)
312312
$loader = new PhpFileLoader($locator),
313313
new Psr4DirectoryLoader($locator),
314314
new class() extends AnnotationClassLoader {
315-
protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, object $annot)
315+
protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, object $annot): void
316316
{
317317
$route->setDefault('_controller', $class->getName().'::'.$method->getName());
318318
}
@@ -337,7 +337,7 @@ public function testImportAttributesFromClass()
337337
new LoaderResolver([
338338
$loader = new PhpFileLoader(new FileLocator(\dirname(__DIR__).'/Fixtures')),
339339
new class() extends AnnotationClassLoader {
340-
protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, object $annot)
340+
protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, object $annot): void
341341
{
342342
$route->setDefault('_controller', $class->getName().'::'.$method->getName());
343343
}

Tests/Loader/Psr4DirectoryLoaderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ private function getLoader(): DelegatingLoader
106106
new LoaderResolver([
107107
new Psr4DirectoryLoader($locator),
108108
new class() extends AnnotationClassLoader {
109-
protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, object $annot)
109+
protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, object $annot): void
110110
{
111111
$route->setDefault('_controller', $class->getName().'::'.$method->getName());
112112
}

Tests/Loader/XmlFileLoaderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ public function testImportAttributesWithPsr4Prefix(string $configFile)
607607
$loader = new XmlFileLoader($locator),
608608
new Psr4DirectoryLoader($locator),
609609
new class() extends AnnotationClassLoader {
610-
protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, object $annot)
610+
protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, object $annot): void
611611
{
612612
$route->setDefault('_controller', $class->getName().'::'.$method->getName());
613613
}
@@ -632,7 +632,7 @@ public function testImportAttributesFromClass()
632632
new LoaderResolver([
633633
$loader = new XmlFileLoader(new FileLocator(\dirname(__DIR__).'/Fixtures')),
634634
new class() extends AnnotationClassLoader {
635-
protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, object $annot)
635+
protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, object $annot): void
636636
{
637637
$route->setDefault('_controller', $class->getName().'::'.$method->getName());
638638
}

Tests/Loader/YamlFileLoaderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ public function testImportAttributesWithPsr4Prefix(string $configFile)
473473
$loader = new YamlFileLoader($locator),
474474
new Psr4DirectoryLoader($locator),
475475
new class() extends AnnotationClassLoader {
476-
protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, object $annot)
476+
protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, object $annot): void
477477
{
478478
$route->setDefault('_controller', $class->getName().'::'.$method->getName());
479479
}
@@ -498,7 +498,7 @@ public function testImportAttributesFromClass()
498498
new LoaderResolver([
499499
$loader = new YamlFileLoader(new FileLocator(\dirname(__DIR__).'/Fixtures')),
500500
new class() extends AnnotationClassLoader {
501-
protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, object $annot)
501+
protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, object $annot): void
502502
{
503503
$route->setDefault('_controller', $class->getName().'::'.$method->getName());
504504
}

0 commit comments

Comments
 (0)