BinarySorter   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 14
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
1
<?php
2
/**
3
 * Spiral Framework.
4
 *
5
 * @license   MIT
6
 * @author    Anton Titov (Wolfy-J)
7
 */
8
namespace Spiral\Listing\Sorters;
9
10
use Spiral\Listing\Dependency;
11
12
class BinarySorter extends ComplexSorter
13
{
14
    /**
15
     * @param string $expression Expression or column
16
     * @param array|Dependency  $dependencies
17
     */
18
    public function __construct($expression, $dependencies = [])
19
    {
20
        parent::__construct(
21
            new UnarySorter([$expression => self::ASC], $dependencies),
22
            new UnarySorter([$expression => self::DESC], $dependencies)
23
        );
24
    }
25
}