Smile-SA/elasticsuite

View on GitHub
src/module-elasticsuite-core/Search/Request.php

Summary

Maintainability
A
3 hrs
Test Coverage

Request has 11 functions (exceeds 10 allowed). Consider refactoring.
Open

class Request extends \Magento\Framework\Search\Request implements RequestInterface
{
    /**
     * @var SortOrderInterface
     */
Severity: Minor
Found in src/module-elasticsuite-core/Search/Request.php - About 2 hrs to fix

    Method __construct has 12 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            $name,
            $indexName,
            QueryInterface $query,
            QueryInterface $filter = null,
            array $sortOrders = null,
    Severity: Major
    Found in src/module-elasticsuite-core/Search/Request.php - About 1 hr to fix

      Assigning string to property but \Smile\ElasticsuiteCore\Search\Request->spellingType is int
      Open

                  $this->spellingType = $spellingType;

      Assigning ?array to property but \Smile\ElasticsuiteCore\Search\Request->sortOrders is \Smile\ElasticsuiteCore\Search\Request\SortOrderInterface
      Open

              $this->sortOrders = $sortOrders;

      Doc-block of $sortOrders in __construct is phpdoc param type \Smile\ElasticsuiteCore\Search\Request\SortOrderInterface[] which is not a permitted replacement of the nullable param type ?array declared in the signature ('?T' should be documented as 'T|null' or '?T')
      Open

           * @param SortOrderInterface[] $sortOrders     Sort orders specification.

      Assigning ?\Magento\Framework\Search\Request\QueryInterface to property but \Smile\ElasticsuiteCore\Search\Request->filter is \Magento\Framework\Search\Request\QueryInterface
      Open

              $this->filter = $filter;

      Returning type int but getSpellingType() is declared to return string
      Open

              return $this->spellingType;

      Doc-block of $filter in __construct is phpdoc param type \Magento\Framework\Search\Request\QueryInterface which is not a permitted replacement of the nullable param type ?\Magento\Framework\Search\Request\QueryInterface declared in the signature ('?T' should be documented as 'T|null' or '?T')
      Open

           * @param QueryInterface       $filter         Search filter.

      Returning type \Smile\ElasticsuiteCore\Search\Request\SortOrderInterface but getSortOrders() is declared to return \Smile\ElasticsuiteCore\Search\Request\SortOrderInterface[]
      Open

              return $this->sortOrders;

      There are no issues that match your filters.

      Category
      Status