Issues (74)

Query/Suggest/Solarium/RequestBuilder.php (5 issues)

1
<?php
2
3
namespace Mdiyakov\DoctrineSolrBundle\Query\Suggest\Solarium;
4
5
use Solarium\Core\Client\Request;
6
use Solarium\Core\Query\RequestBuilder as BaseRequestBuilder;
7
use Solarium\Core\Query\QueryInterface;
8
9
class RequestBuilder extends BaseRequestBuilder
0 ignored issues
show
Deprecated Code introduced by
The class Solarium\Core\Query\RequestBuilder has been deprecated. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

9
class RequestBuilder extends /** @scrutinizer ignore-deprecated */ BaseRequestBuilder
Loading history...
10
{
11
12
    /**
13
     * @param QueryInterface|Query $query $query
14
     * @return Request
15
     */
16
    public function build(QueryInterface $query)
17
    {
18
        $request = parent::build($query);
19
        $request->addParam('suggest', 'true');
20
        $request->addParam('suggest.q', $query->getQuery());
0 ignored issues
show
The method getQuery() does not exist on Solarium\Core\Query\QueryInterface. It seems like you code against a sub-type of Solarium\Core\Query\QueryInterface such as Solarium\QueryType\Select\Query\Query or Solarium\QueryType\Analysis\Query\AbstractQuery or Solarium\QueryType\Suggester\Query or Mdiyakov\DoctrineSolrBun...\Suggest\Solarium\Query. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

20
        $request->addParam('suggest.q', $query->/** @scrutinizer ignore-call */ getQuery());
Loading history...
21
22
        foreach ($query->getDictionaries() as $dictionary) {
0 ignored issues
show
The method getDictionaries() does not exist on Solarium\Core\Query\QueryInterface. It seems like you code against a sub-type of Solarium\Core\Query\QueryInterface such as Mdiyakov\DoctrineSolrBun...\Suggest\Solarium\Query. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

22
        foreach ($query->/** @scrutinizer ignore-call */ getDictionaries() as $dictionary) {
Loading history...
23
            $request->addParam('suggest.dictionary', $dictionary);
24
        }
25
26
        $request->addParam('suggest.count', $query->getCount());
0 ignored issues
show
The method getCount() does not exist on Solarium\Core\Query\QueryInterface. It seems like you code against a sub-type of Solarium\Core\Query\QueryInterface such as Solarium\QueryType\Suggester\Query or Mdiyakov\DoctrineSolrBun...\Suggest\Solarium\Query. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

26
        $request->addParam('suggest.count', $query->/** @scrutinizer ignore-call */ getCount());
Loading history...
27
        $request->addParam('suggest.cfq', $query->getContextFieldQuery());
0 ignored issues
show
The method getContextFieldQuery() does not exist on Solarium\Core\Query\QueryInterface. It seems like you code against a sub-type of Solarium\Core\Query\QueryInterface such as Mdiyakov\DoctrineSolrBun...\Suggest\Solarium\Query. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

27
        $request->addParam('suggest.cfq', $query->/** @scrutinizer ignore-call */ getContextFieldQuery());
Loading history...
28
29
        return $request;
30
    }
31
}