Skip to content

Commit f6372bb

Browse files
Copilotlcharette
andcommitted
Use is_subclass_of pattern for consistency with existing codebase
Co-authored-by: lcharette <2566513+lcharette@users.noreply.github.com>
1 parent 4782717 commit f6372bb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/sprinkle-core/app/src/Markdown/SprinkleMarkdownRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function all(): array
5353
throw new BadClassNameException("Extension class `$extensionClass` not found.");
5454
}
5555
$instance = $this->ci->get($extensionClass);
56-
if (!$instance instanceof ExtensionInterface) {
56+
if (!is_object($instance) || !is_subclass_of($instance, ExtensionInterface::class)) {
5757
throw new BadInstanceOfException("Extension class `$extensionClass` doesn't implement " . ExtensionInterface::class . '.');
5858
}
5959
$instances[] = $instance;

0 commit comments

Comments
 (0)