Completed
Push — master ( ceb768...54758a )
by Andrii
03:05
created

SearchCommand::getQueryOptions()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 7
ccs 0
cts 7
cp 0
rs 9.4285
cc 2
eloc 4
nc 2
nop 0
crap 6
1
<?php
2
3
namespace hiapi\commands;
4
5
class SearchCommand extends BaseCommand
6
{
7
    protected static $handler = SearchHandler::class;
8
9
    public $select;
10
    public $where;
11
    public $limit;
12
13
    public function rules()
14
    {
15
        return [
16
            ['select', 'safe'],
17
            ['where', 'safe'],
18
            ['limit', 'number', 'max' => 100],
19
        ];
20
    }
21
22
    public function getQueryOptions()
23
    {
24
        return [
25
            'where' => $this->where,
26
            'limit' => $this->limit ?: 25,
27
        ];
28
    }
29
}
30