NoRelationHandler   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 10
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getSortProperty() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Bugloos\QuerySortingBundle\SortingHandler;
6
7
use Bugloos\QuerySortingBundle\SortingHandler\Contract\AbstractSortingHandler;
8
9
/**
10
 * @author Milad Ghofrani <[email protected]>
11
 */
12
class NoRelationHandler extends AbstractSortingHandler
13
{
14
    public function getSortProperty($rootAlias, $rootClass, $relationsAndFieldName): string
15
    {
16
        $alias = $rootAlias;
17
        $field = $relationsAndFieldName[0];
18
19
        $this->validateFieldNames($field, $rootClass);
20
21
        return $this->createOrderBySyntax($alias, $field);
22
    }
23
}
24