Browse Source

Making all tests pass in HHVM. Reflection when using traits is still wonky

Jose Lorenzo Rodriguez 11 years ago
parent
commit
d0012fe2c1
1 changed files with 7 additions and 1 deletions
  1. 7 1
      src/View/ViewVarsTrait.php

+ 7 - 1
src/View/ViewVarsTrait.php

@@ -91,7 +91,13 @@ trait ViewVarsTrait
         if (!$className) {
             throw new Exception\MissingViewException([$viewClass]);
         }
-        $viewOptions = array_intersect_key(get_object_vars($this), array_flip($this->_validViewOptions));
+
+        $viewOptions = [];
+        foreach ($this->_validViewOptions as $option) {
+            if (property_exists($this, $option)) {
+                $viewOptions[$option] = $this->{$option};
+            }
+        }
         return new $className($this->request, $this->response, $this->eventManager(), $viewOptions);
     }