Obstacle   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
eloc 6
c 1
b 0
f 0
dl 0
loc 25
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A isBlocked() 0 3 1
A here() 0 3 1
A price() 0 3 1
A label() 0 3 1
A costing() 0 3 1
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