Loading qwantsearch.api.php +3 −3 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ function hook_qwantsearch_result_thumbnail_alter(array &$variables) { } /** * Allows user to alter search result (title, snippet...) * Allows user to alter search result (title, snippet...). * * @param array $renderable_result * Variables to alter (snippet, title...). Loading @@ -33,8 +33,8 @@ function hook_qwantsearch_result_thumbnail_alter(array &$variables) { * Result row from Qwant. */ function hook_qwantsearch_search_result_alter(array &$renderable_result, array $row) { $renderable_result['#title'] = strtoupper(strip_tags(html_entity_decode($row['title'], ENT_QUOTES))); $renderable_result['#snippet'] = substr(strip_tags(html_entity_decode($row['desc'], ENT_QUOTES)), 125); $renderable_result['#title'] = strtoupper(strip_tags(html_entity_decode($row['title'], \ENT_QUOTES))); $renderable_result['#snippet'] = substr(strip_tags(html_entity_decode($row['desc'], \ENT_QUOTES)), (int) 125); } /** Loading qwantsearch.info.yml +1 −1 Original line number Diff line number Diff line name: 'Qwantsearch' type: module description: 'Provides integration with Qwant search engine.' core_version_requirement: ^8.8 || ^9 || ^10 core_version_requirement: ^9 || ^10 package: 'Search' configure: qwantsearch.configure dependencies: Loading qwantsearch.services.yml +7 −3 Original line number Diff line number Diff line services: qwantsearch.qwantsearch: class: Drupal\qwantsearch\Service\QwantSearch arguments: ["@config.factory"] arguments: - '@config.factory' qwantsearch.searchpage_routing: class: Drupal\qwantsearch\Service\SearchPageRouting arguments: ["@config.factory"] arguments: - '@config.factory' qwantsearch.display: class: Drupal\qwantsearch\Service\QwantSearchDisplay arguments: ["@config.factory", "@module_handler"] arguments: - '@config.factory' - '@module_handler' src/Controller/QwantSearchController.php +2 −6 Original line number Diff line number Diff line Loading @@ -14,8 +14,6 @@ use Symfony\Component\HttpFoundation\RequestStack; /** * Controller which renders the search page content. * * @package Drupal\Controller\Controller */ class QwantSearchController extends ControllerBase { Loading Loading @@ -94,9 +92,7 @@ class QwantSearchController extends ControllerBase { } // @phpstan-ignore-next-line $content = $this->qwantDisplay->prepareRenderableResults($response->data->results); return $content; return $this->qwantDisplay->prepareRenderableResults($response->data->results); } /** Loading src/Form/SearchForm.php +2 −5 Original line number Diff line number Diff line Loading @@ -13,8 +13,6 @@ use Symfony\Component\HttpFoundation\RequestStack; /** * Class Settings. * * @package Drupal\qwantsearch\Form */ class SearchForm extends FormBase { Loading Loading @@ -66,7 +64,6 @@ class SearchForm extends FormBase { * {@inheritdoc} */ public function buildForm(array $form, FormStateInterface $form_state) { $form['search'] = [ '#type' => 'textfield', '#default_value' => $this->request->get('search'), Loading Loading
qwantsearch.api.php +3 −3 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ function hook_qwantsearch_result_thumbnail_alter(array &$variables) { } /** * Allows user to alter search result (title, snippet...) * Allows user to alter search result (title, snippet...). * * @param array $renderable_result * Variables to alter (snippet, title...). Loading @@ -33,8 +33,8 @@ function hook_qwantsearch_result_thumbnail_alter(array &$variables) { * Result row from Qwant. */ function hook_qwantsearch_search_result_alter(array &$renderable_result, array $row) { $renderable_result['#title'] = strtoupper(strip_tags(html_entity_decode($row['title'], ENT_QUOTES))); $renderable_result['#snippet'] = substr(strip_tags(html_entity_decode($row['desc'], ENT_QUOTES)), 125); $renderable_result['#title'] = strtoupper(strip_tags(html_entity_decode($row['title'], \ENT_QUOTES))); $renderable_result['#snippet'] = substr(strip_tags(html_entity_decode($row['desc'], \ENT_QUOTES)), (int) 125); } /** Loading
qwantsearch.info.yml +1 −1 Original line number Diff line number Diff line name: 'Qwantsearch' type: module description: 'Provides integration with Qwant search engine.' core_version_requirement: ^8.8 || ^9 || ^10 core_version_requirement: ^9 || ^10 package: 'Search' configure: qwantsearch.configure dependencies: Loading
qwantsearch.services.yml +7 −3 Original line number Diff line number Diff line services: qwantsearch.qwantsearch: class: Drupal\qwantsearch\Service\QwantSearch arguments: ["@config.factory"] arguments: - '@config.factory' qwantsearch.searchpage_routing: class: Drupal\qwantsearch\Service\SearchPageRouting arguments: ["@config.factory"] arguments: - '@config.factory' qwantsearch.display: class: Drupal\qwantsearch\Service\QwantSearchDisplay arguments: ["@config.factory", "@module_handler"] arguments: - '@config.factory' - '@module_handler'
src/Controller/QwantSearchController.php +2 −6 Original line number Diff line number Diff line Loading @@ -14,8 +14,6 @@ use Symfony\Component\HttpFoundation\RequestStack; /** * Controller which renders the search page content. * * @package Drupal\Controller\Controller */ class QwantSearchController extends ControllerBase { Loading Loading @@ -94,9 +92,7 @@ class QwantSearchController extends ControllerBase { } // @phpstan-ignore-next-line $content = $this->qwantDisplay->prepareRenderableResults($response->data->results); return $content; return $this->qwantDisplay->prepareRenderableResults($response->data->results); } /** Loading
src/Form/SearchForm.php +2 −5 Original line number Diff line number Diff line Loading @@ -13,8 +13,6 @@ use Symfony\Component\HttpFoundation\RequestStack; /** * Class Settings. * * @package Drupal\qwantsearch\Form */ class SearchForm extends FormBase { Loading Loading @@ -66,7 +64,6 @@ class SearchForm extends FormBase { * {@inheritdoc} */ public function buildForm(array $form, FormStateInterface $form_state) { $form['search'] = [ '#type' => 'textfield', '#default_value' => $this->request->get('search'), Loading