src/Plugin/Double.php
protected static function _generateMethod($method, $callParent = false)
    {
        $result = join(' ', Reflection::getModifierNames($method->getModifiers()));
        $result = preg_replace('/abstract\s*/', '', $result);
        $name = $method->getName();
        $parameters = static::_generateSignature($method);
        $type = static::_generateReturnType($method);
        $body = "{$result} function {$name}({$parameters}) {$type}{";
        if ($callParent) {
            $parameters = static::_generateParameters($method);
            $return = 'return ';
            if ($method->isConstructor() || $method->isDestructor()) {
                $return = '';
            }
            $body .= "{$return}parent::{$name}({$parameters});";
        }
        return $body . "}";
    }
protected static function _generateMethod($method, $callParent = false)
    {
        $result = join(' ', Reflection::getModifierNames($method->getModifiers()));
        $result = preg_replace('/abstract\s*/', '', $result);
        $name = $method->getName();
        $parameters = static::_generateSignature($method);
        $type = static::_generateReturnType($method);
        $body = "{$result} function {$name}({$parameters}) {$type}{";
        if ($callParent) {
            $parameters = static::_generateParameters($method);
            $return = 'return ';
            if ($method->isConstructor() || $method->isDestructor()) {
                $return = '';
            }
            $body .= "{$return}parent::{$name}({$parameters});";
        }
        return $body . "}";
    }
protected static function _generateMethod ( $ method , $ callParent = false ) { $ result = join ( ' ' , Reflection :: getModifierNames ( $ method -> getModifiers ( ) ) ) ; $ result = preg_replace ( '/abstract\s*/' , '' , $ result ) ; $ name = $ method -> getName ( ) ; $ parameters = static :: _generateSignature ( $ method ) ; $ type = static :: _generateReturnType ( $ method ) ; $ body = "{$result} function {$name}({$parameters}) {$type}{" ; if ( $ callParent ) { $ parameters = static :: _generateParameters ( $ method ) ; $ return = 'return ' ; if ( $ method -> isConstructor ( ) || $ method -> isDestructor ( ) ) { $ return = '' ; } $ body .= "{$return}parent::{$name}({$parameters});" ; } return $ body . "}" ; }
Creates a method definition from a `ReflectionMethod` instance.

@param  object $method A instance of `ReflectionMethod`.
@return string         The generated method.
Creates a method definition from a ReflectionMethod instance .