Adopt changes in master branch, add typehints
This commit is contained in:
@@ -38,11 +38,7 @@ class BookingUrlUtility
|
|||||||
const COOKIE_NAME_BPN = 'bpn_cookie';
|
const COOKIE_NAME_BPN = 'bpn_cookie';
|
||||||
const URL_BASE = 'https://bpn.ep-reisen.de/buspronet/maske_buchung.php';
|
const URL_BASE = 'https://bpn.ep-reisen.de/buspronet/maske_buchung.php';
|
||||||
|
|
||||||
/**
|
public static function generateUrl(array $options): string
|
||||||
* @param array $options
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public static function generateUrl(array $options)
|
|
||||||
{
|
{
|
||||||
$resolver = new OptionsResolver();
|
$resolver = new OptionsResolver();
|
||||||
$resolver->setDefined('paCode');
|
$resolver->setDefined('paCode');
|
||||||
@@ -87,11 +83,7 @@ class BookingUrlUtility
|
|||||||
return static::buildUrl($query);
|
return static::buildUrl($query);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public static function generateResellerUrl(array $options): string
|
||||||
* @param array $options
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public static function generateResellerUrl(array $options)
|
|
||||||
{
|
{
|
||||||
$resolver = new OptionsResolver();
|
$resolver = new OptionsResolver();
|
||||||
$resolver->setDefined('paCode');
|
$resolver->setDefined('paCode');
|
||||||
@@ -119,15 +111,7 @@ class BookingUrlUtility
|
|||||||
return static::buildUrl($query);
|
return static::buildUrl($query);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
protected static function buildQuery(string $bookingId, string $hotelId, ?string $dateEnd, string $template = 'base', bool $isDayTrip = false): array
|
||||||
* @param string $bookingId
|
|
||||||
* @param string $hotelId
|
|
||||||
* @param string $dateEnd
|
|
||||||
* @param string $template
|
|
||||||
* @param bool $isDayTrip
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
protected static function buildQuery($bookingId, $hotelId, $dateEnd, $template = 'base', $isDayTrip = false)
|
|
||||||
{
|
{
|
||||||
$query = [
|
$query = [
|
||||||
'id' => $bookingId,
|
'id' => $bookingId,
|
||||||
@@ -145,16 +129,18 @@ class BookingUrlUtility
|
|||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param array $query
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
protected static function buildUrl(array $query): string
|
protected static function buildUrl(array $query): string
|
||||||
{
|
{
|
||||||
$baseUrl = GeneralUtility::makeInstance(SiteFinder::class)
|
/** @var SiteFinder $siteFinder */
|
||||||
->getSiteByIdentifier('ep-reisen')
|
$siteFinder = GeneralUtility::makeInstance(SiteFinder::class);
|
||||||
->getBase();
|
|
||||||
|
|
||||||
return $baseUrl . '/buchung/maske_buchung.php?' . http_build_query($query, '', '&');
|
$pageId = $GLOBALS['TSFE']->id;
|
||||||
}
|
|
||||||
|
if (null !== $pageId) {
|
||||||
|
$site = $siteFinder->getSiteByPageId($pageId);
|
||||||
|
} else {
|
||||||
|
$site = $siteFinder->getSiteByIdentifier('ep-reisen');
|
||||||
|
}
|
||||||
|
|
||||||
|
return $site->getBase() . '/buchung/maske_buchung.php?' . http_build_query($query); }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user