NoSorting   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

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

6 Methods

Rating   Name   Duplication   Size   Complexity  
A isRequired() 0 3 1
A __construct() 0 2 1
A field() 0 3 1
A needed() 0 3 1
A next() 0 3 1
A ascends() 0 3 1
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