| Total Complexity | 2 |
| Total Lines | 27 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | class DefaultWeightedEdge extends DefaultEdge |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * Weight of the edge |
||
| 17 | * |
||
| 18 | * @var float |
||
| 19 | */ |
||
| 20 | protected $weight = GraphInterface::DEFAULT_EDGE_WEIGHT; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Get weight of the edge |
||
| 24 | * |
||
| 25 | * @return null|float |
||
| 26 | */ |
||
| 27 | 9 | public function getWeight(): ?float |
|
| 28 | { |
||
| 29 | 9 | return $this->weight; |
|
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Set the weight of the edge |
||
| 34 | * |
||
| 35 | * @param float $weight - the edge weight |
||
| 36 | */ |
||
| 37 | 10 | public function setWeight(?float $weight = null): void |
|
| 40 | 10 | } |
|
| 41 | } |
||
| 42 |