소스 검색

Decrease indentation in HelperCollection constructor

Dariusz Rumiński 11 년 전
부모
커밋
5ea8dc21e9
1개의 변경된 파일10개의 추가작업 그리고 8개의 파일을 삭제
  1. 10 8
      src/Mustache/HelperCollection.php

+ 10 - 8
src/Mustache/HelperCollection.php

@@ -27,14 +27,16 @@ class Mustache_HelperCollection
      */
     public function __construct($helpers = null)
     {
-        if ($helpers !== null) {
-            if (!is_array($helpers) && !$helpers instanceof Traversable) {
-                throw new Mustache_Exception_InvalidArgumentException('HelperCollection constructor expects an array of helpers');
-            }
-
-            foreach ($helpers as $name => $helper) {
-                $this->add($name, $helper);
-            }
+        if ($helpers === null) {
+            return;
+        }
+
+        if (!is_array($helpers) && !$helpers instanceof Traversable) {
+            throw new Mustache_Exception_InvalidArgumentException('HelperCollection constructor expects an array of helpers');
+        }
+
+        foreach ($helpers as $name => $helper) {
+            $this->add($name, $helper);
         }
     }