public static function __callStatic($method, $arguments = array()) { if ($method == 'create') { if (self::$instance === null) { self::$instance = new self(); } // we will return $this for method chaining return call_user_func_array(array(self::$instance, 'getInstance'), array($arguments)); } }
/** * @return static */ public static function create() { $encryptKey = Config::get('global.config', 'encryption.key'); if (self::$instance === null) { self::$instance = new static($encryptKey); } return self::$instance; }
public static function __callStatic($method, $arguments = array()) { if ($method == 'instance') { if (self::$instance === null) { self::$instance = new self(); } return call_user_func_array(array(self::$instance, $method), array($arguments)); } }