Passed
Push — develop ( eaa894...ad515c )
by Baptiste
01:56
created

Trashed   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Test Coverage

Coverage 54.55%

Importance

Changes 0
Metric Value
dl 0
loc 47
ccs 6
cts 11
cp 0.5455
rs 10
c 0
b 0
f 0
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A or() 0 2 1
A value() 0 3 1
A sign() 0 3 1
A property() 0 3 1
A not() 0 2 1
A and() 0 2 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace PersonalGalaxy\Files\Specification;
5
6
use Innmind\Specification\{
7
    ComparatorInterface,
8
    CompositeInterface,
9
    SpecificationInterface,
10
    NotInterface,
11
};
12
13
final class Trashed implements ComparatorInterface
14
{
15
     /**
16
     * {@inheritdoc}
17
     */
18 1
    public function property(): string
19
    {
20 1
        return 'trashed';
21
    }
22
23
    /**
24
     * {@inheritdoc}
25
     */
26 1
    public function sign(): string
27
    {
28 1
        return '=';
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34 1
    public function value()
35
    {
36 1
        return true;
37
    }
38
39
    /**
40
     * {@inheritdoc}
41
     */
42
    public function and(SpecificationInterface $specification): CompositeInterface
43
    {
44
        //not implemented
45
    }
1 ignored issue
show
Bug Best Practice introduced by
In this branch, the function will implicitly return null which is incompatible with the type-hinted return Innmind\Specification\CompositeInterface. Consider adding a return statement or allowing null as return value.

For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example:

interface ReturnsInt {
    public function returnsIntHinted(): int;
}

class MyClass implements ReturnsInt {
    public function returnsIntHinted(): int
    {
        if (foo()) {
            return 123;
        }
        // here: null is implicitly returned
    }
}
Loading history...
46
47
    /**
48
     * {@inheritdoc}
49
     */
50
    public function or(SpecificationInterface $specification): CompositeInterface
51
    {
52
        //not implemented
53
    }
1 ignored issue
show
Bug Best Practice introduced by
In this branch, the function will implicitly return null which is incompatible with the type-hinted return Innmind\Specification\CompositeInterface. Consider adding a return statement or allowing null as return value.

For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example:

interface ReturnsInt {
    public function returnsIntHinted(): int;
}

class MyClass implements ReturnsInt {
    public function returnsIntHinted(): int
    {
        if (foo()) {
            return 123;
        }
        // here: null is implicitly returned
    }
}
Loading history...
54
55
    /**
56
     * {@inheritdoc}
57
     */
58
    public function not(): NotInterface
59
    {
60
        //not implemented
61
    }
1 ignored issue
show
Bug Best Practice introduced by
In this branch, the function will implicitly return null which is incompatible with the type-hinted return Innmind\Specification\NotInterface. Consider adding a return statement or allowing null as return value.

For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example:

interface ReturnsInt {
    public function returnsIntHinted(): int;
}

class MyClass implements ReturnsInt {
    public function returnsIntHinted(): int
    {
        if (foo()) {
            return 123;
        }
        // here: null is implicitly returned
    }
}
Loading history...
62
}
63