summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2025-02-08 15:31:34 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2025-02-08 15:31:34 +0100
commit618d818284d1cc1a57513f3544791b286991f38d (patch)
treeb49999c9e51e14b97fce703449ca0e5ecbf0f63a
parenta1c9822c0b7c3091f717cd24c70f29c371527eeb (diff)
DBRIS: perltidy0.05
-rw-r--r--lib/Travel/Routing/DE/DBRIS.pm41
1 files changed, 22 insertions, 19 deletions
diff --git a/lib/Travel/Routing/DE/DBRIS.pm b/lib/Travel/Routing/DE/DBRIS.pm
index f0892c6..22aef46 100644
--- a/lib/Travel/Routing/DE/DBRIS.pm
+++ b/lib/Travel/Routing/DE/DBRIS.pm
@@ -61,13 +61,13 @@ sub new {
@mots = @{ $conf{modes_of_transit} // [] };
}
- my ($req_url, $req);
+ my ( $req_url, $req );
- if ($conf{from} and $conf{to}) {
+ if ( $conf{from} and $conf{to} ) {
$req_url
- = $self->{language} eq 'de'
- ? 'https://www.bahn.de/web/api/angebote/fahrplan'
- : 'https://int.bahn.de/web/api/angebote/fahrplan';
+ = $self->{language} eq 'de'
+ ? 'https://www.bahn.de/web/api/angebote/fahrplan'
+ : 'https://int.bahn.de/web/api/angebote/fahrplan';
$req = {
abfahrtsHalt => $conf{from}->id,
ankunftsHalt => $conf{to}->id,
@@ -96,15 +96,15 @@ sub new {
deutschlandTicketVorhanden => \0
};
}
- elsif ($conf{offers}) {
+ elsif ( $conf{offers} ) {
$req_url
- = $self->{language} eq 'de'
- ? 'https://www.bahn.de/web/api/angebote/recon'
- : 'https://int.bahn.de/web/api/angebote/recon';
+ = $self->{language} eq 'de'
+ ? 'https://www.bahn.de/web/api/angebote/recon'
+ : 'https://int.bahn.de/web/api/angebote/recon';
$req = {
- klasse => $conf{first_class} ? 'KLASSE_1' : 'KLASSE_2',
+ klasse => $conf{first_class} ? 'KLASSE_1' : 'KLASSE_2',
ctxRecon => $conf{offers}{recon},
- reisende => [
+ reisende => [
{
typ => 'ERWACHSENER',
ermaessigungen => [
@@ -215,10 +215,10 @@ sub new {
}
$self->{raw_json} = $json->decode($content);
- if ($conf{from} and $conf{to}) {
+ if ( $conf{from} and $conf{to} ) {
$self->parse_connections;
}
- elsif ($conf{offers}) {
+ elsif ( $conf{offers} ) {
$self->parse_offers;
}
}
@@ -332,10 +332,13 @@ sub parse_connections {
sub parse_offers {
my ($self) = @_;
- for my $offer (@{$self->{raw_json}{verbindungen}[0]{reiseAngebote} // []}) {
- push(@{$self->{offers}}, Travel::Routing::DE::DBRIS::Offer->new(
- json => $offer
- ));
+ for
+ my $offer ( @{ $self->{raw_json}{verbindungen}[0]{reiseAngebote} // [] } )
+ {
+ push(
+ @{ $self->{offers} },
+ Travel::Routing::DE::DBRIS::Offer->new( json => $offer )
+ );
}
}
@@ -350,12 +353,12 @@ sub errstr {
sub connections {
my ($self) = @_;
- return @{ $self->{connections} // []};
+ return @{ $self->{connections} // [] };
}
sub offers {
my ($self) = @_;
- return @{$self->{offers} // [] };
+ return @{ $self->{offers} // [] };
}
# }}}