public static function run($class_name, $method, $params = [])
    {
        // class exist ?
        if ( ! class_exists($class_name)) {
            throw new \BadMethodCallException("Class $class_name is not found!");
        }
        // method exist ?
        if ( ! method_exists($class_name, $method)) {
            throw new \BadMethodCallException("undefined method $method in $class_name !");
        }
        // create instance
        $instance = self::getInstance($class_name);
        /******* method Dependency injection *******/
        // get class reflector
        $reflector = new ReflectionClass($class_name);
        // get method
        $reflectorMethod = $reflector->getMethod($method);
        // create di params
        $di_params = self::_getDiParams($reflectorMethod->getParameters());
        // run method
        return call_user_func_array([$instance, $method], array_merge($di_params, $params));
    }
public static function run($class_name, $method, $params = [])
    {
        // class exist ?
        if ( ! class_exists($class_name)) {
            throw new \BadMethodCallException("Class $class_name is not found!");
        }
        // method exist ?
        if ( ! method_exists($class_name, $method)) {
            throw new \BadMethodCallException("undefined method $method in $class_name !");
        }
        // create instance
        $instance = self::getInstance($class_name);
        /******* method Dependency injection *******/
        // get class reflector
        $reflector = new ReflectionClass($class_name);
        // get method
        $reflectorMethod = $reflector->getMethod($method);
        // create di params
        $di_params = self::_getDiParams($reflectorMethod->getParameters());
        // run method
        return call_user_func_array([$instance, $method], array_merge($di_params, $params));
    }
public static function run ( $ class_name , $ method , $ params = [ ] ) { // class exist ? if ( ! class_exists ( $ class_name ) ) { throw new \ BadMethodCallException ( "Class $class_name is not found!" ) ; } // method exist ? if ( ! method_exists ( $ class_name , $ method ) ) { throw new \ BadMethodCallException ( "undefined method $method in $class_name !" ) ; } // create instance $ instance = self :: getInstance ( $ class_name ) ; /******* method Dependency injection *******/ // get class reflector $ reflector = new ReflectionClass ( $ class_name ) ; // get method $ reflectorMethod = $ reflector -> getMethod ( $ method ) ; // create di params $ di_params = self :: _getDiParams ( $ reflectorMethod -> getParameters ( ) ) ; // run method return call_user_func_array ( [ $ instance , $ method ] , array_merge ( $ di_params , $ params ) ) ; }
run class method.

@param  string $class_name
@param  string $method
@param  array  $params
@return mixed
@throws \BadMethodCallException
run class method .