Skip to content

Commit 5680784

Browse files
committed
Journey details retrival - fixes #12
1 parent 1899a04 commit 5680784

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/AbstractRequest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

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

127127
abstract protected function getUrl(): string;
128128

129-
private function makeUrl(): string
129+
protected function makeUrl(): string
130130
{
131131
$query = array_merge(['format' => 'json'], $this->getQuery());
132132
$query = http_build_query($query);

src/Journey.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ protected function configure(OptionsResolver $resolver): void
3434
$resolver->setRequired(['ref']);
3535
}
3636

37+
protected function makeUrl(): string
38+
{
39+
return sprintf('%s%s', self::BASE_URL, $this->options['ref']);
40+
}
41+
3742
protected function getUrl(): string
3843
{
3944
return 'journeyDetails';

0 commit comments

Comments
 (0)