From 355204b863d34922750668d11c6335ed3db54dd5 Mon Sep 17 00:00:00 2001 From: Mason James Date: Wed, 27 Jun 2012 00:43:07 +1200 Subject: [PATCH] Bug 6679 - fix 12 perlcritic violations in C4/External/BakerTaylor.pm Content-Type: text/plain; charset="utf-8" http://koha-community.org Subroutine prototypes used at line 82, column 1. See page 194 of PBP. (Severity: 5) "return" statement with explicit "undef" at line 83, column 22. See page 199 of PBP. (Severity: 5) --- C4/External/BakerTaylor.pm | 22 +++++++++++----------- 1 files changed, 11 insertions(+), 11 deletions(-) diff --git a/C4/External/BakerTaylor.pm b/C4/External/BakerTaylor.pm index 3503db0..47c04cc 100644 --- a/C4/External/BakerTaylor.pm +++ b/C4/External/BakerTaylor.pm @@ -50,26 +50,26 @@ sub initialize { #"Mozilla/4.76 [en] (Win98; U)", # if for some reason you want to go stealth, you might prefer this } -sub image_url (;$) { - ($user and $pass) or return undef; +sub image_url { + ($user and $pass) or return; my $isbn = (@_ ? shift : ''); $isbn =~ s/(p|-)//g; # sanitize return $image_url . $isbn; } -sub link_url (;$) { +sub link_url { my $isbn = (@_ ? shift : ''); $isbn =~ s/(p|-)//g; # sanitize - $link_url or return undef; + $link_url or return; return $link_url . $isbn; } -sub content_cafe_url ($) { - ($user and $pass) or return undef; +sub content_cafe_url { + ($user and $pass) or return; my $isbn = (@_ ? shift : ''); $isbn =~ s/(p|-)//g; # sanitize return "http://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=$user&Password=$pass&Options=Y&ItemKey=$isbn"; } -sub http_jacket_link ($) { - my $isbn = shift or return undef; +sub http_jacket_link { + my $isbn = shift or return; $isbn =~ s/(p|-)//g; # sanitize my $image = availability($isbn); my $alt = "Buy this book"; @@ -79,9 +79,9 @@ sub http_jacket_link ($) { return sprintf qq(%s),$link,($image||$alt); } -sub availability ($) { - my $isbn = shift or return undef; - ($user and $pass) or return undef; +sub availability { + my $isbn = shift or return; + ($user and $pass) or return; $isbn =~ s/(p|-)//g; # sanitize my $url = "http://contentcafe2.btol.com/ContentCafe/InventoryAvailability.asmx/CheckInventory?UserID=$user&Password=$pass&Value=$isbn"; $debug and warn __PACKAGE__ . " request:\n$url\n"; -- 1.7.2.5