add missing PHP doc

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2017-09-07 23:52:10 +02:00
parent 7122739dd6
commit 2eff174deb
No known key found for this signature in database
GPG key ID: 7424F1874854DF23

View file

@ -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');
}