Skip to content

Commit

Permalink
Conform structure functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Edofre committed Jan 17, 2017
1 parent 155998c commit 405e22e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/NsApi.php
Expand Up @@ -48,8 +48,8 @@ public function __construct(array $config = [])
*/
public function getStations()
{
$result = $this->makeRequest(self::ENDPOINT_STATIONS);
$stations = new Collection();
$result = $this->makeRequest(self::ENDPOINT_STATIONS);

if ($result->getStatusCode() == self::HTTP_SUCCESS) {
$xml = simplexml_load_string($result->getBody()->getContents());
Expand Down Expand Up @@ -86,13 +86,13 @@ private function makeRequest($request, $options = [])
*/
public function getDepartures(Station $station)
{
$departing_trains = new Collection();
$result = $this->makeRequest(self::ENDPOINT_DEPARTURES, [
'query' => [
'station' => $station->code,
],
]);

$departing_trains = new Collection();
if ($result->getStatusCode() == self::HTTP_SUCCESS) {
$xml = simplexml_load_string($result->getBody()->getContents());
foreach ($xml as $xml_item) {
Expand Down

0 comments on commit 405e22e

Please sign in to comment.