Obstacle::isBlocked()   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
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php declare(strict_types=1);
2
3
namespace Stratadox\Pathfinder\Graph\Builder;
4
5
use const INF;
6
7
final class Obstacle implements Field
8
{
9
    public static function here(): Field
10
    {
11
        return new self();
12
    }
13
14
    public function isBlocked(): bool
15
    {
16
        return true;
17
    }
18
19
    public function label(): string
20
    {
21
        return '';
22
    }
23
24
    public function price(): float
25
    {
26
        return INF;
27
    }
28
29
    public function costing(float $price): Field
30
    {
31
        return $this; // priceless
32
    }
33
}
34