StaticExample::printSolution()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 5
c 0
b 0
f 0
dl 0
loc 10
ccs 6
cts 6
cp 1
rs 10
cc 1
nc 1
nop 3
crap 1
1
<?php
2
3
namespace JMGQ\AStar\Example\Terrain;
4
5
use JMGQ\AStar\AStar;
6
7
class StaticExample
8
{
9 5
    public static function printSolution(TerrainCost $terrainCost, Position $start, Position $goal): void
10
    {
11 5
        $domainLogic = new DomainLogic($terrainCost);
12 5
        $aStar = new AStar($domainLogic);
13
14 5
        $solution = $aStar->run($start, $goal);
15
16 5
        $printer = new SequencePrinter($terrainCost, $solution);
17
18 5
        $printer->printSequence();
19 5
    }
20
}
21