Unhealthy::getStatus()   A
last analyzed

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
3
declare(strict_types=1);
4
5
namespace Cushon\HealthBundle\Message\Result\HealthCheck;
6
7
use Cushon\HealthBundle\ApplicationHealth\HealthReport\DependencyStatus;
8
use Cushon\HealthBundle\Message\Result\HealthCheck;
9
use Cushon\HealthBundle\Message\Result\Traits\DependencyTrait;
10
use Cushon\HealthBundle\Message\Result\Traits\JsonSerializableTrait;
11
use Ds\Set;
12
13
final class Unhealthy implements HealthCheck
14
{
15
    use DependencyTrait;
16
    use JsonSerializableTrait;
17
18
    /**
19
     * @param DependencyStatus ...$dependencies
20
     */
21
    public function __construct(DependencyStatus ...$dependencies)
22
    {
23
        $this->dependencies = new Set($dependencies);
24
    }
25
26
    /**
27
     * @return iterable<DependencyStatus>
28
     */
29
    public function __invoke(): iterable
30
    {
31
        return $this->dependencies();
32
    }
33
34
    /**
35
     * @inheritDoc
36
     */
37
    public function isHealthy(): bool
38
    {
39
        return false;
40
    }
41
42
    /**
43
     * @return string
44
     * @SuppressWarnings(PHPMD.UnusedPrivateMethod) Comes from the Trait which PHPMD cannot detect
45
     * @psalm-return 'unhealthy'
46
     */
47
    private function getStatus(): string
0 ignored issues
show
Unused Code introduced by
The method getStatus() is not used, and could be removed.

This check looks for private methods that have been defined, but are not used inside the class.

Loading history...
48
    {
49
        return self::STATUS_UNHEALTHY;
50
    }
51
}
52