| Total Complexity | 4 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 13 | final class BestFirstStrategyFactory implements SearchStrategyFactory |
||
| 14 | { |
||
| 15 | /** @var Heuristic */ |
||
| 16 | private $heuristic; |
||
| 17 | |||
| 18 | private function __construct(Heuristic $heuristic) |
||
| 19 | { |
||
| 20 | $this->heuristic = $heuristic; |
||
| 21 | } |
||
| 22 | |||
| 23 | public static function noHeuristic(): SearchStrategyFactory |
||
| 24 | { |
||
| 25 | return new self(new NullHeuristic()); |
||
| 26 | } |
||
| 27 | |||
| 28 | public static function withHeuristic(Heuristic $heuristic): SearchStrategyFactory |
||
| 29 | { |
||
| 30 | return new self($heuristic); |
||
| 31 | } |
||
| 32 | |||
| 33 | public function begin(Puzzle $puzzle): SearchStrategy |
||
| 36 | } |
||
| 37 | } |
||
| 38 |