From a81160fabcdd2f246c9d1e8d140a90f399cd0739 Mon Sep 17 00:00:00 2001 From: Erik Huelsmann Date: Fri, 8 Nov 2024 21:12:49 +0100 Subject: [PATCH 1/3] Use 'parent' over 'base' module --- lib/LedgerSMB/Locale.pm | 2 +- lib/LedgerSMB/Magic.pm | 2 +- lib/LedgerSMB/PGDate.pm | 2 +- lib/LedgerSMB/PGNumber.pm | 2 +- lib/LedgerSMB/PGTimestamp.pm | 2 +- lib/LedgerSMB/Workflow/Persister.pm | 2 +- lib/LedgerSMB/Workflow/Persister/Email.pm | 2 +- lib/LedgerSMB/Workflow/Persister/ExtraData.pm | 2 +- lib/LedgerSMB/Workflow/Persister/Order.pm | 2 +- old/lib/LedgerSMB/Batch.pm | 2 +- old/lib/LedgerSMB/DBObject/Payment.pm | 2 +- old/lib/LedgerSMB/DBObject/Reconciliation.pm | 2 +- old/lib/LedgerSMB/PGOld.pm | 2 +- old/lib/LedgerSMB/Setting.pm | 2 +- old/lib/LedgerSMB/old_code.pm | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/LedgerSMB/Locale.pm b/lib/LedgerSMB/Locale.pm index 3763e573e5..d39b3d1c1a 100644 --- a/lib/LedgerSMB/Locale.pm +++ b/lib/LedgerSMB/Locale.pm @@ -97,7 +97,7 @@ $myconfig->{dateformat}. use strict; use warnings; -use base qw( Locale::Maketext Exporter ); +use parent qw( Locale::Maketext Exporter ); our @EXPORT_OK = qw(marktext); use Locale::Maketext::Lexicon; diff --git a/lib/LedgerSMB/Magic.pm b/lib/LedgerSMB/Magic.pm index 16bb3ec744..e659907a32 100644 --- a/lib/LedgerSMB/Magic.pm +++ b/lib/LedgerSMB/Magic.pm @@ -2,7 +2,7 @@ package LedgerSMB::Magic; use strict; use warnings; -use base 'Exporter'; +use parent 'Exporter'; our @EXPORT_OK = qw( diff --git a/lib/LedgerSMB/PGDate.pm b/lib/LedgerSMB/PGDate.pm index ec19d1e707..711bb51735 100644 --- a/lib/LedgerSMB/PGDate.pm +++ b/lib/LedgerSMB/PGDate.pm @@ -16,7 +16,7 @@ The type behaves internally as a Datetime module. use v5.36.1; use warnings; -use base qw(PGObject::Type::DateTime); +use parent qw(PGObject::Type::DateTime); use Carp; use DateTime; diff --git a/lib/LedgerSMB/PGNumber.pm b/lib/LedgerSMB/PGNumber.pm index 9adbe5e833..a87cade3e8 100644 --- a/lib/LedgerSMB/PGNumber.pm +++ b/lib/LedgerSMB/PGNumber.pm @@ -17,7 +17,7 @@ Math::BigFloat and can be used in this way. use v5.36.1; use warnings; -use base qw(PGObject::Type::BigFloat); +use parent qw(PGObject::Type::BigFloat); # try using the GMP library for Math::BigFloat for speed use Carp; diff --git a/lib/LedgerSMB/PGTimestamp.pm b/lib/LedgerSMB/PGTimestamp.pm index 3b8ed2c140..d730ade840 100644 --- a/lib/LedgerSMB/PGTimestamp.pm +++ b/lib/LedgerSMB/PGTimestamp.pm @@ -16,7 +16,7 @@ The type behaves internally as a Datetime module. use v5.36.1; use warnings; -use base qw(PGObject::Type::DateTime); +use parent qw(PGObject::Type::DateTime); use Carp; use DateTime::Format::Strptime qw(strptime); diff --git a/lib/LedgerSMB/Workflow/Persister.pm b/lib/LedgerSMB/Workflow/Persister.pm index e7c1fdf84a..116e426ee9 100644 --- a/lib/LedgerSMB/Workflow/Persister.pm +++ b/lib/LedgerSMB/Workflow/Persister.pm @@ -26,7 +26,7 @@ the same configuration semantics. use warnings; use strict; -use base qw( Workflow::Persister::DBI ); +use parent qw( Workflow::Persister::DBI ); use JSON::MaybeXS; use Workflow::Context; diff --git a/lib/LedgerSMB/Workflow/Persister/Email.pm b/lib/LedgerSMB/Workflow/Persister/Email.pm index 27876178f8..95758ff9d6 100644 --- a/lib/LedgerSMB/Workflow/Persister/Email.pm +++ b/lib/LedgerSMB/Workflow/Persister/Email.pm @@ -63,7 +63,7 @@ The C< content > field will be loaded from the database when it's being accessed use warnings; use strict; -use base qw( LedgerSMB::Workflow::Persister::ExtraData ); +use parent qw( LedgerSMB::Workflow::Persister::ExtraData ); use JSON::MaybeXS; use Log::Any qw($log); diff --git a/lib/LedgerSMB/Workflow/Persister/ExtraData.pm b/lib/LedgerSMB/Workflow/Persister/ExtraData.pm index 5c87fd7596..b35c580d36 100644 --- a/lib/LedgerSMB/Workflow/Persister/ExtraData.pm +++ b/lib/LedgerSMB/Workflow/Persister/ExtraData.pm @@ -31,7 +31,7 @@ C. use warnings; use strict; -use base qw( Workflow::Persister::DBI::ExtraData ); +use parent qw( Workflow::Persister::DBI::ExtraData ); use JSON::MaybeXS; use Workflow::Context; diff --git a/lib/LedgerSMB/Workflow/Persister/Order.pm b/lib/LedgerSMB/Workflow/Persister/Order.pm index b3e45e66e2..dcaefde6c5 100644 --- a/lib/LedgerSMB/Workflow/Persister/Order.pm +++ b/lib/LedgerSMB/Workflow/Persister/Order.pm @@ -26,7 +26,7 @@ the same configuration semantics. use warnings; use strict; -use base qw( LedgerSMB::Workflow::Persister ); +use parent qw( LedgerSMB::Workflow::Persister ); use Workflow::Exception qw( persist_error ); use English; diff --git a/old/lib/LedgerSMB/Batch.pm b/old/lib/LedgerSMB/Batch.pm index b3994b9660..1657f029df 100644 --- a/old/lib/LedgerSMB/Batch.pm +++ b/old/lib/LedgerSMB/Batch.pm @@ -46,7 +46,7 @@ use strict; use warnings; use LedgerSMB::Setting; -use base qw(LedgerSMB::PGOld); +use parent qw(LedgerSMB::PGOld); use Log::Any qw($log); diff --git a/old/lib/LedgerSMB/DBObject/Payment.pm b/old/lib/LedgerSMB/DBObject/Payment.pm index 152b456561..711ad743bc 100644 --- a/old/lib/LedgerSMB/DBObject/Payment.pm +++ b/old/lib/LedgerSMB/DBObject/Payment.pm @@ -19,7 +19,7 @@ see the included COPYRIGHT and LICENSE files for more information. =cut package LedgerSMB::DBObject::Payment; -use base qw(LedgerSMB::PGOld); +use parent qw(LedgerSMB::PGOld); use strict; use warnings; use LedgerSMB::PGNumber; diff --git a/old/lib/LedgerSMB/DBObject/Reconciliation.pm b/old/lib/LedgerSMB/DBObject/Reconciliation.pm index 2590db980f..1cd883a3cd 100644 --- a/old/lib/LedgerSMB/DBObject/Reconciliation.pm +++ b/old/lib/LedgerSMB/DBObject/Reconciliation.pm @@ -49,7 +49,7 @@ package LedgerSMB::DBObject::Reconciliation; use strict; use warnings; -use base qw(LedgerSMB::PGOld); +use parent qw(LedgerSMB::PGOld); use List::Util qw(sum); use LedgerSMB::PGNumber; diff --git a/old/lib/LedgerSMB/PGOld.pm b/old/lib/LedgerSMB/PGOld.pm index 72957f1282..4581e20dda 100644 --- a/old/lib/LedgerSMB/PGOld.pm +++ b/old/lib/LedgerSMB/PGOld.pm @@ -20,7 +20,7 @@ package LedgerSMB::PGOld; use strict; use warnings; -use base 'PGObject::Simple'; +use parent 'PGObject::Simple'; =head1 METHODS diff --git a/old/lib/LedgerSMB/Setting.pm b/old/lib/LedgerSMB/Setting.pm index 6150ef7dd5..10af3de2d3 100644 --- a/old/lib/LedgerSMB/Setting.pm +++ b/old/lib/LedgerSMB/Setting.pm @@ -1,6 +1,6 @@ package LedgerSMB::Setting; -use base qw(LedgerSMB::PGOld Exporter); +use parent qw(LedgerSMB::PGOld Exporter); use strict; use warnings; diff --git a/old/lib/LedgerSMB/old_code.pm b/old/lib/LedgerSMB/old_code.pm index ee8ff9c058..28178f99e4 100644 --- a/old/lib/LedgerSMB/old_code.pm +++ b/old/lib/LedgerSMB/old_code.pm @@ -34,7 +34,7 @@ use POSIX 'SEEK_SET'; use Symbol; use Feature::Compat::Try; -use base qw(Exporter); +use parent qw(Exporter); our @EXPORT_OK = qw(dispatch); # make sure the package exists after 'use'-ing this module: From 70cf6a5e14fe732a1d6adcf9891ea13c20e7d5be Mon Sep 17 00:00:00 2001 From: Erik Huelsmann Date: Sat, 9 Nov 2024 00:10:09 +0100 Subject: [PATCH 2/3] Increase Test::Dependencies minimum to find 'use parent' deps --- cpanfile | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/cpanfile b/cpanfile index 44e2617b36..8cbf0f69f9 100644 --- a/cpanfile +++ b/cpanfile @@ -186,13 +186,7 @@ on 'develop' => sub { requires 'Selenium::Remote::Driver'; requires 'TAP::Parser::SourceHandler::pgTAP', '3.33'; requires 'Test::BDD::Cucumber', '0.86'; - if ($ENV{CI}) { - # Required to suppress a variable re-definition - requires 'Test::Dependencies', '0.30'; - } - else { - requires 'Test::Dependencies', '0.25'; - } + requires 'Test::Dependencies', '0.34'; requires 'Test::Pod', '1.00'; requires 'Test::Pod::Coverage'; requires 'Test2::Harness'; From 8f4fb501d5944cecbce2e6b9f7f0d8facc3f8d1e Mon Sep 17 00:00:00 2001 From: Erik Huelsmann Date: Sun, 10 Nov 2024 12:52:30 +0100 Subject: [PATCH 3/3] Add missing dependency Found by Test::Dependencies v0.34 --- cpanfile | 1 + 1 file changed, 1 insertion(+) diff --git a/cpanfile b/cpanfile index 8cbf0f69f9..1fd4018386 100644 --- a/cpanfile +++ b/cpanfile @@ -116,6 +116,7 @@ requires 'Text::CSV'; requires 'Text::Markdown'; requires 'URI'; requires 'URI::Escape'; +requires 'Workflow::Action', '1.59'; requires 'Workflow::Condition', '1.59'; requires 'Workflow::Context', '1.59'; requires 'Workflow::Exception', '1.59';