فهرست منبع

[Templating] Removed useless else

Pascal Borreli 14 سال پیش
والد
کامیت
5a922dae22
2فایلهای تغییر یافته به همراه4 افزوده شده و 4 حذف شده
  1. 2 2
      src/Symfony/Component/Templating/PhpEngine.php
  2. 2 2
      src/Symfony/Component/Templating/TemplateReference.php

+ 2 - 2
src/Symfony/Component/Templating/PhpEngine.php

@@ -460,9 +460,9 @@ class PhpEngine implements EngineInterface, \ArrayAccess
             return iconv($from, $to, $string);
         } elseif (function_exists('mb_convert_encoding')) {
             return mb_convert_encoding($string, $to, $from);
-        } else {
-            throw new \RuntimeException('No suitable convert encoding function (use UTF-8 as your encoding or install the iconv or mbstring extension).');
         }
+
+        throw new \RuntimeException('No suitable convert encoding function (use UTF-8 as your encoding or install the iconv or mbstring extension).');
     }
 
     /**

+ 2 - 2
src/Symfony/Component/Templating/TemplateReference.php

@@ -62,9 +62,9 @@ class TemplateReference implements TemplateReferenceInterface
     {
         if (array_key_exists($name, $this->parameters)) {
             return $this->parameters[$name];
-        } else {
-            throw new \InvalidArgumentException(sprintf('The template does not support the "%s" parameter.', $name));
         }
+
+        throw new \InvalidArgumentException(sprintf('The template does not support the "%s" parameter.', $name));
     }
 
     /**