]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fixed array_combine for PHP 5.3
authorVincent Petry <pvince81@owncloud.com>
Wed, 11 Jun 2014 17:13:49 +0000 (19:13 +0200)
committerVincent Petry <pvince81@owncloud.com>
Wed, 11 Jun 2014 17:13:49 +0000 (19:13 +0200)
lib/private/appframework/utility/controllermethodreflector.php

index a1519c7280990a154b42d3636b9c427a6de9a61d..d5cf2f52eb26b8c5480e9f8558825ff488a36f61 100644 (file)
@@ -55,8 +55,13 @@ class ControllerMethodReflector {
 
                // extract type parameter information
                preg_match_all('/@param (?<type>\w+) \$(?<var>\w+)/', $docs, $matches);
-               $this->types = array_combine($matches['var'], $matches['type']);
-
+               // this is just a fix for PHP 5.3 (array_combine raises warning if called with
+               // two empty arrays
+               if($matches['var'] === array() && $matches['type'] === array()) {
+                       $this->types = array();
+               } else {
+                       $this->types = array_combine($matches['var'], $matches['type']);
+               }
                // get method parameters
                foreach ($reflection->getParameters() as $param) {
                        if($param->isOptional()) {