| 1 | <?php |
||
| 18 | class Connection extends BuildableAbstract implements JsonSerializable |
||
| 19 | { |
||
| 20 | /** |
||
| 21 | * @var string[] $allowedGet |
||
| 22 | */ |
||
| 23 | protected $allowedGet = array('from', 'to', 'weight'); |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @var Node $from |
||
| 27 | */ |
||
| 28 | protected $from; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @var Node $to |
||
| 32 | */ |
||
| 33 | protected $to; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @var float|null $weight |
||
| 37 | */ |
||
| 38 | protected $weight; |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Connection constructor. |
||
| 42 | * @param Node $from |
||
| 43 | * @param Node $to |
||
| 44 | * @param float|null $weight |
||
| 45 | */ |
||
| 46 | public function __construct(Node $from, Node $to, float $weight = null) |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @return array |
||
| 57 | */ |
||
| 58 | public function jsonSerialize() : array |
||
| 74 | } |