Skip to content

Commit 3931062

Browse files
committed
cs
1 parent 390fc90 commit 3931062

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/TwigComponent/src/ComponentFactory.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,12 @@ private function mount(object $component, array &$data): void
151151
return;
152152
}
153153

154-
if (!array_key_exists($component::class, self::$mountMethods)) {
154+
if (!\array_key_exists($component::class, self::$mountMethods)) {
155155
try {
156156
$mountMethod = self::$mountMethods[$component::class] = (new \ReflectionClass($component))->getMethod('mount');
157157
} catch (\ReflectionException) {
158158
self::$mountMethods[$component::class] = false;
159+
159160
return;
160161
}
161162
}
@@ -166,14 +167,14 @@ private function mount(object $component, array &$data): void
166167

167168
$parameters = [];
168169
foreach ($mountMethod->getParameters() as $refParameter) {
169-
if (array_key_exists($name = $refParameter->getName(), $data)) {
170+
if (\array_key_exists($name = $refParameter->getName(), $data)) {
170171
$parameters[] = $data[$name];
171172
// remove the data element so it isn't used to set the property directly.
172173
unset($data[$name]);
173174
} elseif ($refParameter->isDefaultValueAvailable()) {
174175
$parameters[] = $refParameter->getDefaultValue();
175176
} else {
176-
throw new \LogicException(\sprintf('%s::mount() has a required $%s parameter. Make sure this is passed or make give a default value.', $component::class, $name));
177+
throw new \LogicException(\sprintf('"%s"::mount() has a required $%s parameter. Make sure this is passed or make give a default value.', $component::class, $name));
177178
}
178179
}
179180

0 commit comments

Comments
 (0)