StubTwigTemplate.php

Namespace

Drupal\Tests\Core\Template

File

core/tests/Drupal/Tests/Core/Template/StubTwigTemplate.php

View source
<?php

declare (strict_types=1);
namespace Drupal\Tests\Core\Template;

use Twig\Source;
use Twig\Template;

/**
 * A stub of the Twig Template class for testing.
 */
class StubTwigTemplate extends Template {
    
    /**
     * {@inheritdoc}
     */
    public function getTemplateName() : string {
        return '';
    }
    
    /**
     * {@inheritdoc}
     */
    public function getDebugInfo() : array {
        return [];
    }
    
    /**
     * {@inheritdoc}
     */
    public function getSourceContext() : Source {
        throw new \LogicException(__METHOD__ . '() not implemented.');
    }
    
    /**
     * {@inheritdoc}
     */
    protected function doDisplay(array $context, array $blocks = []) : iterable {
        throw new \LogicException(__METHOD__ . '() not implemented.');
    }

}

Classes

Title Deprecated Summary
StubTwigTemplate A stub of the Twig Template class for testing.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.