Esempio n. 1
0
 /**
  * @param callable $callback
  *
  * @return static
  */
 public static function make(\Closure $callback = null)
 {
     self::$instance = new static();
     if ($callback instanceof \Closure) {
         return $callback(self::$instance);
     }
     return self::$instance;
 }
Esempio n. 2
0
 public static function __callStatic($method, $arguments = array())
 {
     if ($method == 'instance') {
         if (self::$instance === null) {
             self::$instance = new self(new Encrypt());
         }
         return call_user_func_array(array(self::$instance, $method), array($arguments));
     }
 }
Esempio n. 3
0
 /**
  * We will call all functions statically
  * Session::set();
  * Session::get();
  * Session::has();
  * Session::delete();
  * Session::destroy();
  *
  * @param       $method
  * @param array $arguments
  * @return mixed
  */
 public static function __callStatic($method, $arguments)
 {
     $arguments['method'] = $method;
     self::$instance = new Static();
     return call_user_func_array(array(self::$instance, 'factory'), array($arguments));
 }