mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-24 16:43:48 +00:00
fix when search service not exists
throw an error when the search service name does not exists. + test
This commit is contained in:
@@ -63,7 +63,7 @@ class SearchProvider
|
||||
throw new ParsingException('You should not have more than one domain');
|
||||
}
|
||||
|
||||
return isset($terms[1][0]) ? $terms[1][0] : '';
|
||||
return isset($terms[1][0]) ? $terms[1][0] : NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -89,15 +89,20 @@ class SearchProvider
|
||||
return $results;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* return search services with a specific name, defined in service
|
||||
* definition.
|
||||
*
|
||||
* @return SearchInterface
|
||||
* @throws UnknowSearchNameException if not exists
|
||||
*/
|
||||
public function getByName($name)
|
||||
{
|
||||
return $this->searchServices[$name];
|
||||
if (isset($this->searchServices[$name])) {
|
||||
return $this->searchServices;
|
||||
} else {
|
||||
throw new UnknowSearchNameException($name);
|
||||
}
|
||||
}
|
||||
|
||||
public function addSearchService(SearchInterface $service, $name)
|
||||
|
Reference in New Issue
Block a user