From 5d35bdf585e083e6b82a1e74e86b88a3015dc985 Mon Sep 17 00:00:00 2001 From: David Cook Date: Mon, 9 Dec 2024 05:09:47 +0000 Subject: [PATCH] Bug 37486: Tidy Signed-off-by: David Nind --- C4/OAI/Sets.pm | 20 ++++++++++---------- misc/migration_tools/build_oai_sets.pl | 4 ++-- t/db_dependent/OAI/Sets.t | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/C4/OAI/Sets.pm b/C4/OAI/Sets.pm index ff68fa81b8..f7937b6067 100644 --- a/C4/OAI/Sets.pm +++ b/C4/OAI/Sets.pm @@ -69,12 +69,12 @@ The hash references looks like this: sub GetOAISets { my ($args) = @_; - my $where = ''; - my @bind = (); - if ($args){ - if ($args->{set_id}){ + my $where = ''; + my @bind = (); + if ($args) { + if ( $args->{set_id} ) { $where = ' WHERE id = ? '; - push(@bind,$args->{set_id}); + push( @bind, $args->{set_id} ); } } my $dbh = C4::Context->dbh; @@ -341,12 +341,12 @@ The first hashref keys are the sets IDs, so it looks like this: sub GetOAISetsMappings { my ($args) = @_; - my $where = ''; - my @bind = (); - if ($args){ - if ($args->{set_id}){ + my $where = ''; + my @bind = (); + if ($args) { + if ( $args->{set_id} ) { $where = " WHERE set_id = ? "; - push(@bind,$args->{set_id}); + push( @bind, $args->{set_id} ); } } my $dbh = C4::Context->dbh; diff --git a/misc/migration_tools/build_oai_sets.pl b/misc/migration_tools/build_oai_sets.pl index 8e276364f3..f84b9d5144 100755 --- a/misc/migration_tools/build_oai_sets.pl +++ b/misc/migration_tools/build_oai_sets.pl @@ -59,7 +59,7 @@ use Koha::Biblio::Metadata; my %opts; $Getopt::Std::STANDARD_HELP_VERSION = 1; -my $go = getopts('vo:l:ihrs:', \%opts); +my $go = getopts( 'vo:l:ihrs:', \%opts ); if(!$go or $opts{h}){ &print_usage; @@ -74,7 +74,7 @@ my $reset = $opts{r}; my $set = $opts{s}; my $selective_set = {}; -if ($set){ +if ($set) { $selective_set->{set_id} = $set; } diff --git a/t/db_dependent/OAI/Sets.t b/t/db_dependent/OAI/Sets.t index 15a18f0b3d..2ba3b3634a 100755 --- a/t/db_dependent/OAI/Sets.t +++ b/t/db_dependent/OAI/Sets.t @@ -335,7 +335,7 @@ is ($mappings->{$set2_id}->[0]->{marcvalue}, 'myOtherMarcValue', 'marcvalue fiel my $selective_mappings = GetOAISetsMappings( { set_id => $set1_id } ); is( scalar keys %$selective_mappings, 1, 'Selective mappings only returns mappings for selected set_id' ); -is_deeply($selective_mappings->{$set1_id},$mappings->{$set1_id}, 'Correct mapping returned for selective mappings'); +is_deeply( $selective_mappings->{$set1_id}, $mappings->{$set1_id}, 'Correct mapping returned for selective mappings' ); # ---------- Testing GetOAISetMappings ---------- ok (!defined(GetOAISetMappings), 'GetOAISetMappings without argument is undef'); -- 2.39.5