Skip to content

Commit 60fad94

Browse files
Merge branch '4.4'
* 4.4: Fixed tests on the Security and Form components Add return types to tests and final|internal|private methods
2 parents 216f0b4 + 9357949 commit 60fad94

File tree

6 files changed

+8
-7
lines changed

6 files changed

+8
-7
lines changed

Tests/Fixtures/CustomRouteCompiler.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Routing\Tests\Fixtures;
1313

14+
use Symfony\Component\Routing\CompiledRoute;
1415
use Symfony\Component\Routing\Route;
1516
use Symfony\Component\Routing\RouteCompiler;
1617

@@ -19,7 +20,7 @@ class CustomRouteCompiler extends RouteCompiler
1920
/**
2021
* {@inheritdoc}
2122
*/
22-
public static function compile(Route $route)
23+
public static function compile(Route $route): CompiledRoute
2324
{
2425
return new CustomCompiledRoute('', '', [], []);
2526
}

Tests/Fixtures/CustomXmlFileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
class CustomXmlFileLoader extends XmlFileLoader
2121
{
22-
protected function loadFile(string $file)
22+
protected function loadFile(string $file): \DOMDocument
2323
{
2424
return XmlUtils::loadFile($file, function () { return true; });
2525
}

Tests/Fixtures/RedirectableUrlMatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
class RedirectableUrlMatcher extends UrlMatcher implements RedirectableUrlMatcherInterface
2121
{
22-
public function redirect(string $path, string $route, string $scheme = null)
22+
public function redirect(string $path, string $route, string $scheme = null): array
2323
{
2424
return [
2525
'_controller' => 'Some controller reference...',

Tests/Loader/ObjectLoaderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,12 @@ class TestObjectLoader extends ObjectLoader
9898
{
9999
public $loaderMap = [];
100100

101-
public function supports($resource, string $type = null)
101+
public function supports($resource, string $type = null): bool
102102
{
103103
return 'service';
104104
}
105105

106-
protected function getObject(string $id)
106+
protected function getObject(string $id): ?object
107107
{
108108
return $this->loaderMap[$id] ?? null;
109109
}

Tests/Matcher/CompiledRedirectableUrlMatcherTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ protected function getUrlMatcher(RouteCollection $routes, RequestContext $contex
3333

3434
class TestCompiledRedirectableUrlMatcher extends CompiledUrlMatcher implements RedirectableUrlMatcherInterface
3535
{
36-
public function redirect(string $path, string $route, string $scheme = null)
36+
public function redirect(string $path, string $route, string $scheme = null): array
3737
{
3838
return [];
3939
}

Tests/Matcher/Dumper/CompiledUrlMatcherDumperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ public function testGenerateDumperMatcherWithObject()
487487

488488
class TestCompiledUrlMatcher extends CompiledUrlMatcher implements RedirectableUrlMatcherInterface
489489
{
490-
public function redirect(string $path, string $route, string $scheme = null)
490+
public function redirect(string $path, string $route, string $scheme = null): array
491491
{
492492
return [];
493493
}

0 commit comments

Comments
 (0)