Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit e4a813c

Browse files
committed
Remove test for non-string $requestedName
cannot happen with version 3 servicemanager.
1 parent 33c8cc9 commit e4a813c

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

src/Controller/LazyControllerAbstractFactory.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,10 @@ public function __invoke(ContainerInterface $container, $requestedName, array $o
154154
*/
155155
public function canCreate(ContainerInterface $container, $requestedName)
156156
{
157-
if (! is_string($requestedName) || ! class_exists($requestedName)) {
157+
if (! class_exists($requestedName)) {
158158
return false;
159159
}
160160

161-
$implements = class_implements($requestedName);
162-
return in_array(DispatchableInterface::class, $implements, true);
161+
return in_array(DispatchableInterface::class, class_implements($requestedName), true);
163162
}
164163
}

test/Controller/LazyControllerAbstractFactoryTest.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,7 @@ public function setUp()
2323
public function nonClassRequestedNames()
2424
{
2525
return [
26-
'null' => [null],
27-
'true' => [true],
28-
'false' => [false],
29-
'zero' => [0],
30-
'int' => [1],
31-
'zero-float' => [0.0],
32-
'float' => [1.1],
3326
'non-class-string' => ['non-class-string'],
34-
'array' => [['non-class-string']],
35-
'object' => [(object) ['class' => 'non-class-string']],
3627
];
3728
}
3829

0 commit comments

Comments
 (0)