diff --git a/app/Traits/StaticInstance.php b/app/Traits/StaticInstance.php index e0aea86..872b30e 100644 --- a/app/Traits/StaticInstance.php +++ b/app/Traits/StaticInstance.php @@ -11,6 +11,10 @@ trait StaticInstance { private static $instance; + private function __construct() + { + } + /** * θŽ·ε–ε•δΎ‹ * @@ -18,15 +22,14 @@ trait StaticInstance */ static public function getInstance() { - if (!(self::$instance instanceof static)) { - self::$instance = new static(); + if (is_null(static::$instance)) { + static::$instance = new static; } - return self::$instance; + return static::$instance; } private function __clone() { - } }