diff options
-rw-r--r-- | lib/public/Collaboration/Collaborators/SearchResultType.php | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/public/Collaboration/Collaborators/SearchResultType.php b/lib/public/Collaboration/Collaborators/SearchResultType.php index 569adb864e9..65d20cd67f4 100644 --- a/lib/public/Collaboration/Collaborators/SearchResultType.php +++ b/lib/public/Collaboration/Collaborators/SearchResultType.php @@ -33,14 +33,29 @@ class SearchResultType { /** @var string */ protected $label; + /** + * SearchResultType constructor. + * + * @param string $label + * @since 13.0.0 + */ public function __construct($label) { $this->label = $this->getValidatedType($label); } + /** + * @return string + * @since 13.0.0 + */ public function getLabel() { return $this->label; } + /** + * @param $type + * @return string + * @throws \InvalidArgumentException + */ protected function getValidatedType($type) { $type = trim(strval($type)); @@ -48,7 +63,7 @@ class SearchResultType { throw new \InvalidArgumentException('Type must not be empty'); } - if(trim($type) === 'exact') { + if($type === 'exact') { throw new \InvalidArgumentException('Provided type is a reserved word'); } |