Test Setup Failed
Push — master ( 3ef048...5fd193 )
by Vitaliy
02:08
created

SortHandler   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 1
cbo 4
dl 0
loc 17
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A applyInternal() 0 9 1
1
<?php
2
3
namespace Nayjest\Querying\Handler\DoctrineDBAL;
4
5
use Nayjest\Querying\Handler\AbstractHandler;
6
use Doctrine\DBAL\Query\QueryBuilder;
7
use Nayjest\Querying\Operation\SortOperation;
8
9
/**
10
 * SortOperation handler for Doctrine.
11
 *
12
 * @see SortOperation
13
 */
14
class SortHandler extends AbstractHandler
15
{
16
    use DatabaseOperationHandlerTrait;
17
18
    /**
19
     * @param QueryBuilder $queryBuilder
20
     */
21
    protected function applyInternal(QueryBuilder $queryBuilder)
22
    {
23
        /** @var SortOperation $operation */
24
        $operation = $this->operation;
25
        $queryBuilder->orderBy(
26
            $operation->getField(),
27
            $operation->getOrder()
28
        );
29
    }
30
}
31