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

Commit bc75c3d

Browse files
committed
Use splat operator
- Updated instantiation to use splat operator instead of reflection - switch from array_key_exists to isset Both per @snapshotpl
1 parent dd34bad commit bc75c3d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Controller/LazyControllerAbstractFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public function __invoke(ContainerInterface $container, $requestedName, array $o
134134
}
135135

136136
$type = $parameter->getClass()->getName();
137-
$type = array_key_exists($type, $this->aliases) ? $this->aliases[$type] : $type;
137+
$type = isset($this->aliases[$type]) ? $this->aliases[$type] : $type;
138138

139139
if (! $container->has($type)) {
140140
throw new ServiceNotFoundException(sprintf(
@@ -148,7 +148,7 @@ public function __invoke(ContainerInterface $container, $requestedName, array $o
148148
$parameters[] = $container->get($type);
149149
}
150150

151-
return $reflectionClass->newInstanceArgs($parameters);
151+
return new $requestedName(...$parameters);
152152
}
153153

154154
/**

0 commit comments

Comments
 (0)