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

IlluminateQuery   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 2
dl 0
loc 37
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getIlluminateQuery() 0 4 1
A getSQL() 0 4 1
A getCountInternal() 0 4 1
A getHandlerFactory() 0 4 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