PHPSpec2\Listener\ClassNotFoundListener::getClassContentFor PHP Method

getClassContentFor() protected method

protected getClassContentFor ( $classname )
    protected function getClassContentFor($classname)
    {
        $classpath = str_replace('\\', DIRECTORY_SEPARATOR, $classname);
        if ('.' !== ($namespace = str_replace(DIRECTORY_SEPARATOR, '\\', dirname($classpath)))) {
            $template = file_get_contents(__DIR__ . '/../Resources/templates/nsclass.php');
            return strtr($template, array('%classname%' => $classname, '%namespace%' => $namespace, '%class%' => basename($classpath)));
        }
        $template = file_get_contents(__DIR__ . '/../Resources/templates/class.php');
        return strtr($template, array('%classname%' => $classname, '%class%' => basename($classpath)));
    }