diff --git a/Service/AutocompleteService.php b/Service/AutocompleteService.php index c4ba50a..14dc7f5 100644 --- a/Service/AutocompleteService.php +++ b/Service/AutocompleteService.php @@ -11,33 +11,17 @@ class AutocompleteService { - /** - * @var FormFactoryInterface - */ - private $formFactory; - - /** - * @var ManagerRegistry - */ - private $doctrine; - - /** - * @param FormFactoryInterface $formFactory - * @param ManagerRegistry $doctrine - */ + private FormFactoryInterface $formFactory; + + private ManagerRegistry $doctrine; + public function __construct(FormFactoryInterface $formFactory, ManagerRegistry $doctrine) { $this->formFactory = $formFactory; $this->doctrine = $doctrine; } - /** - * @param Request $request - * @param string|FormTypeInterface $type - * - * @return array - */ - public function getAutocompleteResults(Request $request, $type) + public function getAutocompleteResults(Request $request, string|FormTypeInterface $type): array { $form = $this->formFactory->create($type); $fieldOptions = $form->get($request->get('field_name'))->getConfig()->getOptions();