| Total Complexity | 6 |
| Total Lines | 76 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class Edge implements EdgeInterface |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var non-empty-string |
||
|
|
|||
| 11 | */ |
||
| 12 | protected string $id; |
||
| 13 | /** |
||
| 14 | * @var non-empty-string |
||
| 15 | */ |
||
| 16 | protected string $type; |
||
| 17 | /** |
||
| 18 | * @var non-empty-string |
||
| 19 | */ |
||
| 20 | protected string $fromId; |
||
| 21 | /** |
||
| 22 | * @var non-empty-string |
||
| 23 | */ |
||
| 24 | protected string $toId; |
||
| 25 | /** |
||
| 26 | * @var float |
||
| 27 | */ |
||
| 28 | protected float $weight; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @param non-empty-string $id |
||
| 32 | * @param non-empty-string $type |
||
| 33 | * @param non-empty-string $fromId |
||
| 34 | * @param non-empty-string $toId |
||
| 35 | */ |
||
| 36 | public function __construct(string $id, string $type, string $fromId, string $toId, float $weight = 1) |
||
| 37 | { |
||
| 38 | $this->id = $id; |
||
| 39 | $this->type = $type; |
||
| 40 | $this->fromId = $fromId; |
||
| 41 | $this->toId = $toId; |
||
| 42 | $this->weight = $weight; |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @inheritDoc |
||
| 47 | */ |
||
| 48 | public function getId(): string |
||
| 49 | { |
||
| 50 | return $this->id; |
||
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @inheritDoc |
||
| 55 | */ |
||
| 56 | public function getType(): string |
||
| 57 | { |
||
| 58 | return $this->type; |
||
| 59 | } |
||
| 60 | |||
| 61 | /** |
||
| 62 | * @inheritDoc |
||
| 63 | */ |
||
| 64 | public function getFromId(): string |
||
| 65 | { |
||
| 66 | return $this->fromId; |
||
| 67 | } |
||
| 68 | |||
| 69 | /** |
||
| 70 | * @inheritDoc |
||
| 71 | */ |
||
| 72 | public function getToId(): string |
||
| 75 | } |
||
| 76 | |||
| 77 | /** |
||
| 78 | * @inheritDoc |
||
| 79 | */ |
||
| 80 | public function getWeight(): float |
||
| 83 | } |
||
| 84 | } |
||
| 85 |