Commit 51e3dc84 authored by catch's avatar catch
Browse files

Issue #3117250 by alexpott, longwave: Update StringLoader and TestLoader for Twig 3 compatibility

parent 00d95c74
......@@ -3,7 +3,6 @@
namespace Drupal\Core\Template\Loader;
use Twig\Loader\LoaderInterface;
use Twig\Loader\SourceContextLoaderInterface;
use Twig\Source;
/**
......@@ -24,7 +23,7 @@
* @see \Drupal\Core\Render\Element\InlineTemplate
* @see twig_render_template()
*/
class StringLoader implements LoaderInterface, SourceContextLoaderInterface {
class StringLoader implements LoaderInterface {
/**
* {@inheritdoc}
......@@ -38,13 +37,6 @@ public function exists($name) {
}
}
/**
* {@inheritdoc}
*/
public function getSource($name) {
return $name;
}
/**
* {@inheritdoc}
*/
......
......@@ -2,15 +2,13 @@
namespace Drupal\twig_loader_test\Loader;
use Twig\Loader\ExistsLoaderInterface;
use Twig\Loader\LoaderInterface;
use Twig\Loader\SourceContextLoaderInterface;
use Twig\Source;
/**
* A test Twig loader.
*/
class TestLoader implements LoaderInterface, ExistsLoaderInterface, SourceContextLoaderInterface {
class TestLoader implements LoaderInterface {
/**
* {@inheritdoc}
......@@ -21,13 +19,6 @@ public function getSourceContext($name) {
return new Source($value, $name);
}
/**
* {@inheritdoc}
*/
public function getSource($name) {
return $this->getSourceContext($name)->getCode();
}
/**
* {@inheritdoc}
*/
......
......@@ -147,13 +147,6 @@ public static function getSkippedDeprecations() {
// This deprecation comes from behat/mink-browserkit-driver when updating
// symfony/browser-kit to 4.3+.
'The "Symfony\Component\BrowserKit\Response::getStatus()" method is deprecated since Symfony 4.3, use getStatusCode() instead.',
// The following deprecations are introduced in by the new
// DebugClassLoader in Symfony 4 we cannot immediately fix them without
// breaking backwards compatibility.
// @see https://www.drupal.org/project/drupal/issues/3030494
// @see https://www.drupal.org/project/drupal/issues/3030474
'The "Drupal\Core\Template\Loader\StringLoader" class implements "Twig\Loader\ExistsLoaderInterface" that is deprecated since 1.12 (to be removed in 3.0).',
'The "Drupal\Core\Template\Loader\StringLoader" class implements "Twig\Loader\SourceContextLoaderInterface" that is deprecated since 1.27 (to be removed in 3.0).',
// The following Symfony deprecations are introduced in the Symfony 4
// development cycle. They will need to be resolved prior to Symfony 5
// compatibility.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment