Skip to content

Commit

Permalink
Journey details retrival - fixes #12
Browse files Browse the repository at this point in the history
  • Loading branch information
lsv committed Jan 26, 2022
1 parent 1899a04 commit 5680784
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/AbstractRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

abstract class AbstractRequest implements Request
{
private const BASE_URL = 'https://xmlopen.rejseplanen.dk/bin/rest.exe/';
protected const BASE_URL = 'https://xmlopen.rejseplanen.dk/bin/rest.exe/';
private const API_NAME = 'rejseplan_php_api';
private const API_VERSION = '3.0';
private const USER_AGENT = self::API_NAME.'/'.self::API_VERSION;
Expand Down Expand Up @@ -126,7 +126,7 @@ abstract protected function configure(OptionsResolver $resolver): void;

abstract protected function getUrl(): string;

private function makeUrl(): string
protected function makeUrl(): string
{
$query = array_merge(['format' => 'json'], $this->getQuery());
$query = http_build_query($query);
Expand Down
5 changes: 5 additions & 0 deletions src/Journey.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ protected function configure(OptionsResolver $resolver): void
$resolver->setRequired(['ref']);
}

protected function makeUrl(): string
{
return sprintf('%s%s', self::BASE_URL, $this->options['ref']);
}

protected function getUrl(): string
{
return 'journeyDetails';
Expand Down

0 comments on commit 5680784

Please sign in to comment.