Skip to content

Commit b6aafd3

Browse files
committed
Add convenience methods
1 parent b05260f commit b6aafd3

2 files changed

Lines changed: 32 additions & 3 deletions

File tree

src/Trafiklab/Common/Model/Contract/RoutePlanningLeg.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,23 @@ interface RoutePlanningLeg
1717
/**
1818
* The origin of this leg.
1919
*
20-
* @return VehicleStop The first vehicle stop, with at which this leg starts.
20+
* @return VehicleStop The first vehicle stop, with which this leg starts.
2121
*/
22-
public function getOrigin(): VehicleStop;
22+
public function getDeparture(): VehicleStop;
2323

2424
/**
2525
* The destination of this leg.
2626
*
2727
* @return VehicleStop The last vehicle stop, with which this leg ends.
2828
*/
29-
public function getDestination(): VehicleStop;
29+
public function getArrival(): VehicleStop;
30+
31+
/**
32+
* Get the duration of this leg in seconds.
33+
* @return int
34+
*/
35+
public function getDuration(): int;
36+
3037

3138
/**
3239
* Remarks about this leg, for example describing facilities on board of a train, or possible disturbances on the

src/Trafiklab/Common/Model/Contract/Trip.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,26 @@ interface Trip
2020
* @return RoutePlanningLeg[] An array containing the legs in this Trip.
2121
*/
2222
public function getLegs(): array;
23+
24+
/**
25+
* Get the duration of this trip in seconds.
26+
*
27+
* @return int
28+
*/
29+
public function getDuration(): int;
30+
31+
/**
32+
* Get the departure for the first leg.
33+
*
34+
* @return VehicleStop
35+
*/
36+
public function getDeparture(): VehicleStop;
37+
38+
/**
39+
* Get the arrival for the last leg.
40+
*
41+
* @return VehicleStop
42+
*/
43+
public function getArrival(): VehicleStop;
44+
2345
}

0 commit comments

Comments
 (0)