[Pkg-owncloud-commits] [owncloud] 49/172: default to null to not fail if type is not annotated via phpdoc

David Prévot taffit at moszumanska.debian.org
Sun May 18 20:09:39 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit fcb1aa36f0f66cbc3a11a6443ba0feab35402285
Author: Bernhard Posselt <dev at bernhard-posselt.com>
Date:   Wed May 7 20:07:52 2014 +0200

    default to null to not fail if type is not annotated via phpdoc
---
 lib/private/appframework/utility/controllermethodreflector.php | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/lib/private/appframework/utility/controllermethodreflector.php b/lib/private/appframework/utility/controllermethodreflector.php
index 1f0cc71..372b8d1 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;
+		}
 	}
 
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list