src/Utils/getaway.php
/**
     * Dispatch the action (command) based on the type
     *
     * @param string $type Type of action
     * @param object $json JSON object
     * @return mixed
     */
Dispatch the action (command) based on the type
@param string $type Type of action
@param object $json JSON object
@return mixed
Dispatch the action ( command ) based on the type @param string $type Type of action @param object $json JSON object @return mixed
public function dispatch($type, $json)
    {
        if (!empty($this->dispatch[$type]) && isset($this->dispatch[$type])) {
            $dis = $this->dispatch[$type];
            foreach ($dis as $key => $item) {
                if ($item instanceof Closure) {
                    $item($json);
                } elseif (is_callable($dis)) {
                    $obj = $item[0];
                    $obj->$item[1]($json);
                }
                continue;
            }
            return null;
        }
        return null;
    }
public function dispatch ( $ type , $ json ) { if ( ! empty ( $ this -> dispatch [ $ type ] ) && isset ( $ this -> dispatch [ $ type ] ) ) { $ dis = $ this -> dispatch [ $ type ] ; foreach ( $ dis as $ key => $ item ) { if ( $ item instanceof Closure ) { $ item ( $ json ) ; } elseif ( is_callable ( $ dis ) ) { $ obj = $ item [ 0 ] ; $ obj -> $ item [ 1 ] ( $ json ) ; } continue ; } return null ; } return null ; }
Dispatch the action (command) based on the type
 @param string $type Type of action
 @param object $json JSON object
 @return mixed
Dispatch the action ( command ) based on the type @param string $type Type of action @param object $json JSON object @return mixed