| Total Complexity | 4 |
| Total Lines | 24 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 5 | final class Road implements Edge |
||
| 6 | { |
||
| 7 | private $target; |
||
| 8 | private $cost; |
||
| 9 | |||
| 10 | private function __construct(string $target, float $cost) |
||
| 11 | { |
||
| 12 | $this->target = $target; |
||
| 13 | $this->cost = $cost; |
||
| 14 | } |
||
| 15 | |||
| 16 | public static function towards(string $target, float $cost): Edge |
||
| 17 | { |
||
| 18 | return new self($target, $cost); |
||
| 19 | } |
||
| 20 | |||
| 21 | public function target(): string |
||
| 22 | { |
||
| 23 | return $this->target; |
||
| 24 | } |
||
| 25 | |||
| 26 | public function cost(): float |
||
| 29 | } |
||
| 30 | } |
||
| 31 |