Passed
Pull Request — master (#22)
by Théo
02:53
created

DummyBufferedHash::getPublicBufferedData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace KevinGH\Box\Signature;
6
7
use KevinGH\Box\Exception\SignatureException;
8
9
final class DummyBufferedHash extends BufferedHash
10
{
11
    /**
12
     * @inheritdoc
13
     */
14
    public function __construct(string $algorithm, string $path)
15
    {
16
    }
17
18
    /**
19
     * @inheritdoc
20
     */
21
    public function verify(string $signature): bool
22
    {
23
    }
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 boolean. 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...
24
25
    public function getPublicBufferedData(): string
26
    {
27
        return $this->getBufferedData();
28
    }
29
}