public function invoke($instance, string $method, array $data)
    {
        // get the parameters
        $parameters = $this->resolveMethodParameters($instance, $method, $data, true);

        // get the reflection of method
        $reflection = new ReflectionMethod(get_class($instance), $method);

        // allow access
        $reflection->setAccessible(true);

        // execute the method
        return $reflection->invokeArgs($instance, $parameters);
    }
public function invoke($instance, string $method, array $data)
    {
        // get the parameters
        $parameters = $this->resolveMethodParameters($instance, $method, $data, true);

        // get the reflection of method
        $reflection = new ReflectionMethod(get_class($instance), $method);

        // allow access
        $reflection->setAccessible(true);

        // execute the method
        return $reflection->invokeArgs($instance, $parameters);
    }
public function invoke ( $ instance , string $ method , array $ data ) { // get the parameters $ parameters = $ this -> resolveMethodParameters ( $ instance , $ method , $ data , true ) ; // get the reflection of method $ reflection = new ReflectionMethod ( get_class ( $ instance ) , $ method ) ; // allow access $ reflection -> setAccessible ( true ) ; // execute the method return $ reflection -> invokeArgs ( $ instance , $ parameters ) ; }
Invoke a method of an instance of a class

@param mixed $instance
@param string $method
@param array $data
@return mixed
@throws SimplesRunTimeError
Invoke a method of an instance of a class