diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2025-03-04 14:23:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-04 14:23:21 +0100 |
commit | 42d752f7679ebd8c34c8932aaa64d1f9a92be02d (patch) | |
tree | 781f696535e9300cc005aad7e10aa5eee78c57a9 /lib | |
parent | beb12e9be3a3c235ab1552cc3f66f442820f19d6 (diff) | |
parent | 6594d7d96d7695567bbc42d882c3bfebfbab97a3 (diff) | |
download | nextcloud-server-42d752f7679ebd8c34c8932aaa64d1f9a92be02d.tar.gz nextcloud-server-42d752f7679ebd8c34c8932aaa64d1f9a92be02d.zip |
Merge pull request #51116 from nextcloud/enh/noid/nullable-range
feat(AppFramework): extend range check to optional parameters
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/AppFramework/Utility/ControllerMethodReflector.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/private/AppFramework/Utility/ControllerMethodReflector.php b/lib/private/AppFramework/Utility/ControllerMethodReflector.php index 2031327dfae..679e1788004 100644 --- a/lib/private/AppFramework/Utility/ControllerMethodReflector.php +++ b/lib/private/AppFramework/Utility/ControllerMethodReflector.php @@ -50,7 +50,7 @@ class ControllerMethodReflector implements IControllerMethodReflector { // extract type parameter information preg_match_all('/@param\h+(?P<type>\w+)\h+\$(?P<var>\w+)/', $docs, $matches); $this->types = array_combine($matches['var'], $matches['type']); - preg_match_all('/@psalm-param\h+(?P<type>\w+)<(?P<rangeMin>(-?\d+|min)),\h*(?P<rangeMax>(-?\d+|max))>\h+\$(?P<var>\w+)/', $docs, $matches); + preg_match_all('/@psalm-param\h+(\?)?(?P<type>\w+)<(?P<rangeMin>(-?\d+|min)),\h*(?P<rangeMax>(-?\d+|max))>(\|null)?\h+\$(?P<var>\w+)/', $docs, $matches); foreach ($matches['var'] as $index => $varName) { if ($matches['type'][$index] !== 'int') { // only int ranges are possible at the moment |