simplified code

This commit is contained in:
Fabien Potencier
2013-08-05 20:08:00 +02:00
parent 4be32fb968
commit cd72eb7c04
+4 -15
View File
@@ -49,7 +49,7 @@ class Twig_Loader_Chain implements Twig_LoaderInterface, Twig_ExistsLoaderInterf
{
$exceptions = array();
foreach ($this->loaders as $loader) {
if ($loader instanceof Twig_ExistsLoaderInterface && !$loader->exists($name)) {
if (!$loader->exists($name)) {
continue;
}
@@ -75,19 +75,8 @@ class Twig_Loader_Chain implements Twig_LoaderInterface, Twig_ExistsLoaderInterf
}
foreach ($this->loaders as $loader) {
if ($loader instanceof Twig_ExistsLoaderInterface) {
if ($loader->exists($name)) {
return $this->hasSourceCache[$name] = true;
}
continue;
}
try {
$loader->getSource($name);
if ($loader->exists($name)) {
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();
foreach ($this->loaders as $loader) {
if ($loader instanceof Twig_ExistsLoaderInterface && !$loader->exists($name)) {
if (!$loader->exists($name)) {
continue;
}
@@ -122,7 +111,7 @@ class Twig_Loader_Chain implements Twig_LoaderInterface, Twig_ExistsLoaderInterf
{
$exceptions = array();
foreach ($this->loaders as $loader) {
if ($loader instanceof Twig_ExistsLoaderInterface && !$loader->exists($name)) {
if (!$loader->exists($name)) {
continue;
}