From ccf221878c86efc5b6b38c616e5aa5fdf07e1730 Mon Sep 17 00:00:00 2001 From: Jared Camins-Esakov Date: Fri, 25 Jan 2013 07:45:22 -0500 Subject: [PATCH] [PASSED QA] Bug 9239 follow-up: POD and perlcritic fixes There were several perlcritic violations for returning explicit undef, and splitting up the various driver classes resulted in POD compliance errors, where the POD was starting with head2 rather than head1. This patch fixes those errors (but has no functional impact). Signed-off-by: Elliott Davis Signed-off-by: Katrin Fischer --- Koha/QueryParser/Driver/PQF/Util.pm | 16 ++++++++++++++++ Koha/QueryParser/Driver/PQF/query_plan.pm | 6 ++++++ Koha/QueryParser/Driver/PQF/query_plan/facet.pm | 6 ++++++ Koha/QueryParser/Driver/PQF/query_plan/filter.pm | 6 ++++++ Koha/QueryParser/Driver/PQF/query_plan/modifier.pm | 6 ++++++ Koha/QueryParser/Driver/PQF/query_plan/node.pm | 6 ++++++ .../QueryParser/Driver/PQF/query_plan/node/atom.pm | 6 ++++++ OpenILS/QueryParser.pm | 18 +++++++++--------- 8 files changed, 61 insertions(+), 9 deletions(-) diff --git a/Koha/QueryParser/Driver/PQF/Util.pm b/Koha/QueryParser/Driver/PQF/Util.pm index f2e018b..be7639b 100644 --- a/Koha/QueryParser/Driver/PQF/Util.pm +++ b/Koha/QueryParser/Driver/PQF/Util.pm @@ -4,6 +4,22 @@ use Scalar::Util qw(looks_like_number); use strict; use warnings; +=head1 NAME + + Koha::QueryParser::Driver::PQF::Util - Utility module for PQF QueryParser driver + +=head1 FUNCTIONS + +=head2 attributes_to_attr_string + + Koha::QueryParser::Driver::PQF::Util(%attributes); + + Koha::QueryParser::Driver::PQF::Util({ '1' => '1003', '4' => '6' }); + +Convert a hashref with a Bib-1 mapping into its PQF string representation. + +=cut + sub attributes_to_attr_string { my ($attributes) = @_; my $attr_string = ''; diff --git a/Koha/QueryParser/Driver/PQF/query_plan.pm b/Koha/QueryParser/Driver/PQF/query_plan.pm index 5435fe6..8b0df42 100644 --- a/Koha/QueryParser/Driver/PQF/query_plan.pm +++ b/Koha/QueryParser/Driver/PQF/query_plan.pm @@ -4,6 +4,12 @@ use base 'OpenILS::QueryParser::query_plan'; use strict; use warnings; +=head1 NAME + +Koha::QueryParser::Driver::PQF::query_plan - query_plan subclass for PQF driver + +=head1 FUNCTIONS + =head2 Koha::QueryParser::Driver::PQF::query_plan::target_syntax my $pqf = $query_plan->target_syntax($server); diff --git a/Koha/QueryParser/Driver/PQF/query_plan/facet.pm b/Koha/QueryParser/Driver/PQF/query_plan/facet.pm index 0407e58..217cd29 100644 --- a/Koha/QueryParser/Driver/PQF/query_plan/facet.pm +++ b/Koha/QueryParser/Driver/PQF/query_plan/facet.pm @@ -4,6 +4,12 @@ use base 'OpenILS::QueryParser::query_plan::facet'; use strict; use warnings; +=head1 NAME + +Koha::QueryParser::Driver::PQF::query_plan::facet - facet subclass for PQF driver + +=head1 FUNCTIONS + =head2 Koha::QueryParser::Driver::PQF::query_plan::facet::target_syntax my $pqf = $facet->target_syntax($server); diff --git a/Koha/QueryParser/Driver/PQF/query_plan/filter.pm b/Koha/QueryParser/Driver/PQF/query_plan/filter.pm index c632eee..587ad81 100644 --- a/Koha/QueryParser/Driver/PQF/query_plan/filter.pm +++ b/Koha/QueryParser/Driver/PQF/query_plan/filter.pm @@ -4,6 +4,12 @@ use base 'OpenILS::QueryParser::query_plan::filter'; use strict; use warnings; +=head1 NAME + +Koha::QueryParser::Driver::PQF::query_plan::filter - filter subclass for PQF driver + +=head1 FUNCTIONS + =head2 Koha::QueryParser::Driver::PQF::query_plan::filter::target_syntax my $pqf = $filter->target_syntax($server); diff --git a/Koha/QueryParser/Driver/PQF/query_plan/modifier.pm b/Koha/QueryParser/Driver/PQF/query_plan/modifier.pm index c3a66e4..2092232 100644 --- a/Koha/QueryParser/Driver/PQF/query_plan/modifier.pm +++ b/Koha/QueryParser/Driver/PQF/query_plan/modifier.pm @@ -4,6 +4,12 @@ use base 'OpenILS::QueryParser::query_plan::modifier'; use strict; use warnings; +=head1 NAME + +Koha::QueryParser::Driver::PQF::query_plan::modifer - modifier subclass for PQF driver + +=head1 FUNCTIONS + =head2 Koha::QueryParser::Driver::PQF::query_plan::modifier::target_syntax my $pqf = $modifier->target_syntax($server, $query_plan); diff --git a/Koha/QueryParser/Driver/PQF/query_plan/node.pm b/Koha/QueryParser/Driver/PQF/query_plan/node.pm index 62417a1..e93bb4b 100644 --- a/Koha/QueryParser/Driver/PQF/query_plan/node.pm +++ b/Koha/QueryParser/Driver/PQF/query_plan/node.pm @@ -4,6 +4,12 @@ use base 'OpenILS::QueryParser::query_plan::node'; use strict; use warnings; +=head1 NAME + +Koha::QueryParser::Driver::PQF::query_plan::node - node subclass for PQF driver + +=head1 FUNCTIONS + =head2 Koha::QueryParser::Driver::PQF::query_plan::node::target_syntax my $pqf = $node->target_syntax($server); diff --git a/Koha/QueryParser/Driver/PQF/query_plan/node/atom.pm b/Koha/QueryParser/Driver/PQF/query_plan/node/atom.pm index afdb4c4..6a69c35 100644 --- a/Koha/QueryParser/Driver/PQF/query_plan/node/atom.pm +++ b/Koha/QueryParser/Driver/PQF/query_plan/node/atom.pm @@ -4,6 +4,12 @@ use base 'OpenILS::QueryParser::query_plan::node::atom'; use strict; use warnings; +=head1 NAME + +Koha::QueryParser::Driver::PQF::query_plan::node::atom - atom subclass for PQF driver + +=head1 FUNCTIONS + =head2 Koha::QueryParser::Driver::PQF::query_plan::node::atom::target_syntax my $pqf = $atom->target_syntax($server); diff --git a/OpenILS/QueryParser.pm b/OpenILS/QueryParser.pm index f1a5662..e5aaf09 100644 --- a/OpenILS/QueryParser.pm +++ b/OpenILS/QueryParser.pm @@ -321,7 +321,7 @@ sub operator { my $opname = shift; my $op = shift; - return undef unless ($opname); + return unless ($opname); $parser_config{$class}{operators} ||= {}; $parser_config{$class}{operators}{$opname} = $op if ($op); @@ -1488,7 +1488,7 @@ package OpenILS::QueryParser::query_plan; sub QueryParser { my $self = shift; - return undef unless ref($self); + return unless ref($self); return $self->{QueryParser}; } @@ -1540,7 +1540,7 @@ sub _merge_filters { my $right_filter = shift; my $join = shift; - return undef unless $left_filter or $right_filter; + return unless $left_filter or $right_filter; return $right_filter unless $left_filter; return $left_filter unless $right_filter; @@ -1599,7 +1599,7 @@ sub collapse_filters { sub find_filter { my $self = shift; my $needle = shift;; - return undef unless ($needle); + return unless ($needle); my $filter = $self->collapse_filters($needle); @@ -1613,7 +1613,7 @@ sub find_filter { sub find_modifier { my $self = shift; my $needle = shift;; - return undef unless ($needle); + return unless ($needle); return grep { $_->name eq $needle } @{ $self->modifiers }; } @@ -2103,25 +2103,25 @@ sub new { sub node { my $self = shift; - return undef unless (ref $self); + return unless (ref $self); return $self->{node}; } sub content { my $self = shift; - return undef unless (ref $self); + return unless (ref $self); return $self->{content}; } sub prefix { my $self = shift; - return undef unless (ref $self); + return unless (ref $self); return $self->{prefix}; } sub suffix { my $self = shift; - return undef unless (ref $self); + return unless (ref $self); return $self->{suffix}; } -- 1.7.9.5