Skip to content

Commit 86dc57a

Browse files
Fixed layout registration argument checkup. References #90. References #265
1 parent 7aaacf9 commit 86dc57a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Flexible.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,11 @@ public function confirmRemove($label = '', $yes = 'Delete', $no = 'Cancel')
144144
*/
145145
public function resolver($resolver)
146146
{
147-
if (is_string($resolver) && is_a($resolver, ResolverInterface::class, true)) {
147+
if(is_string($resolver) && is_a($resolver, ResolverInterface::class, true)) {
148148
$resolver = new $resolver();
149149
}
150150

151-
if(!($resolver instanceof ResolverInterface)) {
151+
if(! ($resolver instanceof ResolverInterface)) {
152152
throw new \Exception('Resolver Class "' . get_class($resolver) . '" does not implement ResolverInterface.');
153153
}
154154

@@ -182,12 +182,12 @@ public function addLayout(...$arguments)
182182
}
183183

184184
$layout = $arguments[0];
185-
186-
if(!($layout instanceof LayoutInterface)) {
185+
186+
if(is_string($layout) && is_a($layout, LayoutInterface::class, true)) {
187187
$layout = new $layout();
188188
}
189189

190-
if(!($layout instanceof LayoutInterface)) {
190+
if(! ($layout instanceof LayoutInterface)) {
191191
throw new \Exception('Layout Class "' . get_class($layout) . '" does not implement LayoutInterface.');
192192
}
193193

0 commit comments

Comments
 (0)