protected function createCodeForMethods($methods)
    {
        $code    = '';
        $methods = array_merge($methods, $this->reflection->getMethods());

        foreach ($methods as $method) {
            if ($this->isConstructorOrDeconstructor($method)) {
                continue;
            }
            $mock_reflection = new SimpleReflection($this->mock_base);
            if (in_array($method, $mock_reflection->getMethods())) {
                continue;
            }

            $code .= '    ' . $this->reflection->getSignature($method);

            if($mock_reflection->isAbstract()) {
                // abstract function has no body. end the signature statement.
                $code .= ";\n";
            } else {
                $code .= " {\n";
                $code .= "        return \$this->invoke(\"$method\", func_get_args());\n";
                $code .= "    }\n";
            }

        }

        return $code;
    }
protected function createCodeForMethods($methods)
    {
        $code    = '';
        $methods = array_merge($methods, $this->reflection->getMethods());

        foreach ($methods as $method) {
            if ($this->isConstructorOrDeconstructor($method)) {
                continue;
            }
            $mock_reflection = new SimpleReflection($this->mock_base);
            if (in_array($method, $mock_reflection->getMethods())) {
                continue;
            }

            $code .= '    ' . $this->reflection->getSignature($method);

            if($mock_reflection->isAbstract()) {
                // abstract function has no body. end the signature statement.
                $code .= ";\n";
            } else {
                $code .= " {\n";
                $code .= "        return \$this->invoke(\"$method\", func_get_args());\n";
                $code .= "    }\n";
            }

        }

        return $code;
    }
protected function createCodeForMethods ( $ methods ) { $ code = '' ; $ methods = array_merge ( $ methods , $ this -> reflection -> getMethods ( ) ) ; foreach ( $ methods as $ method ) { if ( $ this -> isConstructorOrDeconstructor ( $ method ) ) { continue ; } $ mock_reflection = new SimpleReflection ( $ this -> mock_base ) ; if ( in_array ( $ method , $ mock_reflection -> getMethods ( ) ) ) { continue ; } $ code .= '    ' . $ this -> reflection -> getSignature ( $ method ) ; if ( $ mock_reflection -> isAbstract ( ) ) { // abstract function has no body. end the signature statement. $ code .= ";\n" ; } else { $ code .= " {\n" ; $ code .= "        return \$this->invoke(\"$method\", func_get_args());\n" ; $ code .= "    }\n" ; } } return $ code ; }
Creates code within a class to generate replaced methods.

All methods (except abstract ones) call the invoke() handler
with the method name and the arguments in an array.

@param array $methods Additional methods.
Creates code within a class to generate replaced methods .