protected function createClass($newName, array $proxyMethods, \ReflectionClass $class)
    {
        $src = $this->proxyTemplate;
        $src = str_replace('NEW_NAME', $newName, $src);
        $src = str_replace('CLASS_NAME', $class->getName(), $src);
        $methods = array();
        foreach ($proxyMethods as $method) {
            if ($class->hasMethod($method)) {
                $methods[] = $this->createMethod($class->getMethod($method));
            }
        }
        $src = str_replace('METHODS', implode("\n", $methods), $src);
        return $src;
    }
protected function createClass($newName, array $proxyMethods, \ReflectionClass $class)
    {
        $src = $this->proxyTemplate;
        $src = str_replace('NEW_NAME', $newName, $src);
        $src = str_replace('CLASS_NAME', $class->getName(), $src);
        $methods = array();
        foreach ($proxyMethods as $method) {
            if ($class->hasMethod($method)) {
                $methods[] = $this->createMethod($class->getMethod($method));
            }
        }
        $src = str_replace('METHODS', implode("\n", $methods), $src);
        return $src;
    }
protected function createClass ( $ newName , array $ proxyMethods , \ ReflectionClass $ class ) { $ src = $ this -> proxyTemplate ; $ src = str_replace ( 'NEW_NAME' , $ newName , $ src ) ; $ src = str_replace ( 'CLASS_NAME' , $ class -> getName ( ) , $ src ) ; $ methods = array ( ) ; foreach ( $ proxyMethods as $ method ) { if ( $ class -> hasMethod ( $ method ) ) { $ methods [ ] = $ this -> createMethod ( $ class -> getMethod ( $ method ) ) ; } } $ src = str_replace ( 'METHODS' , implode ( "\n" , $ methods ) , $ src ) ; return $ src ; }
This will return a proxy class source.

@param string          $newName     Name for the proxy class.
@param ReflectionClass $targetClass Class to be proxied.

@see Proxy::$proxyTemplate

@return string
This will return a proxy class source .