Esempio n. 1
0
 /**
  * Run callbacks that are waiting for Tweech to boot.
  *
  * @param Closure $callback Callback function
  *
  * @return void
  */
 public function whenBooted(\Closure $callback)
 {
     $this->bootCallbacks[] = $callback;
     if ($this->isBooted()) {
         fire_callbacks([$callback], $this);
     }
 }
Esempio n. 2
0
 /**
  * Adds the callback function to the loggedInCallbacks list
  * If client is already logged in, then the function is called.
  *
  * @param callable $callback
  *
  * @return void
  */
 public function whenLogged($callback)
 {
     $this->loggedInCallbacks[] = $callback;
     if ($this->isLogged()) {
         fire_callbacks($this->loggedInCallbacks, $this);
     }
 }