Completed
Push — master ( 4dad64...57defb )
by Jesse
02:01
created

NoSorting::ascends()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
declare(strict_types=1);
3
4
namespace Stratadox\Sorting;
5
6
use Stratadox\Sorting\Contracts\Sorting;
7
8
/**
9
 * No sorting required.
10
 *
11
 * Null object, used to define that no sorting should take place.
12
 *
13
 * @author  Stratadox
14
 * @package Stratadox\Sorting
15
 */
16
final class NoSorting implements Sorting
17
{
18
    private function __construct()
19
    {
20
    }
21
22
    public static function needed(): Sorting
23
    {
24
        return new NoSorting;
25
    }
26
27
    public function field(): string
28
    {
29
        return '';
30
    }
31
32
    public function next(): Sorting
33
    {
34
        return $this;
35
    }
36
37
    public function ascends(): bool
38
    {
39
        return false;
40
    }
41
42
    public function isRequired(): bool
43
    {
44
        return false;
45
    }
46
}
47