aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-06-23 20:18:23 +0200
committerJoas Schilling <coding@schilljs.com>2020-06-23 20:18:23 +0200
commitad0731a63c52ea07bff23eb72fc0479e2be76142 (patch)
treedb7a94015d9f5cf9c3b157b2d5560ca3a2d255eb
parent284ca3e8a8b258d7e2707646a52cfcb3641d5392 (diff)
downloadnextcloud-server-ad0731a63c52ea07bff23eb72fc0479e2be76142.tar.gz
nextcloud-server-ad0731a63c52ea07bff23eb72fc0479e2be76142.zip
Make annotations case insensitive
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r--lib/private/AppFramework/Utility/ControllerMethodReflector.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/private/AppFramework/Utility/ControllerMethodReflector.php b/lib/private/AppFramework/Utility/ControllerMethodReflector.php
index 97957fb5733..81ae7407120 100644
--- a/lib/private/AppFramework/Utility/ControllerMethodReflector.php
+++ b/lib/private/AppFramework/Utility/ControllerMethodReflector.php
@@ -55,6 +55,7 @@ class ControllerMethodReflector implements IControllerMethodReflector {
// extract everything prefixed by @ and first letter uppercase
preg_match_all('/^\h+\*\h+@(?P<annotation>[A-Z]\w+)((?P<parameter>.*))?$/m', $docs, $matches);
foreach ($matches['annotation'] as $key => $annontation) {
+ $annontation = strtolower($annontation);
$annotationValue = $matches['parameter'][$key];
if (isset($annotationValue[0]) && $annotationValue[0] === '(' && $annotationValue[\strlen($annotationValue) - 1] === ')') {
$cutString = substr($annotationValue, 1, -1);
@@ -118,6 +119,7 @@ class ControllerMethodReflector implements IControllerMethodReflector {
* @return bool true if the annotation is found
*/
public function hasAnnotation(string $name): bool {
+ $name = strtolower($name);
return array_key_exists($name, $this->annotations);
}
@@ -129,6 +131,7 @@ class ControllerMethodReflector implements IControllerMethodReflector {
* @return string
*/
public function getAnnotationParameter(string $name, string $key): string {
+ $name = strtolower($name);
if (isset($this->annotations[$name][$key])) {
return $this->annotations[$name][$key];
}