GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

QueryCommand::__construct()   A
last analyzed

Complexity

Conditions 4
Paths 8

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 12
rs 10
cc 4
nc 8
nop 6
1
<?php
2
3
namespace Psonic\Commands\Search;
4
5
use Psonic\Commands\Command;
6
7
final class QueryCommand extends Command
8
{
9
    private $command    = 'QUERY';
10
    private $parameters = [];
11
12
    /**
13
     * QueryCommand constructor.
14
     * @param string $collection
15
     * @param string $bucket
16
     * @param string $terms
17
     * @param null $limit
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $limit is correct as it would always require null to be passed?
Loading history...
18
     * @param null $offset
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $offset is correct as it would always require null to be passed?
Loading history...
19
     * @param null $locale
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $locale is correct as it would always require null to be passed?
Loading history...
20
     */
21
    public function __construct(string $collection, string $bucket, string $terms, $limit = null, $offset = null, $locale = null)
22
    {
23
        $this->parameters = [
24
            'collection' => $collection,
25
            'bucket'     => $bucket,
26
            'terms'      => self::wrapInQuotes($terms),
0 ignored issues
show
Bug Best Practice introduced by
The method Psonic\Commands\Command::wrapInQuotes() is not static, but was called statically. ( Ignorable by Annotation )

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

26
            'terms'      => self::/** @scrutinizer ignore-call */ wrapInQuotes($terms),
Loading history...
27
            'limit'      => $limit ? "LIMIT($limit)": null,
0 ignored issues
show
introduced by
$limit is of type null, thus it always evaluated to false.
Loading history...
28
            'offset'     => $offset ? "OFFSET($offset)": null,
0 ignored issues
show
introduced by
$offset is of type null, thus it always evaluated to false.
Loading history...
29
            'locale'     => $locale ? "LANG($locale)": null,
0 ignored issues
show
introduced by
$locale is of type null, thus it always evaluated to false.
Loading history...
30
        ];
31
32
        parent::__construct($this->command, $this->parameters);
33
    }
34
}
35