mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-19 13:57:00 +00:00
simplified code
This commit is contained in:
@@ -49,7 +49,7 @@ class Twig_Loader_Chain implements Twig_LoaderInterface, Twig_ExistsLoaderInterf
|
|||||||
{
|
{
|
||||||
$exceptions = array();
|
$exceptions = array();
|
||||||
foreach ($this->loaders as $loader) {
|
foreach ($this->loaders as $loader) {
|
||||||
if ($loader instanceof Twig_ExistsLoaderInterface && !$loader->exists($name)) {
|
if (!$loader->exists($name)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,19 +75,8 @@ class Twig_Loader_Chain implements Twig_LoaderInterface, Twig_ExistsLoaderInterf
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach ($this->loaders as $loader) {
|
foreach ($this->loaders as $loader) {
|
||||||
if ($loader instanceof Twig_ExistsLoaderInterface) {
|
if ($loader->exists($name)) {
|
||||||
if ($loader->exists($name)) {
|
|
||||||
return $this->hasSourceCache[$name] = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
$loader->getSource($name);
|
|
||||||
|
|
||||||
return $this->hasSourceCache[$name] = true;
|
return $this->hasSourceCache[$name] = true;
|
||||||
} catch (Twig_Error_Loader $e) {
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,7 +90,7 @@ class Twig_Loader_Chain implements Twig_LoaderInterface, Twig_ExistsLoaderInterf
|
|||||||
{
|
{
|
||||||
$exceptions = array();
|
$exceptions = array();
|
||||||
foreach ($this->loaders as $loader) {
|
foreach ($this->loaders as $loader) {
|
||||||
if ($loader instanceof Twig_ExistsLoaderInterface && !$loader->exists($name)) {
|
if (!$loader->exists($name)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,7 +111,7 @@ class Twig_Loader_Chain implements Twig_LoaderInterface, Twig_ExistsLoaderInterf
|
|||||||
{
|
{
|
||||||
$exceptions = array();
|
$exceptions = array();
|
||||||
foreach ($this->loaders as $loader) {
|
foreach ($this->loaders as $loader) {
|
||||||
if ($loader instanceof Twig_ExistsLoaderInterface && !$loader->exists($name)) {
|
if (!$loader->exists($name)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user