From c5c074903da3334bdb13d61314c88d1c1f48674d Mon Sep 17 00:00:00 2001 From: Rumperuu Date: Sat, 20 Mar 2021 15:02:00 +0000 Subject: [PATCH] Add explicit `return`s --- lib/Pear/LocalLoop/Command/codepoint_open.pm | 2 ++ lib/Pear/LocalLoop/Command/dev_data.pm | 2 ++ lib/Pear/LocalLoop/Command/dev_transactions.pm | 2 ++ lib/Pear/LocalLoop/Command/latlong_setup.pm | 4 ++++ lib/Pear/LocalLoop/Command/leaderboard.pm | 2 ++ .../LocalLoop/Command/recalc_leaderboards.pm | 2 ++ lib/Pear/LocalLoop/Command/recur_transactions.pm | 2 ++ lib/Pear/LocalLoop/Controller/Admin.pm | 6 ++++++ .../LocalLoop/Controller/Admin/Categories.pm | 10 ++++++++++ lib/Pear/LocalLoop/Controller/Admin/Feedback.pm | 6 ++++++ lib/Pear/LocalLoop/Controller/Admin/Import.pm | 14 ++++++++++++++ .../LocalLoop/Controller/Admin/ImportFrom.pm | 4 ++++ .../LocalLoop/Controller/Admin/Organisations.pm | 16 ++++++++++++++++ lib/Pear/LocalLoop/Controller/Admin/Reports.pm | 2 ++ lib/Pear/LocalLoop/Controller/Admin/Tokens.pm | 10 ++++++++++ .../LocalLoop/Controller/Admin/Transactions.pm | 8 ++++++++ lib/Pear/LocalLoop/Controller/Admin/Users.pm | 6 ++++++ lib/Pear/LocalLoop/Controller/Api/Auth.pm | 2 ++ .../Controller/Api/V1/Supplier/Location.pm | 4 ++++ lib/Pear/LocalLoop/Controller/Root.pm | 8 ++++++++ lib/Pear/LocalLoop/Import/LCCCsv/Postcodes.pm | 4 ++++ lib/Pear/LocalLoop/Import/LCCCsv/Suppliers.pm | 4 ++++ lib/Pear/LocalLoop/Import/LCCCsv/Transactions.pm | 4 ++++ lib/Pear/LocalLoop/Plugin/BootstrapPagination.pm | 3 ++- lib/Pear/LocalLoop/Plugin/Currency.pm | 2 ++ lib/Pear/LocalLoop/Plugin/Datetime.pm | 1 + lib/Pear/LocalLoop/Plugin/Minion.pm | 3 ++- .../Plugin/Minion/Job/csv_postcode_import.pm | 2 ++ .../Plugin/Minion/Job/csv_supplier_import.pm | 2 ++ .../Plugin/Minion/Job/csv_transaction_import.pm | 2 ++ .../Plugin/Minion/Job/entity_postcode_lookup.pm | 2 ++ .../Plugin/Minion/Job/leaderboards_recalc.pm | 2 ++ lib/Pear/LocalLoop/Plugin/Minion/Job/test.pm | 2 ++ lib/Pear/LocalLoop/Plugin/Postcodes.pm | 2 ++ lib/Pear/LocalLoop/Plugin/TemplateHelpers.pm | 3 ++- lib/Pear/LocalLoop/Plugin/Validators.pm | 2 ++ lib/Pear/LocalLoop/Schema/Result/Organisation.pm | 2 ++ lib/Pear/LocalLoop/Schema/Result/Transaction.pm | 2 ++ lib/Pear/LocalLoop/Schema/Result/User.pm | 14 ++++++++------ lib/Pear/LocalLoop/Schema/ResultSet/Entity.pm | 4 +++- .../LocalLoop/Schema/ResultSet/Leaderboard.pm | 4 ++++ .../LocalLoop/Schema/ResultSet/Organisation.pm | 2 +- .../LocalLoop/Schema/Script/DeploymentHandler.pm | 8 ++++++++ lib/Test/Pear/LocalLoop.pm | 14 ++++++++++++++ 44 files changed, 191 insertions(+), 11 deletions(-) diff --git a/lib/Pear/LocalLoop/Command/codepoint_open.pm b/lib/Pear/LocalLoop/Command/codepoint_open.pm index 9daee08..b4570b4 100644 --- a/lib/Pear/LocalLoop/Command/codepoint_open.pm +++ b/lib/Pear/LocalLoop/Command/codepoint_open.pm @@ -55,6 +55,8 @@ sub run { { key => 'primary' }, ); } + + return 1; } =head1 SYNOPSIS diff --git a/lib/Pear/LocalLoop/Command/dev_data.pm b/lib/Pear/LocalLoop/Command/dev_data.pm index 611dcb5..c230c4a 100644 --- a/lib/Pear/LocalLoop/Command/dev_data.pm +++ b/lib/Pear/LocalLoop/Command/dev_data.pm @@ -90,6 +90,8 @@ sub run { }, } ); + + return 1; } =head1 SYNOPSIS diff --git a/lib/Pear/LocalLoop/Command/dev_transactions.pm b/lib/Pear/LocalLoop/Command/dev_transactions.pm index 2c491e0..adcdf51 100644 --- a/lib/Pear/LocalLoop/Command/dev_transactions.pm +++ b/lib/Pear/LocalLoop/Command/dev_transactions.pm @@ -90,6 +90,8 @@ sub run { } } } + + return 1; } =head1 SYNOPSIS diff --git a/lib/Pear/LocalLoop/Command/latlong_setup.pm b/lib/Pear/LocalLoop/Command/latlong_setup.pm index 4a3d649..9c34136 100644 --- a/lib/Pear/LocalLoop/Command/latlong_setup.pm +++ b/lib/Pear/LocalLoop/Command/latlong_setup.pm @@ -29,6 +29,8 @@ sub run { ); $result->update( { distance => $distance } ) if defined $distance; } + + return 1; } sub _set_lat_long_for_result { @@ -53,6 +55,8 @@ sub _set_lat_long_for_result { ); } } + + return 1; } sub _calculate_distance { diff --git a/lib/Pear/LocalLoop/Command/leaderboard.pm b/lib/Pear/LocalLoop/Command/leaderboard.pm index 064b322..bd5df60 100644 --- a/lib/Pear/LocalLoop/Command/leaderboard.pm +++ b/lib/Pear/LocalLoop/Command/leaderboard.pm @@ -71,6 +71,8 @@ sub run { } } } + + return 1; } =head1 SYNOPSIS diff --git a/lib/Pear/LocalLoop/Command/recalc_leaderboards.pm b/lib/Pear/LocalLoop/Command/recalc_leaderboards.pm index b04514e..5ea8fa5 100644 --- a/lib/Pear/LocalLoop/Command/recalc_leaderboards.pm +++ b/lib/Pear/LocalLoop/Command/recalc_leaderboards.pm @@ -13,6 +13,8 @@ sub run { my $leaderboard_rs = $self->app->schema->resultset('Leaderboard'); $leaderboard_rs->recalculate_all; + + return 1; } =head1 SYNOPSIS diff --git a/lib/Pear/LocalLoop/Command/recur_transactions.pm b/lib/Pear/LocalLoop/Command/recur_transactions.pm index 35fa032..58bf927 100644 --- a/lib/Pear/LocalLoop/Command/recur_transactions.pm +++ b/lib/Pear/LocalLoop/Command/recur_transactions.pm @@ -153,6 +153,8 @@ sub run { $recur_result->update( { last_updated => $purchase_time } ); } + + return 1; } =head1 SYNOPSIS diff --git a/lib/Pear/LocalLoop/Controller/Admin.pm b/lib/Pear/LocalLoop/Controller/Admin.pm index 13b2d73..01049d3 100644 --- a/lib/Pear/LocalLoop/Controller/Admin.pm +++ b/lib/Pear/LocalLoop/Controller/Admin.pm @@ -34,6 +34,8 @@ sub home { pending => $pending_feedback_rs->count, }, ); + + return 1; } sub auth_login { @@ -52,6 +54,8 @@ sub auth_login { . "]" ); $c->redirect_to('/admin'); } + + return 1; } sub auth_logout { @@ -59,6 +63,8 @@ sub auth_logout { $c->logout; $c->redirect_to('/admin'); + + return 1; } 1; diff --git a/lib/Pear/LocalLoop/Controller/Admin/Categories.pm b/lib/Pear/LocalLoop/Controller/Admin/Categories.pm index 6f89b3c..53a3698 100644 --- a/lib/Pear/LocalLoop/Controller/Admin/Categories.pm +++ b/lib/Pear/LocalLoop/Controller/Admin/Categories.pm @@ -12,6 +12,8 @@ sub index { my $category_rs = $c->result_set; $category_rs->result_class('DBIx::Class::ResultClass::HashRefInflator'); $c->stash( categories => [ $category_rs->all ] ); + + return 1; } # POST @@ -43,6 +45,8 @@ sub create { $c->result_set->create( { name => $category_name } ); } $c->redirect_to('/admin/categories'); + + return 1; } # GET @@ -58,6 +62,8 @@ sub read { $c->flash( error => 'No Category found' ); $c->redirect_to('/admin/categories'); } + + return 1; } # POST @@ -95,6 +101,8 @@ sub update { $c->flash( error => 'No Category found' ); $c->redirect_to('/admin/categories'); } + + return 1; } # DELETE @@ -112,6 +120,8 @@ sub delete { $c->flash( error => 'No Category found' ); } $c->redirect_to('/admin/categories'); + + return 1; } 1; diff --git a/lib/Pear/LocalLoop/Controller/Admin/Feedback.pm b/lib/Pear/LocalLoop/Controller/Admin/Feedback.pm index 9a7188b..048f2af 100644 --- a/lib/Pear/LocalLoop/Controller/Admin/Feedback.pm +++ b/lib/Pear/LocalLoop/Controller/Admin/Feedback.pm @@ -18,6 +18,8 @@ sub index { }, ); $c->stash( feedback_rs => $feedback_rs ); + + return 1; } sub read { @@ -32,6 +34,8 @@ sub read { $c->flash( error => 'No Feedback found' ); $c->redirect_to('/admin/feedback'); } + + return 1; } sub actioned { @@ -48,6 +52,8 @@ sub actioned { $c->flash( error => 'No Feedback found' ); $c->redirect_to('/admin/feedback'); } + + return 1; } 1; diff --git a/lib/Pear/LocalLoop/Controller/Admin/Import.pm b/lib/Pear/LocalLoop/Controller/Admin/Import.pm index 8ca2e8a..4d1b0ee 100644 --- a/lib/Pear/LocalLoop/Controller/Admin/Import.pm +++ b/lib/Pear/LocalLoop/Controller/Admin/Import.pm @@ -21,6 +21,8 @@ sub index { }, ); $c->stash( import_rs => $import_rs ); + + return 1; } sub list { @@ -46,10 +48,14 @@ sub list { import_org_rs => $import_org_rs, import_lookup_rs => $import_lookup_rs, ); + + return 1; } sub get_add { my $c = shift; + + return 1; } sub post_add { @@ -147,6 +153,8 @@ sub post_add { $c->flash( success => 'Created Value Set' ); $c->redirect_to( '/admin/import/' . $value_set->id ); + + return 1; } sub _csv_flash_error { @@ -160,6 +168,8 @@ sub _csv_flash_error { #csv_data => $c->param('csv'), date_format => $c->param('date_format'), ); + + return 1; } sub get_user { @@ -209,6 +219,8 @@ sub get_user { lookup => $lookup_result, user_name => $user_name, ); + + return 1; } sub get_org { @@ -258,6 +270,8 @@ sub get_org { lookup => $lookup_result, org_name => $org_name, ); + + return 1; } sub ignore_value { diff --git a/lib/Pear/LocalLoop/Controller/Admin/ImportFrom.pm b/lib/Pear/LocalLoop/Controller/Admin/ImportFrom.pm index 72ce999..e8b47af 100644 --- a/lib/Pear/LocalLoop/Controller/Admin/ImportFrom.pm +++ b/lib/Pear/LocalLoop/Controller/Admin/ImportFrom.pm @@ -15,6 +15,8 @@ sub index { ]; $c->app->max_request_size(104857600); + + return 1; } sub post_suppliers { @@ -130,6 +132,8 @@ sub org_search { ); $c->render( json => \@results ); + + return 1; } 1; diff --git a/lib/Pear/LocalLoop/Controller/Admin/Organisations.pm b/lib/Pear/LocalLoop/Controller/Admin/Organisations.pm index ef85636..5b05a42 100644 --- a/lib/Pear/LocalLoop/Controller/Admin/Organisations.pm +++ b/lib/Pear/LocalLoop/Controller/Admin/Organisations.pm @@ -21,10 +21,14 @@ sub list { ); $c->stash( orgs_rs => $orgs_rs, ); + + return 1; } sub add_org { my $c = shift; + + return 1; } sub add_org_submit { @@ -87,6 +91,8 @@ sub add_org_submit { $c->redirect_to( '/admin/organisations/' . $organisation->id ); } }; + + return 1; } sub valid_read { @@ -112,6 +118,8 @@ sub valid_read { transactions => $transactions, associations => $assoc, ); + + return 1; } sub valid_edit { @@ -183,6 +191,8 @@ sub valid_edit { } }; $c->redirect_to( '/admin/organisations/' . $c->param('id') ); + + return 1; } sub merge_list { @@ -212,6 +222,8 @@ sub merge_list { org_result => $org_result, org_rs => $org_rs, ); + + return 1; } sub merge_detail { @@ -239,6 +251,8 @@ sub merge_detail { org_result => $org_result, target_result => $target_result, ); + + return 1; } sub merge_confirm { @@ -295,6 +309,8 @@ sub merge_confirm { } $c->redirect_to( '/admin/organisations/' . $org_id . '/merge/' . $target_id ); + + return 1; } 1; diff --git a/lib/Pear/LocalLoop/Controller/Admin/Reports.pm b/lib/Pear/LocalLoop/Controller/Admin/Reports.pm index fece5ee..8040fdf 100644 --- a/lib/Pear/LocalLoop/Controller/Admin/Reports.pm +++ b/lib/Pear/LocalLoop/Controller/Admin/Reports.pm @@ -59,6 +59,8 @@ sub transaction_data { json => { json => { data => $transaction_data } }, html => { transaction_rs => encode_json($transaction_data) }, ); + + return 1; } sub pg_or_sqlite { diff --git a/lib/Pear/LocalLoop/Controller/Admin/Tokens.pm b/lib/Pear/LocalLoop/Controller/Admin/Tokens.pm index 67481c5..887f2a8 100644 --- a/lib/Pear/LocalLoop/Controller/Admin/Tokens.pm +++ b/lib/Pear/LocalLoop/Controller/Admin/Tokens.pm @@ -12,6 +12,8 @@ sub index { my $token_rs = $c->result_set; $token_rs->result_class('DBIx::Class::ResultClass::HashRefInflator'); $c->stash( tokens => [ $token_rs->all ] ); + + return 1; } # POST @@ -43,6 +45,8 @@ sub create { $c->result_set->create( { name => $token_name } ); } $c->redirect_to('/admin/tokens'); + + return 1; } # GET @@ -58,6 +62,8 @@ sub read { $c->flash( error => 'No Token found' ); $c->redirect_to('/admin/tokens'); } + + return 1; } # POST @@ -89,6 +95,8 @@ sub update { $c->flash( error => 'No Token found' ); $c->redirect_to('/admin/tokens'); } + + return 1; } # DELETE @@ -105,6 +113,8 @@ sub delete { $c->flash( error => 'No Token found' ); } $c->redirect_to('/admin/tokens'); + + return 1; } 1; diff --git a/lib/Pear/LocalLoop/Controller/Admin/Transactions.pm b/lib/Pear/LocalLoop/Controller/Admin/Transactions.pm index f9cf3ee..a1833a4 100644 --- a/lib/Pear/LocalLoop/Controller/Admin/Transactions.pm +++ b/lib/Pear/LocalLoop/Controller/Admin/Transactions.pm @@ -66,6 +66,8 @@ sub index { count => $count, }, ); + + return 1; } sub read { @@ -80,6 +82,8 @@ sub read { $c->flash( error => 'No transaction found' ); $c->redirect_to('/admin/transactions'); } + + return 1; } sub image { @@ -95,6 +99,8 @@ sub image { else { $c->reply->static('image/no_transaction.jpg'); } + + return 1; } sub delete { @@ -114,6 +120,8 @@ sub delete { $c->flash( error => 'No transaction found' ); $c->redirect_to('/admin/transactions'); } + + return 1; } sub pg_or_sqlite { diff --git a/lib/Pear/LocalLoop/Controller/Admin/Users.pm b/lib/Pear/LocalLoop/Controller/Admin/Users.pm index a808a06..f5a2126 100644 --- a/lib/Pear/LocalLoop/Controller/Admin/Users.pm +++ b/lib/Pear/LocalLoop/Controller/Admin/Users.pm @@ -32,6 +32,8 @@ sub index { } ); $c->stash( user_rs => $user_rs ); + + return 1; } sub read { @@ -57,6 +59,8 @@ sub read { $c->flash( error => 'No User found' ); $c->redirect_to('/admin/users'); } + + return 1; } sub update { @@ -189,6 +193,8 @@ sub update { } $c->redirect_to( '/admin/users/' . $id ); + + return 1; } 1; diff --git a/lib/Pear/LocalLoop/Controller/Api/Auth.pm b/lib/Pear/LocalLoop/Controller/Api/Auth.pm index cb03903..64ca702 100644 --- a/lib/Pear/LocalLoop/Controller/Api/Auth.pm +++ b/lib/Pear/LocalLoop/Controller/Api/Auth.pm @@ -139,6 +139,8 @@ sub post_logout { message => 'Logged Out', } ); + + return 1; } 1; diff --git a/lib/Pear/LocalLoop/Controller/Api/V1/Supplier/Location.pm b/lib/Pear/LocalLoop/Controller/Api/V1/Supplier/Location.pm index 6199372..3fec296 100644 --- a/lib/Pear/LocalLoop/Controller/Api/V1/Supplier/Location.pm +++ b/lib/Pear/LocalLoop/Controller/Api/V1/Supplier/Location.pm @@ -122,6 +122,8 @@ sub index { } }, ); + + return 1; } sub trail_load { @@ -204,6 +206,8 @@ sub trail_load { } }, ); + + return 1; } 1; diff --git a/lib/Pear/LocalLoop/Controller/Root.pm b/lib/Pear/LocalLoop/Controller/Root.pm index 28a089e..6ed1bb9 100644 --- a/lib/Pear/LocalLoop/Controller/Root.pm +++ b/lib/Pear/LocalLoop/Controller/Root.pm @@ -7,6 +7,8 @@ sub index { # if ( $c->is_user_authenticated ) { # $c->redirect_to('/home'); # } + + return 1; } sub under { @@ -28,6 +30,8 @@ sub auth_login { else { $c->redirect_to('/'); } + + return 1; } sub auth_logout { @@ -35,10 +39,14 @@ sub auth_logout { $c->logout; $c->redirect_to('/'); + + return 1; } sub home { my $c = shift; + + return 1; } 1; diff --git a/lib/Pear/LocalLoop/Import/LCCCsv/Postcodes.pm b/lib/Pear/LocalLoop/Import/LCCCsv/Postcodes.pm index 164e484..e44be58 100644 --- a/lib/Pear/LocalLoop/Import/LCCCsv/Postcodes.pm +++ b/lib/Pear/LocalLoop/Import/LCCCsv/Postcodes.pm @@ -24,6 +24,8 @@ sub import_csv { while ( my $row = $self->get_csv_line ) { $self->_row_to_result($row); } + + return 1; } sub _row_to_result { @@ -45,6 +47,8 @@ sub _row_to_result { return if $postcode_r->ward; $postcode_r->update( { ward_id => $ward->id } ); + + return 1; } 1; diff --git a/lib/Pear/LocalLoop/Import/LCCCsv/Suppliers.pm b/lib/Pear/LocalLoop/Import/LCCCsv/Suppliers.pm index 5ba709a..d0df5c6 100644 --- a/lib/Pear/LocalLoop/Import/LCCCsv/Suppliers.pm +++ b/lib/Pear/LocalLoop/Import/LCCCsv/Suppliers.pm @@ -22,6 +22,8 @@ sub import_csv { while ( my $row = $self->get_csv_line ) { $self->_row_to_result($row); } + + return 1; } sub _row_to_result { @@ -56,6 +58,8 @@ sub _row_to_result { } } ); + + return 1; } 1; diff --git a/lib/Pear/LocalLoop/Import/LCCCsv/Transactions.pm b/lib/Pear/LocalLoop/Import/LCCCsv/Transactions.pm index 1dfbeb4..c711a8b 100644 --- a/lib/Pear/LocalLoop/Import/LCCCsv/Transactions.pm +++ b/lib/Pear/LocalLoop/Import/LCCCsv/Transactions.pm @@ -46,6 +46,8 @@ sub import_csv { while ( my $row = $self->get_csv_line ) { $self->_row_to_result( $row, $lcc_org ); } + + return 1; } sub _row_to_result { @@ -181,6 +183,8 @@ sub _row_to_result { ), } ); + + return 1; } 1; diff --git a/lib/Pear/LocalLoop/Plugin/BootstrapPagination.pm b/lib/Pear/LocalLoop/Plugin/BootstrapPagination.pm index 5ee6fec..b69cad3 100644 --- a/lib/Pear/LocalLoop/Plugin/BootstrapPagination.pm +++ b/lib/Pear/LocalLoop/Plugin/BootstrapPagination.pm @@ -176,7 +176,8 @@ sub register { return b($html); } ); - + + return 1; } 1; diff --git a/lib/Pear/LocalLoop/Plugin/Currency.pm b/lib/Pear/LocalLoop/Plugin/Currency.pm index 68cec27..287b7ae 100644 --- a/lib/Pear/LocalLoop/Plugin/Currency.pm +++ b/lib/Pear/LocalLoop/Plugin/Currency.pm @@ -24,6 +24,8 @@ sub register { return sprintf( '£%.2f', $value / 100000 ); } ); + + return 1; } 1; diff --git a/lib/Pear/LocalLoop/Plugin/Datetime.pm b/lib/Pear/LocalLoop/Plugin/Datetime.pm index c942656..2f94e1f 100644 --- a/lib/Pear/LocalLoop/Plugin/Datetime.pm +++ b/lib/Pear/LocalLoop/Plugin/Datetime.pm @@ -95,6 +95,7 @@ sub register { } ); + return 1; } 1; diff --git a/lib/Pear/LocalLoop/Plugin/Minion.pm b/lib/Pear/LocalLoop/Plugin/Minion.pm index c093c18..b4edba7 100644 --- a/lib/Pear/LocalLoop/Plugin/Minion.pm +++ b/lib/Pear/LocalLoop/Plugin/Minion.pm @@ -34,7 +34,8 @@ sub register { else { $app->log->debug('No Minion Config'); } - + + return 1; } 1; diff --git a/lib/Pear/LocalLoop/Plugin/Minion/Job/csv_postcode_import.pm b/lib/Pear/LocalLoop/Plugin/Minion/Job/csv_postcode_import.pm index 5511fa1..e1e491c 100644 --- a/lib/Pear/LocalLoop/Plugin/Minion/Job/csv_postcode_import.pm +++ b/lib/Pear/LocalLoop/Plugin/Minion/Job/csv_postcode_import.pm @@ -10,6 +10,8 @@ sub run { csv_file => $filename, schema => $self->app->schema )->import_csv; + + return 1; } 1; diff --git a/lib/Pear/LocalLoop/Plugin/Minion/Job/csv_supplier_import.pm b/lib/Pear/LocalLoop/Plugin/Minion/Job/csv_supplier_import.pm index 8617517..d051b14 100644 --- a/lib/Pear/LocalLoop/Plugin/Minion/Job/csv_supplier_import.pm +++ b/lib/Pear/LocalLoop/Plugin/Minion/Job/csv_supplier_import.pm @@ -10,6 +10,8 @@ sub run { csv_file => $filename, schema => $self->app->schema )->import_csv; + + return 1; } 1; diff --git a/lib/Pear/LocalLoop/Plugin/Minion/Job/csv_transaction_import.pm b/lib/Pear/LocalLoop/Plugin/Minion/Job/csv_transaction_import.pm index a6b7354..8ec0841 100644 --- a/lib/Pear/LocalLoop/Plugin/Minion/Job/csv_transaction_import.pm +++ b/lib/Pear/LocalLoop/Plugin/Minion/Job/csv_transaction_import.pm @@ -11,6 +11,8 @@ sub run { schema => $self->app->schema, target_entity_id => $entity_id, )->import_csv; + + return 1; } 1; diff --git a/lib/Pear/LocalLoop/Plugin/Minion/Job/entity_postcode_lookup.pm b/lib/Pear/LocalLoop/Plugin/Minion/Job/entity_postcode_lookup.pm index 57014d4..48f6a20 100644 --- a/lib/Pear/LocalLoop/Plugin/Minion/Job/entity_postcode_lookup.pm +++ b/lib/Pear/LocalLoop/Plugin/Minion/Job/entity_postcode_lookup.pm @@ -30,6 +30,8 @@ sub run { } } } + + return 1; } 1; diff --git a/lib/Pear/LocalLoop/Plugin/Minion/Job/leaderboards_recalc.pm b/lib/Pear/LocalLoop/Plugin/Minion/Job/leaderboards_recalc.pm index e1bbbfd..5046aa3 100644 --- a/lib/Pear/LocalLoop/Plugin/Minion/Job/leaderboards_recalc.pm +++ b/lib/Pear/LocalLoop/Plugin/Minion/Job/leaderboards_recalc.pm @@ -7,6 +7,8 @@ sub run { my $leaderboard_rs = $self->app->schema->resultset('Leaderboard'); $leaderboard_rs->recalculate_all; + + return 1; } 1; diff --git a/lib/Pear/LocalLoop/Plugin/Minion/Job/test.pm b/lib/Pear/LocalLoop/Plugin/Minion/Job/test.pm index a02db92..6fd0230 100644 --- a/lib/Pear/LocalLoop/Plugin/Minion/Job/test.pm +++ b/lib/Pear/LocalLoop/Plugin/Minion/Job/test.pm @@ -8,6 +8,8 @@ sub run { for my $arg (@args) { $self->job->app->log->debug($arg); } + + return 1; } 1; diff --git a/lib/Pear/LocalLoop/Plugin/Postcodes.pm b/lib/Pear/LocalLoop/Plugin/Postcodes.pm index 428648b..60e8ddf 100644 --- a/lib/Pear/LocalLoop/Plugin/Postcodes.pm +++ b/lib/Pear/LocalLoop/Plugin/Postcodes.pm @@ -71,6 +71,8 @@ sub register { return; } ); + + return 1; } 1; diff --git a/lib/Pear/LocalLoop/Plugin/TemplateHelpers.pm b/lib/Pear/LocalLoop/Plugin/TemplateHelpers.pm index 55fac82..b540f0d 100644 --- a/lib/Pear/LocalLoop/Plugin/TemplateHelpers.pm +++ b/lib/Pear/LocalLoop/Plugin/TemplateHelpers.pm @@ -15,7 +15,8 @@ sub register { } } ); - + + return 1; } 1; diff --git a/lib/Pear/LocalLoop/Plugin/Validators.pm b/lib/Pear/LocalLoop/Plugin/Validators.pm index 207ec46..6acb616 100644 --- a/lib/Pear/LocalLoop/Plugin/Validators.pm +++ b/lib/Pear/LocalLoop/Plugin/Validators.pm @@ -101,6 +101,8 @@ sub register { ); $app->helper( validation_error => sub { _validation_error(@_) } ); + + return 1; } =head2 validation_error diff --git a/lib/Pear/LocalLoop/Schema/Result/Organisation.pm b/lib/Pear/LocalLoop/Schema/Result/Organisation.pm index 06be273..a9be49e 100644 --- a/lib/Pear/LocalLoop/Schema/Result/Organisation.pm +++ b/lib/Pear/LocalLoop/Schema/Result/Organisation.pm @@ -146,6 +146,8 @@ sub sqlt_deploy_hook { else { $pending_field->{default_value} = \"false"; } + + return 1; } sub to_bool { diff --git a/lib/Pear/LocalLoop/Schema/Result/Transaction.pm b/lib/Pear/LocalLoop/Schema/Result/Transaction.pm index d951d9e..5e96089 100644 --- a/lib/Pear/LocalLoop/Schema/Result/Transaction.pm +++ b/lib/Pear/LocalLoop/Schema/Result/Transaction.pm @@ -103,6 +103,8 @@ sub sqlt_deploy_hook { else { $pending_field->{default_value} = \"false"; } + + return 1; } 1; diff --git a/lib/Pear/LocalLoop/Schema/Result/User.pm b/lib/Pear/LocalLoop/Schema/Result/User.pm index 2e0de1b..4340470 100644 --- a/lib/Pear/LocalLoop/Schema/Result/User.pm +++ b/lib/Pear/LocalLoop/Schema/Result/User.pm @@ -84,6 +84,12 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +__PACKAGE__->filter_column( + is_admin => { + filter_to_storage => 'to_bool', + } +); + sub sqlt_deploy_hook { my ( $source_instance, $sqlt_table ) = @_; my $pending_field = $sqlt_table->get_field('is_admin'); @@ -93,14 +99,10 @@ sub sqlt_deploy_hook { else { $pending_field->{default_value} = \"false"; } + + return 1; } -__PACKAGE__->filter_column( - is_admin => { - filter_to_storage => 'to_bool', - } -); - sub to_bool { my ( $self, $val ) = @_; my $driver_name = diff --git a/lib/Pear/LocalLoop/Schema/ResultSet/Entity.pm b/lib/Pear/LocalLoop/Schema/ResultSet/Entity.pm index 3fdb4e1..eb89608 100644 --- a/lib/Pear/LocalLoop/Schema/ResultSet/Entity.pm +++ b/lib/Pear/LocalLoop/Schema/ResultSet/Entity.pm @@ -5,7 +5,7 @@ use warnings; use base 'DBIx::Class::ResultSet'; -sub sales { shift->search_related( 'sales', @_ ) } +sub sales { return shift->search_related( 'sales', @_ ) } sub create_org { my ( $self, $org ) = @_; @@ -16,6 +16,8 @@ sub create_org { type => 'organisation', } ); + + return 1; } 1; diff --git a/lib/Pear/LocalLoop/Schema/ResultSet/Leaderboard.pm b/lib/Pear/LocalLoop/Schema/ResultSet/Leaderboard.pm index 2a1dedc..fdb794b 100644 --- a/lib/Pear/LocalLoop/Schema/ResultSet/Leaderboard.pm +++ b/lib/Pear/LocalLoop/Schema/ResultSet/Leaderboard.pm @@ -92,6 +92,8 @@ sub recalculate_all { warn "Unrecognised Set"; } } + + return 1; } sub _recalculate_leaderboard { @@ -105,6 +107,8 @@ sub _recalculate_leaderboard { $lb_result->create_new($date); } ); + + return 1; } 1; diff --git a/lib/Pear/LocalLoop/Schema/ResultSet/Organisation.pm b/lib/Pear/LocalLoop/Schema/ResultSet/Organisation.pm index db6ad56..afa028f 100644 --- a/lib/Pear/LocalLoop/Schema/ResultSet/Organisation.pm +++ b/lib/Pear/LocalLoop/Schema/ResultSet/Organisation.pm @@ -5,6 +5,6 @@ use warnings; use base 'DBIx::Class::ResultSet'; -sub entity { shift->search_related( 'entity', @_ ) } +sub entity { return shift->search_related( 'entity', @_ ) } 1; diff --git a/lib/Pear/LocalLoop/Schema/Script/DeploymentHandler.pm b/lib/Pear/LocalLoop/Schema/Script/DeploymentHandler.pm index 9f5b841..11b332a 100644 --- a/lib/Pear/LocalLoop/Schema/Script/DeploymentHandler.pm +++ b/lib/Pear/LocalLoop/Schema/Script/DeploymentHandler.pm @@ -207,6 +207,8 @@ sub cmd_write_ddl { } ); } + + return 1; } =head2 install_dh @@ -225,6 +227,8 @@ sub cmd_install_dh { version => $self->version, } ); + + return 1; } =head2 install @@ -241,6 +245,8 @@ sub cmd_install { version => $self->version, } ); + + return 1; } =head2 upgrade @@ -253,6 +259,8 @@ sub cmd_upgrade { my ($self) = @_; $self->dh->upgrade; + + return 1; } =head1 AUTHOR diff --git a/lib/Test/Pear/LocalLoop.pm b/lib/Test/Pear/LocalLoop.pm index 5da847c..2de5f80 100644 --- a/lib/Test/Pear/LocalLoop.pm +++ b/lib/Test/Pear/LocalLoop.pm @@ -14,6 +14,8 @@ sub BUILD { or die "you need Test::PostgreSQL to run PG testing"; Test::PostgreSQL->import; } + + return 1; } sub DEMOLISH { @@ -23,6 +25,8 @@ sub DEMOLISH { $self->mojo->app->schema->storage->dbh->disconnect; $self->pg->stop; } + + return 1; } has pg => ( @@ -141,6 +145,8 @@ sub register_customer { $self->framework->post_ok( '/api/register' => json => $json ) ->status_is(200)->or( $self->dump_error ) ->json_is( '/success', Mojo::JSON->true )->or( $self->dump_error ); + + return 1; } sub register_organisation { @@ -151,6 +157,8 @@ sub register_organisation { $self->framework->post_ok( '/api/register' => json => $args ) ->status_is(200)->or( $self->dump_error ) ->json_is( '/success', Mojo::JSON->true )->or( $self->dump_error ); + + return 1; } sub login { @@ -172,6 +180,8 @@ sub logout { '/api/logout' => json => { session_key => $session_key } ) ->status_is(200)->json_is( '/success', Mojo::JSON->true ) ->json_like( '/message', qr/Logged Out/ ); + + return 1; } sub gen_upload { @@ -187,6 +197,8 @@ sub gen_upload { json => Mojo::JSON::encode_json($args), file => $file, }; + + return 1; } sub install_fixtures { @@ -241,6 +253,8 @@ sub install_fixtures { } ); } + + return 1; } 1;