From e549c4a2ea69abf3c05cc1475f487b22c5cea45a Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Thu, 14 Dec 2023 17:24:50 +0000 Subject: [PATCH] Bug 35581: Koha::Illrequest::SupplierUpdate* -> Koha::ILL::Request::SupplierUpdate* Koha/Illrequest/SupplierUpdate.pm -> Koha/ILL/Request/SupplierUpdate.pm Koha/Illrequest/SupplierUpdateProcessor.pm -> Koha/ILL/Request/SupplierUpdateProcessor.pm Signed-off-by: David Nind Signed-off-by: Pedro Amorim --- Koha/{Illrequest => ILL/Request}/SupplierUpdate.pm | 12 ++++++------ .../Request}/SupplierUpdateProcessor.pm | 8 ++++---- Koha/Illrequest.pm | 2 +- misc/process_ill_updates.pl | 2 +- t/db_dependent/Illrequest/SupplierUpdate.t | 10 +++++----- t/db_dependent/Illrequests.t | 2 +- 6 files changed, 18 insertions(+), 18 deletions(-) rename Koha/{Illrequest => ILL/Request}/SupplierUpdate.pm (85%) rename Koha/{Illrequest => ILL/Request}/SupplierUpdateProcessor.pm (92%) diff --git a/Koha/Illrequest/SupplierUpdate.pm b/Koha/ILL/Request/SupplierUpdate.pm similarity index 85% rename from Koha/Illrequest/SupplierUpdate.pm rename to Koha/ILL/Request/SupplierUpdate.pm index 3cc54298fcc..e966b02e019 100644 --- a/Koha/Illrequest/SupplierUpdate.pm +++ b/Koha/ILL/Request/SupplierUpdate.pm @@ -1,4 +1,4 @@ -package Koha::Illrequest::SupplierUpdate; +package Koha::ILL::Request::SupplierUpdate; # Copyright 2022 PTFS Europe Ltd # @@ -21,7 +21,7 @@ use Modern::Perl; =head1 NAME -Koha::Illrequest::SupplierUpdate - Represents a single request update from a supplier +Koha::ILL::Request::SupplierUpdate - Represents a single request update from a supplier =head1 SYNOPSIS @@ -39,13 +39,13 @@ an update from a supplier =head3 new - my $update = Koha::Illrequest::SupplierUpdate->new( + my $update = Koha::ILL::Request::SupplierUpdate->new( $source_type, $source_name, $update ); -Create a new Koha::Illrequest::SupplierUpdate object. +Create a new Koha::ILL::Request::SupplierUpdate object . =cut @@ -66,7 +66,7 @@ sub new { =head3 attach_processor - Koha::Illrequest::SupplierUpdate->attach_processor($processor); + Koha::ILL::Request::SupplierUpdate->attach_processor($processor); Pushes a processor function onto the 'processors' arrayref @@ -79,7 +79,7 @@ sub attach_processor { =head3 run_processors - Koha::Illrequest::SupplierUpdate->run_processors(); + Koha::ILL::Request::SupplierUpdate->run_processors(); Iterates all processors on this object and runs each diff --git a/Koha/Illrequest/SupplierUpdateProcessor.pm b/Koha/ILL/Request/SupplierUpdateProcessor.pm similarity index 92% rename from Koha/Illrequest/SupplierUpdateProcessor.pm rename to Koha/ILL/Request/SupplierUpdateProcessor.pm index 3136127c83a..69d3233fb3b 100644 --- a/Koha/Illrequest/SupplierUpdateProcessor.pm +++ b/Koha/ILL/Request/SupplierUpdateProcessor.pm @@ -1,4 +1,4 @@ -package Koha::Illrequest::SupplierUpdateProcessor; +package Koha::ILL::Request::SupplierUpdateProcessor; # Copyright 2022 PTFS Europe Ltd # @@ -51,11 +51,11 @@ Create a new Koha::Illrequest::SupplierUpdateProcessor object. sub new { my ( $class, $target_source_type, $target_source_name, $processor_name ) = @_; - my $self = {}; + my $self = {}; $self->{target_source_type} = $target_source_type; $self->{target_source_name} = $target_source_name; - $self->{name} = $processor_name; + $self->{name} = $processor_name; bless $self, $class; @@ -71,7 +71,7 @@ Runs the processor =cut sub run { - my ( $self ) = @_; + my ($self) = @_; my ( $package, $filename ) = caller; warn __PACKAGE__ . " run should only be invoked by a subclass\n"; } diff --git a/Koha/Illrequest.pm b/Koha/Illrequest.pm index a69383104c3..36ff2528ffc 100644 --- a/Koha/Illrequest.pm +++ b/Koha/Illrequest.pm @@ -1840,7 +1840,7 @@ sub get_notice { =head3 attach_processors -Receive a Koha::Illrequest::SupplierUpdate and attach +Receive a Koha::ILL::Request::SupplierUpdate and attach any processors we have for it =cut diff --git a/misc/process_ill_updates.pl b/misc/process_ill_updates.pl index fb2e22544c0..3acba3d47fa 100755 --- a/misc/process_ill_updates.pl +++ b/misc/process_ill_updates.pl @@ -129,7 +129,7 @@ while (my $request = $requests->next) { # process it # # Since each backend's update format is different, it may - # be necessary for a backend to subclass Koha::Illrequest::SupplierUpdate + # be necessary for a backend to subclass Koha::ILL::Request::SupplierUpdate # so it can provide methods (corresponding to a generic interface) that # return pertinent info to core ILL when it is processing updates # diff --git a/t/db_dependent/Illrequest/SupplierUpdate.t b/t/db_dependent/Illrequest/SupplierUpdate.t index 72d2fc280ee..281c1df5f46 100755 --- a/t/db_dependent/Illrequest/SupplierUpdate.t +++ b/t/db_dependent/Illrequest/SupplierUpdate.t @@ -20,22 +20,22 @@ use Modern::Perl; use Test::MockObject; use Koha::Illrequest; -use Koha::Illrequest::SupplierUpdate; +use Koha::ILL::Request::SupplierUpdate; use Test::More tests => 4; -use_ok('Koha::Illrequest::SupplierUpdate'); +use_ok('Koha::ILL::Request::SupplierUpdate'); -my $update = Koha::Illrequest::SupplierUpdate->new( +my $update = Koha::ILL::Request::SupplierUpdate->new( 'test_type', 'test_name', 'Arbitrary update text' ); -isa_ok( $update, 'Koha::Illrequest::SupplierUpdate' ); +isa_ok( $update, 'Koha::ILL::Request::SupplierUpdate' ); my $processor = Test::MockObject->new; -$processor->set_isa('Koha::Illrequest::Processor'); +$processor->set_isa('Koha::ILL::Request::Processor'); $processor->{name} = 'Test processor'; $processor->mock('run', sub { my ( $self, $update, $options, $result ) = @_; diff --git a/t/db_dependent/Illrequests.t b/t/db_dependent/Illrequests.t index 538a24c11b5..48128f99602 100755 --- a/t/db_dependent/Illrequests.t +++ b/t/db_dependent/Illrequests.t @@ -952,7 +952,7 @@ subtest 'Helpers' => sub { my $type = 'test_type_1'; my $name = 'test_name_1'; my $update = Test::MockObject->new; - $update->set_isa('Koha::Illrequest::SupplierUpdate'); + $update->set_isa('Koha::ILL::Request::SupplierUpdate'); $update->{source_type} = $type; $update->{source_name} = $name; $update->{processors} = []; -- 2.30.2