public function addMethod($method, callable $callback)
    {
        if (!is_string($method)) {
            throw new \InvalidArgumentException('$method must be string');
        }
        $this->plugins[$method] = $callback;
    }
public function addMethod($method, callable $callback)
    {
        if (!is_string($method)) {
            throw new \InvalidArgumentException('$method must be string');
        }
        $this->plugins[$method] = $callback;
    }
public function addMethod ( $ method , callable $ callback ) { if ( ! is_string ( $ method ) ) { throw new \ InvalidArgumentException ( '$method must be string' ) ; } $ this -> plugins [ $ method ] = $ callback ; }
Dynamically add a method to the class.

@param string   $method
@param callable $callback

@throws \InvalidArgumentException
Dynamically add a method to the class .