diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-05-07 20:07:52 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-05-11 17:54:09 +0200 |
commit | fcb1aa36f0f66cbc3a11a6443ba0feab35402285 (patch) | |
tree | 1adcf7d020e173e0feccc20d9f8458171629c9e8 /lib | |
parent | 1d45239c65e524e0d9b068cfc184bf79e3fd25c3 (diff) | |
download | nextcloud-server-fcb1aa36f0f66cbc3a11a6443ba0feab35402285.tar.gz nextcloud-server-fcb1aa36f0f66cbc3a11a6443ba0feab35402285.zip |
default to null to not fail if type is not annotated via phpdoc
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/appframework/utility/controllermethodreflector.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/private/appframework/utility/controllermethodreflector.php b/lib/private/appframework/utility/controllermethodreflector.php index 1f0cc7165b8..372b8d184de 100644 --- a/lib/private/appframework/utility/controllermethodreflector.php +++ b/lib/private/appframework/utility/controllermethodreflector.php @@ -68,11 +68,15 @@ class ControllerMethodReflector { * Inspects the PHPDoc parameters for types * @param strint $parameter the parameter whose type comments should be * parsed - * @return string type in the type parameters (@param int $something) would - * return int + * @return string|null type in the type parameters (@param int $something) + * would return int or null if not existing */ public function getType($parameter) { - return $this->types[$parameter]; + if(array_key_exists($parameter, $this->types)) { + return $this->types[$parameter]; + } else { + return null; + } } |