Passed
Push — master ( 6028dd...89a59a )
by Vitaliy
02:15
created

IlluminateQuery::getCountInternal()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
nc 1
cc 1
eloc 2
nop 0
crap 1
1
<?php
2
3
namespace Nayjest\Querying;
4
5
use Exception;
6
use Illuminate\Database\Query\Builder;
7
use Nayjest\Querying\Handler\Illuminate\Factory;
8
use Nayjest\Querying\Row\ObjectRow;
9
10
class IlluminateQuery extends AbstractDatabaseQuery
11
{
12 3
    public function __construct(Builder $dataSource)
13
    {
14 3
        parent::__construct($dataSource, ObjectRow::class);
15 3
    }
16
17
    /**
18
     * @return Builder
19
     * @throws Exception
20
     */
21 2
    public function getIlluminateQuery()
22
    {
23 2
        return $this->getReadyQuery();
24
    }
25
26
    /**
27
     * @return string
28
     */
29 1
    public function getSQL()
30
    {
31 1
        return $this->getIlluminateQuery()->toSql();
32
    }
33
34
    /**
35
     * @return int
36
     */
37 1
    protected function getCountInternal()
38
    {
39 1
        return $this->getIlluminateQuery()->count();
40
    }
41
42 3
    protected function getHandlerFactory()
43
    {
44 3
        return new Factory();
45
    }
46
}
47