| 1 | <?php |
||
| 7 | class Station implements StationInterface |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Station's id. |
||
| 11 | * |
||
| 12 | * @var int |
||
| 13 | */ |
||
| 14 | private $id; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Station's name. |
||
| 18 | * |
||
| 19 | * @var string |
||
| 20 | */ |
||
| 21 | private $name; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Create a new instance of Station. |
||
| 25 | * |
||
| 26 | * @param int $id |
||
| 27 | * @param string $name |
||
| 28 | */ |
||
| 29 | 6 | public function __construct($id, $name = null) |
|
| 34 | |||
| 35 | /** |
||
| 36 | * Get station's id. |
||
| 37 | * |
||
| 38 | * @return int |
||
| 39 | */ |
||
| 40 | 4 | public function id() |
|
| 44 | |||
| 45 | /** |
||
| 46 | * Get station's name. |
||
| 47 | * |
||
| 48 | * @return string|null |
||
| 49 | */ |
||
| 50 | 3 | public function name() |
|
| 54 | } |
||
| 55 |