Skip to content

Commit

Permalink
Fix some method parameters not accepting null
Browse files Browse the repository at this point in the history
  • Loading branch information
Bertware committed May 16, 2019
1 parent f3a7f31 commit aae97c1
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions src/Trafiklab/ResRobot/ResRobotWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Trafiklab\ResRobot;

use InvalidArgumentException;
use Trafiklab\Common\Model\Contract\PublicTransportApiWrapper;
use Trafiklab\Common\Model\Contract\RoutePlanningRequest;
use Trafiklab\Common\Model\Contract\RoutePlanningResponse;
Expand Down Expand Up @@ -33,17 +34,28 @@ public function __construct()
$this->_resrobotClient = new ResRobotClient();
}

public function setRoutePlanningApiKey(string $key): void
public function setRoutePlanningApiKey(?string $key): void
{
$this->_key_reseplanerare = $key;
}

public function setTimeTablesApiKey(string $key): void
public function setTimeTablesApiKey(?string $key): void
{
$this->_key_stolptidstabeller = $key;
}

public function setUserAgent(string $userAgent): void
/**
* Set the API key used for looking up stop locations. For ResRobot this key is the same as the key used for
* route-planning.
*
* @param string $apiKey The API key to use.
*/
public function setStopLocationLookupApiKey(?string $apiKey): void
{
$this->_key_reseplanerare = $apiKey;
}

public function setUserAgent(?string $userAgent): void
{
$this->_resrobotClient->setApplicationUserAgent($userAgent);
}
Expand Down Expand Up @@ -90,17 +102,6 @@ public function getRoutePlanning(RoutePlanningRequest $request): RoutePlanningRe
return $this->_resrobotClient->getRoutePlanning($this->_key_reseplanerare, $request);
}

/**
* Set the API key used for looking up stop locations. For ResRobot this key is the same as the key used for
* route-planning.
*
* @param string $apiKey The API key to use.
*/
public function setStopLocationLookupApiKey(string $apiKey): void
{
$this->_key_reseplanerare = $apiKey;
}

/**
* Get a route-planning between two points.
*
Expand Down

0 comments on commit aae97c1

Please sign in to comment.