Example #1
0
 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));
     }
 }
Example #2
0
 /**
  * @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;
 }
Example #3
0
 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));
     }
 }