bugfree-dangerzone icon indicating copy to clipboard operation
bugfree-dangerzone copied to clipboard

Calling variable methods will crash the validator

Open willemstuursma opened this issue 10 years ago • 0 comments

We have some methods such as below to help us test our code.

    /**
     * @param string $method
     * @param mixed $parameter
     * @return mixed
     * @codeCoverageIgnore
     */
    protected function _callParent ($method, $parameter)
    {
        return parent::$method($parameter);
    }

This crashes the validator with an exception:

:1 Exception while parsing application/classes/payment/specifications/ideal.php ErrorException("ReflectionClass::getMethod() expects parameter 1 to be string, object given")

The call to the variable should be ignored, or the validator should attempt to resolve the variable.

willemstuursma avatar Sep 01 '15 08:09 willemstuursma