mirror of
https://github.com/nextcloud/server.git
synced 2026-04-27 01:00:20 -04:00
add missing PHP doc
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
parent
7122739dd6
commit
2eff174deb
1 changed files with 16 additions and 1 deletions
|
|
@ -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');
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue