From 74a95775d0474d23af34133749ce96d63854652f Mon Sep 17 00:00:00 2001 From: Jacob Tobiasz Date: Wed, 20 Dec 2023 20:33:48 +0100 Subject: [PATCH] [Autocomplete] Update the setOptions method's signature --- .../src/Controller/EntityAutocompleteController.php | 2 +- src/Autocomplete/src/EntityAutocompleterInterface.php | 2 +- src/Autocomplete/src/Form/WrappedEntityTypeAutocompleter.php | 4 +--- .../Fixtures/Autocompleter/CustomProductAutocompleter.php | 5 +++++ 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Autocomplete/src/Controller/EntityAutocompleteController.php b/src/Autocomplete/src/Controller/EntityAutocompleteController.php index 79f0ad13159..8789fa59ce9 100644 --- a/src/Autocomplete/src/Controller/EntityAutocompleteController.php +++ b/src/Autocomplete/src/Controller/EntityAutocompleteController.php @@ -43,7 +43,7 @@ public function __invoke(string $alias, Request $request): Response } $extraOptions = $this->getExtraOptions($request); - $autocompleter = $autocompleter->setOptions([ + $autocompleter->setOptions([ 'extra_options' => $extraOptions, ]); diff --git a/src/Autocomplete/src/EntityAutocompleterInterface.php b/src/Autocomplete/src/EntityAutocompleterInterface.php index 31958f79943..5276c8c4e50 100644 --- a/src/Autocomplete/src/EntityAutocompleterInterface.php +++ b/src/Autocomplete/src/EntityAutocompleterInterface.php @@ -52,7 +52,7 @@ public function isGranted(Security $security): bool; /** * @param array $options */ - public function setOptions(array $options): self; + public function setOptions(array $options): void; /* * Return group_by option. diff --git a/src/Autocomplete/src/Form/WrappedEntityTypeAutocompleter.php b/src/Autocomplete/src/Form/WrappedEntityTypeAutocompleter.php index 72f5db3c386..9bebe245a57 100644 --- a/src/Autocomplete/src/Form/WrappedEntityTypeAutocompleter.php +++ b/src/Autocomplete/src/Form/WrappedEntityTypeAutocompleter.php @@ -170,10 +170,8 @@ private function getEntityMetadata(): EntityMetadata return $this->entityMetadata; } - public function setOptions(array $options): EntityAutocompleterInterface + public function setOptions(array $options): void { $this->options = $options; - - return $this; } } diff --git a/src/Autocomplete/tests/Fixtures/Autocompleter/CustomProductAutocompleter.php b/src/Autocomplete/tests/Fixtures/Autocompleter/CustomProductAutocompleter.php index 3ae0877a517..a5b0edb8084 100644 --- a/src/Autocomplete/tests/Fixtures/Autocompleter/CustomProductAutocompleter.php +++ b/src/Autocomplete/tests/Fixtures/Autocompleter/CustomProductAutocompleter.php @@ -63,4 +63,9 @@ public function getGroupBy(): mixed { return null; } + + public function setOptions(array $options): void + { + // left blank intentionally + } }