diff --git a/src/AbstractRequest.php b/src/AbstractRequest.php index 8e587ba..3239fbe 100644 --- a/src/AbstractRequest.php +++ b/src/AbstractRequest.php @@ -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; @@ -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); diff --git a/src/Journey.php b/src/Journey.php index 35a136e..2d9d968 100644 --- a/src/Journey.php +++ b/src/Journey.php @@ -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';