mirror of
https://github.com/nextcloud/server.git
synced 2026-04-26 08:38:11 -04:00
Fixed array_combine for PHP 5.3
This commit is contained in:
parent
67413e3ada
commit
4e4c2b04c8
1 changed files with 7 additions and 2 deletions
|
|
@ -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()) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue