Skip to content

Commit

Permalink
fix Log
Browse files Browse the repository at this point in the history
  • Loading branch information
amirfaramarzi authored Jul 12, 2024
1 parent b7ddbc0 commit f7bc794
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/Log/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,17 @@ class Log
{
protected static Logger $instance;

public static function setInstance(): void
protected static function getInstance(): Logger
{
if (!isset(self::$instance)){
self::$instance = new Logger();
if (isset(self::$instance)) {
return self::$instance;
}
}

public static function getInstance(): Logger
{
return self::$instance;
return self::$instance = new Logger();
}

public static function __callStatic(string $method, array $arguments)
{
return self::getInstance()->$method(...$arguments);
}
}
}

0 comments on commit f7bc794

Please sign in to comment.