Same filename and directory in other branches
- 8.9.x core/modules/system/tests/modules/twig_loader_test/src/Loader/TestLoader.php
- 9 core/modules/system/tests/modules/twig_loader_test/src/Loader/TestLoader.php
Namespace
Drupal\twig_loader_test\Loader
File
core/modules/system/tests/modules/twig_loader_test/src/Loader/TestLoader.php
View source
<?php
namespace Drupal\twig_loader_test\Loader;
use Twig\Loader\LoaderInterface;
use Twig\Source;
class TestLoader implements LoaderInterface {
public function getSourceContext(string $name) : Source {
$name = (string) $name;
$value = $name === 'kittens' ? 'kittens' : 'cats';
return new Source($value, $name);
}
public function exists(string $name) {
return TRUE;
}
public function getCacheKey(string $name) : string {
return $name;
}
public function isFresh(string $name, int $time) : bool {
return TRUE;
}
}
Classes