Skip to content

Commit c8ca17a

Browse files
Add return types to internal|final|private methods
1 parent 1b4831b commit c8ca17a

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

Loader/Configurator/CollectionConfigurator.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,8 @@ public function __destruct()
4747

4848
/**
4949
* Creates a sub-collection.
50-
*
51-
* @return self
5250
*/
53-
final public function collection($name = '')
51+
final public function collection($name = ''): self
5452
{
5553
return new self($this->collection, $this->name.$name, $this, $this->prefixes);
5654
}

Loader/Configurator/RoutingConfigurator.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,7 @@ public function __construct(RouteCollection $collection, PhpFileLoader $loader,
3333
$this->file = $file;
3434
}
3535

36-
/**
37-
* @return ImportConfigurator
38-
*/
39-
final public function import($resource, $type = null, $ignoreErrors = false)
36+
final public function import($resource, $type = null, $ignoreErrors = false): ImportConfigurator
4037
{
4138
$this->loader->setCurrentDir(\dirname($this->path));
4239
$imported = $this->loader->import($resource, $type, $ignoreErrors, $this->file);
@@ -52,10 +49,7 @@ final public function import($resource, $type = null, $ignoreErrors = false)
5249
return new ImportConfigurator($this->collection, $mergedCollection);
5350
}
5451

55-
/**
56-
* @return CollectionConfigurator
57-
*/
58-
final public function collection($name = '')
52+
final public function collection($name = ''): CollectionConfigurator
5953
{
6054
return new CollectionConfigurator($this->collection, $name);
6155
}

Tests/Loader/AnnotationClassLoaderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ protected function setUp(): void
4949
{
5050
$reader = new AnnotationReader();
5151
$this->loader = new class($reader) extends AnnotationClassLoader {
52-
protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, $annot)
52+
protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, $annot): void
5353
{
5454
}
5555
};
@@ -241,7 +241,7 @@ public function testInvokableClassMultipleRouteLoad()
241241
->willReturn([])
242242
;
243243
$loader = new class($reader) extends AnnotationClassLoader {
244-
protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, $annot)
244+
protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, $annot): void
245245
{
246246
}
247247
};
@@ -323,7 +323,7 @@ public function testDefaultRouteName()
323323
;
324324

325325
$loader = new class($reader) extends AnnotationClassLoader {
326-
protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, $annot)
326+
protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, $annot): void
327327
{
328328
}
329329
};

0 commit comments

Comments
 (0)