DoNotSort::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 0
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 2
rs 10
1
<?php
2
declare(strict_types=1);
3
4
namespace Stratadox\Sorting;
5
6
use Stratadox\Sorting\Contracts\Sorting;
7
8
/**
9
 * Do not sort at all.
10
 *
11
 * Null object, used to define that no sorting should take place.
12
 *
13
 * @author  Stratadox
14
 * @package Stratadox\Sorting
15
 * @deprecated use NoSorting::needed() instead.
16
 * @see NoSorting
17
 */
18
final class DoNotSort implements Sorting
19
{
20
    private function __construct()
21
    {
22
    }
23
24
    /** @deprecated */
25
    public static function atAll(): Sorting
26
    {
27
        return new DoNotSort;
0 ignored issues
show
Deprecated Code introduced by
The class Stratadox\Sorting\DoNotSort has been deprecated: use NoSorting::needed() instead. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

27
        return /** @scrutinizer ignore-deprecated */ new DoNotSort;
Loading history...
28
    }
29
30
    public function field(): string
31
    {
32
        return '';
33
    }
34
35
    public function next(): Sorting
36
    {
37
        return $this;
38
    }
39
40
    public function ascends(): bool
41
    {
42
        return false;
43
    }
44
45
    public function isRequired(): bool
46
    {
47
        return false;
48
    }
49
}
50