summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-06-11 19:13:49 +0200
committerVincent Petry <pvince81@owncloud.com>2014-06-11 19:13:49 +0200
commit4e4c2b04c8a39b9d069acd38bf3654942ee0126d (patch)
treeae2dd29ce9e3825b11da42c7e0a35633ab5099e6
parent67413e3ada455793e82dc2a0c663fc7a31d9effe (diff)
downloadnextcloud-server-4e4c2b04c8a39b9d069acd38bf3654942ee0126d.tar.gz
nextcloud-server-4e4c2b04c8a39b9d069acd38bf3654942ee0126d.zip
Fixed array_combine for PHP 5.3
-rw-r--r--lib/private/appframework/utility/controllermethodreflector.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/private/appframework/utility/controllermethodreflector.php b/lib/private/appframework/utility/controllermethodreflector.php
index a1519c72809..d5cf2f52eb2 100644
--- a/lib/private/appframework/utility/controllermethodreflector.php
+++ b/lib/private/appframework/utility/controllermethodreflector.php
@@ -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()) {