mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-30 19:43:49 +00:00
Merge branch 'refactor-using-rector-202303' into rector/rules-up-to-php74
This commit is contained in:
@@ -20,4 +20,6 @@ interface HasAdvancedSearchFormInterface extends SearchInterface
|
||||
public function convertFormDataToQuery(array $data);
|
||||
|
||||
public function convertTermsToFormData(array $terms);
|
||||
|
||||
public function getAdvancedSearchTitle(): string;
|
||||
}
|
||||
|
@@ -33,7 +33,7 @@ use function count;
|
||||
class SearchProvider
|
||||
{
|
||||
/**
|
||||
* @var HasAdvancedSearchForm[]
|
||||
* @var HasAdvancedSearchFormInterface[]
|
||||
*/
|
||||
private $hasAdvancedFormSearchServices = [];
|
||||
|
||||
@@ -99,13 +99,9 @@ class SearchProvider
|
||||
* return searchservice with an advanced form, defined in service
|
||||
* definition.
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @throws UnknowSearchNameException
|
||||
*
|
||||
* @return HasAdvancedSearchForm
|
||||
*/
|
||||
public function getHasAdvancedFormByName($name)
|
||||
public function getHasAdvancedFormByName(string $name): HasAdvancedSearchFormInterface
|
||||
{
|
||||
if (array_key_exists($name, $this->hasAdvancedFormSearchServices)) {
|
||||
return $this->hasAdvancedFormSearchServices[$name];
|
||||
@@ -117,7 +113,9 @@ class SearchProvider
|
||||
public function getHasAdvancedFormSearchServices()
|
||||
{
|
||||
//sort the array
|
||||
uasort($this->hasAdvancedFormSearchServices, static fn(SearchInterface $a, SearchInterface $b) => $a->getOrder() <=> $b->getOrder());
|
||||
uasort($this->hasAdvancedFormSearchServices, static function (HasAdvancedSearchFormInterface $a, HasAdvancedSearchFormInterface $b): int {
|
||||
return $a->getOrder() <=> $b->getOrder();
|
||||
});
|
||||
|
||||
return $this->hasAdvancedFormSearchServices;
|
||||
}
|
||||
|
Reference in New Issue
Block a user