Skip to content

Commit

Permalink
instanceof triggers must not be accessed before initialization error
Browse files Browse the repository at this point in the history
  • Loading branch information
carlalexander committed Jun 26, 2024
1 parent daa581a commit 232ecb3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Optimole.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static function __callStatic($name, $arguments)
{
$method = sprintf('create%s', ucfirst($name));

if (!self::$instance instanceof self) {
if (!isset(self::$instance)) {
throw new RuntimeException('Please initialize the Optimole SDK first.');
} elseif (!method_exists(self::class, $method)) {
throw new BadMethodCallException(sprintf('No factory method for "%s" exists.', $name));
Expand Down

0 comments on commit 232ecb3

Please sign in to comment.