8000 [Routing] Fix ContainerLoader and ObjectLoaderTest · symfony/symfony@5147ee2 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5147ee2

Browse files
committed
[Routing] Fix ContainerLoader and ObjectLoaderTest
1 parent 15f7ea1 commit 5147ee2

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

src/Symfony/Component/Routing/Loader/ContainerLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function __construct(ContainerInterface $container)
3030
/**
3131
* {@inheritdoc}
3232
*/
33-
public function supports($resource, $type = null)
33+
public function supports($resource, string $type = null)
3434
{
3535
return 'service' === $type;
3636
}

src/Symfony/Component/Routing/Loader/ObjectLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function load($resource, string $type = null)
5252
$loaderObject = $this->getObject($parts[0]);
5353

5454
if (!\is_object($loaderObject)) {
55-
throw new \LogicException(sprintf('%s:getObject() must return an object: %s returned', \get_class($this), \gettype($loaderObject)));
55+
throw new \TypeError(sprintf('%s:getObject() must return an object: %s returned', \get_class($this), \gettype($loaderObject)));
5656
}
5757

5858
if (!\is_callable([$loaderObject, $method])) {

src/Symfony/Component/Routing/Tests/Loader/ObjectLoaderTest.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,10 @@ public function getBadResourceStrings()
6161
['::Foo'],
6262
];
6363
}
64-
65-
/**
66-
* @group legacy
67-
*/
64+
:qgit
6865
public function testExceptionOnNoObjectReturned()
6966
{
70-
$this->expectException('LogicException');
67+
$this->expectException(\TypeError::class);
7168
$loader = new TestObjectLoader();
7269
$loader->loaderMap = ['my_service' => 'NOT_AN_OBJECT'];
7370
$loader->load('my_service::method');

0 commit comments

Comments
 (0)
0