Commit 44e436f7 authored by Florent Torregrosa's avatar Florent Torregrosa Committed by Florent Torregrosa
Browse files

Issue #3289218 by Grimreaper: Fix PHPCS Fixer, PHPMND, PHPCS.

parent 307b6ff6
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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...).
@@ -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);
}

/**
+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:
+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'
+2 −6
Original line number Diff line number Diff line
@@ -14,8 +14,6 @@ use Symfony\Component\HttpFoundation\RequestStack;

/**
 * Controller which renders the search page content.
 *
 * @package Drupal\Controller\Controller
 */
class QwantSearchController extends ControllerBase {

@@ -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);
  }

  /**
+2 −5
Original line number Diff line number Diff line
@@ -13,8 +13,6 @@ use Symfony\Component\HttpFoundation\RequestStack;

/**
 * Class Settings.
 *
 * @package Drupal\qwantsearch\Form
 */
class SearchForm extends FormBase {

@@ -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