Update Twig to v2.15.4

This commit is contained in:
slawkens
2023-02-02 10:37:45 +01:00
parent e552bcfe82
commit 130f7ba405
309 changed files with 3802 additions and 4005 deletions

View File

@@ -12,6 +12,7 @@
namespace Twig\Loader;
use Twig\Error\LoaderError;
use Twig\Source;
/**
* Interface all loaders must implement.
@@ -21,17 +22,15 @@ use Twig\Error\LoaderError;
interface LoaderInterface
{
/**
* Gets the source code of a template, given its name.
* Returns the source context for a given template logical name.
*
* @param string $name The name of the template to load
* @param string $name The template logical name
*
* @return string The template source code
* @return Source
*
* @throws LoaderError When $name is not found
*
* @deprecated since 1.27 (to be removed in 2.0), implement Twig\Loader\SourceContextLoaderInterface
*/
public function getSource($name);
public function getSourceContext($name);
/**
* Gets the cache key to use for the cache for a given template name.
@@ -56,6 +55,15 @@ interface LoaderInterface
* @throws LoaderError When $name is not found
*/
public function isFresh($name, $time);
/**
* Check if we have the source code of a template, given its name.
*
* @param string $name The name of the template to check if we can load
*
* @return bool If the template source code is handled by this loader or not
*/
public function exists($name);
}
class_alias('Twig\Loader\LoaderInterface', 'Twig_LoaderInterface');