From 826a2d4e70c70c45cb08e42cf352455798fa52cf Mon Sep 17 00:00:00 2001 From: Kyle Hall Date: Mon, 11 Apr 2022 10:33:24 -0400 Subject: [PATCH] Bug 30410: (QA follow-up) Pluralise new methods, fix minor issues with language Signed-off-by: Kyle M Hall Signed-off-by: Fridolin Somers --- Koha/BackgroundJob.pm | 26 ++++++++++----------- t/db_dependent/Koha/Plugins/BackgroundJob.t | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Koha/BackgroundJob.pm b/Koha/BackgroundJob.pm index 23d1136d6a..e42a9cc903 100644 --- a/Koha/BackgroundJob.pm +++ b/Koha/BackgroundJob.pm @@ -260,22 +260,22 @@ Returns the available types to class mappings. sub type_to_class_mapping { my ($self) = @_; - my $plugins_mapping = $self->plugin_type_to_class; + my $plugins_mapping = $self->plugin_types_to_classes; return ($plugins_mapping) - ? { %{ $self->core_type_to_class }, %{ $self->plugin_type_to_class } } - : $self->core_type_to_class; + ? { %{ $self->core_types_to_classes }, %{ $self->plugin_types_to_classes } } + : $self->core_types_to_classes; } -=head3 core_type_to_class +=head3 core_types_to_classes - my $mappings = Koha::BackgrounJob->new->core_type_to_class + my $mappings = Koha::BackgrounJob->new->core_types_to_classes Returns the core background jobs types to class mappings. =cut -sub core_type_to_class { +sub core_types_to_classes { return { batch_authority_record_deletion => 'Koha::BackgroundJob::BatchDeleteAuthority', batch_authority_record_modification => 'Koha::BackgroundJob::BatchUpdateAuthority', @@ -287,15 +287,15 @@ sub core_type_to_class { }; } -=head3 plugin_type_to_class +=head3 plugin_types_to_classes - my $mappings = Koha::BackgroundJob->new->plugin_type_to_class + my $mappings = Koha::BackgroundJob->new->plugin_types_to_classes -Returns the plugin-refined background jobs types to class mappings. +Returns the plugin-defined background jobs types to class mappings. =cut -sub plugin_type_to_class { +sub plugin_types_to_classes { my ($self) = @_; unless ( exists $self->{_plugin_mapping} ) { @@ -308,9 +308,9 @@ sub plugin_type_to_class { unless ( $metadata->{namespace} ) { Koha::Logger->get->warn( -"The plugin includes the 'background_tasks' method, but doesn't provide the required 'namespace' method (" - . $plugin->{class} - . ')' ); + q{A plugin includes the 'background_tasks' method, } + . q{but doesn't provide the required 'namespace' } + . qq{method ($plugin->{class})} ); next; } diff --git a/t/db_dependent/Koha/Plugins/BackgroundJob.t b/t/db_dependent/Koha/Plugins/BackgroundJob.t index 0f5932eca0..8d2a0e5e18 100755 --- a/t/db_dependent/Koha/Plugins/BackgroundJob.t +++ b/t/db_dependent/Koha/Plugins/BackgroundJob.t @@ -76,7 +76,7 @@ subtest 'background_tasks() hooks tests' => sub { $bj = Koha::BackgroundJob->new; $tasks = $bj->type_to_class_mapping; - $logger->warn_is("The plugin includes the 'background_tasks' method, but doesn't provide the required 'namespace' method (Koha::Plugin::Test)"); + $logger->warn_is("A plugin includes the 'background_tasks' method, but doesn't provide the required 'namespace' method (Koha::Plugin::Test)"); $schema->storage->txn_rollback; Koha::Plugins::Methods->delete; -- 2.39.5