From 758dd9e70f8ea09bbace2a550815290994997122 Mon Sep 17 00:00:00 2001 From: Rumperuu Date: Sat, 20 Mar 2021 19:03:59 +0000 Subject: [PATCH] Fix builtin homonym linter errors --- lib/Pear/LocalLoop.pm | 38 +++++++++---------- .../LocalLoop/Controller/Admin/Categories.pm | 6 +-- .../LocalLoop/Controller/Admin/Feedback.pm | 4 +- lib/Pear/LocalLoop/Controller/Admin/Import.pm | 2 +- .../LocalLoop/Controller/Admin/ImportFrom.pm | 2 +- lib/Pear/LocalLoop/Controller/Admin/Tokens.pm | 6 +-- .../Controller/Admin/Transactions.pm | 6 +++ lib/Pear/LocalLoop/Controller/Admin/Users.pm | 6 +++ .../Controller/Api/V1/Customer/Graphs.pm | 2 +- .../Controller/Api/V1/Customer/Pies.pm | 2 +- .../Controller/Api/V1/Customer/Snippets.pm | 2 +- .../Controller/Api/V1/Organisation/Graphs.pm | 2 +- .../Controller/Api/V1/Organisation/Pies.pm | 2 +- .../Api/V1/Organisation/Snippets.pm | 2 +- .../Controller/Api/V1/Supplier/Location.pm | 2 +- .../Controller/Api/V1/User/Medals.pm | 2 +- .../Controller/Api/V1/User/Points.pm | 2 +- lib/Pear/LocalLoop/Controller/Root.pm | 2 + 18 files changed, 52 insertions(+), 38 deletions(-) diff --git a/lib/Pear/LocalLoop.pm b/lib/Pear/LocalLoop.pm index 5f04a65..7ace853 100644 --- a/lib/Pear/LocalLoop.pm +++ b/lib/Pear/LocalLoop.pm @@ -216,20 +216,20 @@ sub startup { my $api_v1_user = $api_v1->under('/user'); - $api_v1_user->post('/medals')->to('api-v1-user-medals#index'); - $api_v1_user->post('/points')->to('api-v1-user-points#index'); + $api_v1_user->post('/medals')->to('api-v1-user-medals#idx'); + $api_v1_user->post('/points')->to('api-v1-user-points#idx'); my $api_v1_supplier = $api_v1->under('/supplier'); - $api_v1_supplier->post('/location')->to('api-v1-supplier-location#index'); + $api_v1_supplier->post('/location')->to('api-v1-supplier-location#idx'); $api_v1_supplier->post('/location/trail') ->to('api-v1-supplier-location#trail_load'); my $api_v1_org = $api_v1->under('/organisation')->to('api-v1-organisation#auth'); - $api_v1_org->post('/graphs')->to('api-v1-organisation-graphs#index'); - $api_v1_org->post('/snippets')->to('api-v1-organisation-snippets#index'); + $api_v1_org->post('/graphs')->to('api-v1-organisation-graphs#idx'); + $api_v1_org->post('/snippets')->to('api-v1-organisation-snippets#idx'); $api_v1_org->post('/payroll')->to('api-organisation#post_payroll_read'); $api_v1_org->post('/payroll/add')->to('api-organisation#post_payroll_add'); $api_v1_org->post('/supplier')->to('api-organisation#post_supplier_read'); @@ -252,13 +252,13 @@ sub startup { $api_v1_org->post('/external/lcc_tables') ->to('api-external#post_lcc_table_summary'); - $api_v1_org->post('/pies')->to('api-v1-organisation-pies#index'); + $api_v1_org->post('/pies')->to('api-v1-organisation-pies#idx'); my $api_v1_cust = $api_v1->under('/customer')->to('api-v1-customer#auth'); - $api_v1_cust->post('/graphs')->to('api-v1-customer-graphs#index'); - $api_v1_cust->post('/snippets')->to('api-v1-customer-snippets#index'); - $api_v1_cust->post('/pies')->to('api-v1-customer-pies#index'); + $api_v1_cust->post('/graphs')->to('api-v1-customer-graphs#idx'); + $api_v1_cust->post('/snippets')->to('api-v1-customer-snippets#idx'); + $api_v1_cust->post('/pies')->to('api-v1-customer-pies#idx'); my $admin_routes = $r->under('/admin')->to('admin#under'); @@ -272,18 +272,18 @@ sub startup { } $admin_routes->get('/home')->to('admin#home'); - $admin_routes->get('/tokens')->to('admin-tokens#index'); + $admin_routes->get('/tokens')->to('admin-tokens#idx'); $admin_routes->post('/tokens')->to('admin-tokens#create'); - $admin_routes->get('/tokens/:id')->to('admin-tokens#read'); + $admin_routes->get('/tokens/:id')->to('admin-tokens#get'); $admin_routes->post('/tokens/:id')->to('admin-tokens#update'); - $admin_routes->post('/tokens/:id/delete')->to('admin-tokens#delete'); + $admin_routes->post('/tokens/:id/delete')->to('admin-tokens#del'); - $admin_routes->get('/categories')->to('admin-categories#index'); + $admin_routes->get('/categories')->to('admin-categories#idx'); $admin_routes->post('/categories')->to('admin-categories#create'); - $admin_routes->get('/categories/:id')->to('admin-categories#read'); + $admin_routes->get('/categories/:id')->to('admin-categories#get'); $admin_routes->post('/categories/:id')->to('admin-categories#update'); $admin_routes->post('/categories/:id/delete') - ->to('admin-categories#delete'); + ->to('admin-categories#del'); $admin_routes->get('/users')->to('admin-users#index'); $admin_routes->get('/users/:id')->to('admin-users#read'); @@ -305,8 +305,8 @@ sub startup { $admin_routes->post('/organisations/:id/merge/:target_id') ->to('admin-organisations#merge_confirm'); - $admin_routes->get('/feedback')->to('admin-feedback#index'); - $admin_routes->get('/feedback/:id')->to('admin-feedback#read'); + $admin_routes->get('/feedback')->to('admin-feedback#idx'); + $admin_routes->get('/feedback/:id')->to('admin-feedback#get'); $admin_routes->get('/feedback/:id/actioned')->to('admin-feedback#actioned'); $admin_routes->get('/transactions')->to('admin-transactions#index'); @@ -319,7 +319,7 @@ sub startup { $admin_routes->get('/reports/transactions') ->to('admin-reports#transaction_data'); - $admin_routes->get('/import')->to('admin-import#index'); + $admin_routes->get('/import')->to('admin-import#idx'); $admin_routes->get('/import/add')->to('admin-import#get_add'); $admin_routes->post('/import/add')->to('admin-import#post_add'); $admin_routes->get('/import/:set_id')->to('admin-import#list'); @@ -330,7 +330,7 @@ sub startup { ->to('admin-import#ignore_value'); $admin_routes->get('/import/:set_id/import')->to('admin-import#run_import'); - $admin_routes->get('/import_from')->to('admin-import_from#index'); + $admin_routes->get('/import_from')->to('admin-import_from#idx'); $admin_routes->post('/import_from/suppliers') ->to('admin-import_from#post_suppliers'); $admin_routes->post('/import_from/transactions') diff --git a/lib/Pear/LocalLoop/Controller/Admin/Categories.pm b/lib/Pear/LocalLoop/Controller/Admin/Categories.pm index 53a3698..bb539c6 100644 --- a/lib/Pear/LocalLoop/Controller/Admin/Categories.pm +++ b/lib/Pear/LocalLoop/Controller/Admin/Categories.pm @@ -6,7 +6,7 @@ has result_set => sub { return $c->schema->resultset('Category'); }; -sub index { +sub idx { my $c = shift; my $category_rs = $c->result_set; @@ -50,7 +50,7 @@ sub create { } # GET -sub read { +sub get { my $c = shift; my $id = $c->param('id'); @@ -106,7 +106,7 @@ sub update { } # DELETE -sub delete { +sub del { my $c = shift; my $id = $c->param('id'); diff --git a/lib/Pear/LocalLoop/Controller/Admin/Feedback.pm b/lib/Pear/LocalLoop/Controller/Admin/Feedback.pm index 048f2af..2a39fb1 100644 --- a/lib/Pear/LocalLoop/Controller/Admin/Feedback.pm +++ b/lib/Pear/LocalLoop/Controller/Admin/Feedback.pm @@ -6,7 +6,7 @@ has result_set => sub { return $c->schema->resultset('Feedback'); }; -sub index { +sub idx { my $c = shift; my $feedback_rs = $c->result_set->search( @@ -22,7 +22,7 @@ sub index { return 1; } -sub read { +sub get { my $c = shift; my $id = $c->param('id'); diff --git a/lib/Pear/LocalLoop/Controller/Admin/Import.pm b/lib/Pear/LocalLoop/Controller/Admin/Import.pm index 4d1b0ee..4ef8f34 100644 --- a/lib/Pear/LocalLoop/Controller/Admin/Import.pm +++ b/lib/Pear/LocalLoop/Controller/Admin/Import.pm @@ -9,7 +9,7 @@ has result_set => sub { return $c->schema->resultset('ImportSet'); }; -sub index { +sub idx { my $c = shift; my $import_rs = $c->result_set->search( diff --git a/lib/Pear/LocalLoop/Controller/Admin/ImportFrom.pm b/lib/Pear/LocalLoop/Controller/Admin/ImportFrom.pm index e8b47af..b55916f 100644 --- a/lib/Pear/LocalLoop/Controller/Admin/ImportFrom.pm +++ b/lib/Pear/LocalLoop/Controller/Admin/ImportFrom.pm @@ -4,7 +4,7 @@ use Moo; use Try::Tiny; use Mojo::File qw/path/; -sub index { +sub idx { my $c = shift; $c->stash->{org_entities} = [ map { { id => $_->entity_id, name => $_->name } } diff --git a/lib/Pear/LocalLoop/Controller/Admin/Tokens.pm b/lib/Pear/LocalLoop/Controller/Admin/Tokens.pm index 887f2a8..eb3ec8d 100644 --- a/lib/Pear/LocalLoop/Controller/Admin/Tokens.pm +++ b/lib/Pear/LocalLoop/Controller/Admin/Tokens.pm @@ -6,7 +6,7 @@ has result_set => sub { return $c->schema->resultset('AccountToken'); }; -sub index { +sub idx { my $c = shift; my $token_rs = $c->result_set; @@ -50,7 +50,7 @@ sub create { } # GET -sub read { +sub get { my $c = shift; my $id = $c->param('id'); @@ -100,7 +100,7 @@ sub update { } # DELETE -sub delete { +sub del { my $c = shift; my $id = $c->param('id'); diff --git a/lib/Pear/LocalLoop/Controller/Admin/Transactions.pm b/lib/Pear/LocalLoop/Controller/Admin/Transactions.pm index a1833a4..23d5b18 100644 --- a/lib/Pear/LocalLoop/Controller/Admin/Transactions.pm +++ b/lib/Pear/LocalLoop/Controller/Admin/Transactions.pm @@ -8,7 +8,9 @@ has result_set => sub { return $c->schema->resultset('Transaction'); }; +## no critic (Subroutines::ProhibitBuiltinHomonyms) sub index { +## use critic my $c = shift; my $pending_transaction_rs = @@ -70,7 +72,9 @@ sub index { return 1; } +## no critic (Subroutines::ProhibitBuiltinHomonyms) sub read { +## use critic my $c = shift; my $id = $c->param('id'); @@ -103,7 +107,9 @@ sub image { return 1; } +## no critic (Subroutines::ProhibitBuiltinHomonyms) sub delete { +## use critic my $c = shift; my $id = $c->param('id'); diff --git a/lib/Pear/LocalLoop/Controller/Admin/Users.pm b/lib/Pear/LocalLoop/Controller/Admin/Users.pm index f5a2126..edd76b4 100644 --- a/lib/Pear/LocalLoop/Controller/Admin/Users.pm +++ b/lib/Pear/LocalLoop/Controller/Admin/Users.pm @@ -19,7 +19,9 @@ has organisation_result_set => sub { return $c->schema->resultset('Organisation'); }; +## no critic (Subroutines::ProhibitBuiltinHomonyms) sub index { +## use critic my $c = shift; my $user_rs = $c->user_result_set->search( @@ -36,7 +38,9 @@ sub index { return 1; } +## no critic (Subroutines::ProhibitBuiltinHomonyms) sub read { +## use critic my $c = shift; my $id = $c->param('id'); @@ -63,7 +67,9 @@ sub read { return 1; } +## no critic (Subroutines::ProhibitBuiltinHomonyms) sub update { +## use critic my $c = shift; my $id = $c->param('id'); diff --git a/lib/Pear/LocalLoop/Controller/Api/V1/Customer/Graphs.pm b/lib/Pear/LocalLoop/Controller/Api/V1/Customer/Graphs.pm index 5e927ac..b636c9b 100644 --- a/lib/Pear/LocalLoop/Controller/Api/V1/Customer/Graphs.pm +++ b/lib/Pear/LocalLoop/Controller/Api/V1/Customer/Graphs.pm @@ -10,7 +10,7 @@ has error_messages => sub { }; }; -sub index { +sub idx { my $c = shift; my $validation = $c->validation; diff --git a/lib/Pear/LocalLoop/Controller/Api/V1/Customer/Pies.pm b/lib/Pear/LocalLoop/Controller/Api/V1/Customer/Pies.pm index 30e2123..a39a776 100644 --- a/lib/Pear/LocalLoop/Controller/Api/V1/Customer/Pies.pm +++ b/lib/Pear/LocalLoop/Controller/Api/V1/Customer/Pies.pm @@ -1,7 +1,7 @@ package Pear::LocalLoop::Controller::Api::V1::Customer::Pies; use Mojo::Base 'Mojolicious::Controller'; -sub index { +sub idx { my $c = shift; my $entity = $c->stash->{api_user}->entity; diff --git a/lib/Pear/LocalLoop/Controller/Api/V1/Customer/Snippets.pm b/lib/Pear/LocalLoop/Controller/Api/V1/Customer/Snippets.pm index a7daca2..682947b 100644 --- a/lib/Pear/LocalLoop/Controller/Api/V1/Customer/Snippets.pm +++ b/lib/Pear/LocalLoop/Controller/Api/V1/Customer/Snippets.pm @@ -1,7 +1,7 @@ package Pear::LocalLoop::Controller::Api::V1::Customer::Snippets; use Mojo::Base 'Mojolicious::Controller'; -sub index { +sub idx { my $c = shift; my $entity = $c->stash->{api_user}->entity; diff --git a/lib/Pear/LocalLoop/Controller/Api/V1/Organisation/Graphs.pm b/lib/Pear/LocalLoop/Controller/Api/V1/Organisation/Graphs.pm index 5108804..462d066 100644 --- a/lib/Pear/LocalLoop/Controller/Api/V1/Organisation/Graphs.pm +++ b/lib/Pear/LocalLoop/Controller/Api/V1/Organisation/Graphs.pm @@ -10,7 +10,7 @@ has error_messages => sub { }; }; -sub index { +sub idx { my $c = shift; my $validation = $c->validation; diff --git a/lib/Pear/LocalLoop/Controller/Api/V1/Organisation/Pies.pm b/lib/Pear/LocalLoop/Controller/Api/V1/Organisation/Pies.pm index f554618..dcd4bd5 100644 --- a/lib/Pear/LocalLoop/Controller/Api/V1/Organisation/Pies.pm +++ b/lib/Pear/LocalLoop/Controller/Api/V1/Organisation/Pies.pm @@ -1,7 +1,7 @@ package Pear::LocalLoop::Controller::Api::V1::Organisation::Pies; use Mojo::Base 'Mojolicious::Controller'; -sub index { +sub idx { my $c = shift; my $entity = $c->stash->{api_user}->entity; diff --git a/lib/Pear/LocalLoop/Controller/Api/V1/Organisation/Snippets.pm b/lib/Pear/LocalLoop/Controller/Api/V1/Organisation/Snippets.pm index ddc5fe4..ababef2 100644 --- a/lib/Pear/LocalLoop/Controller/Api/V1/Organisation/Snippets.pm +++ b/lib/Pear/LocalLoop/Controller/Api/V1/Organisation/Snippets.pm @@ -1,7 +1,7 @@ package Pear::LocalLoop::Controller::Api::V1::Organisation::Snippets; use Mojo::Base 'Mojolicious::Controller'; -sub index { +sub idx { my $c = shift; my $entity = $c->stash->{api_user}->entity; diff --git a/lib/Pear/LocalLoop/Controller/Api/V1/Supplier/Location.pm b/lib/Pear/LocalLoop/Controller/Api/V1/Supplier/Location.pm index 3fec296..ae5d049 100644 --- a/lib/Pear/LocalLoop/Controller/Api/V1/Supplier/Location.pm +++ b/lib/Pear/LocalLoop/Controller/Api/V1/Supplier/Location.pm @@ -47,7 +47,7 @@ has validation_data => sub { }; }; -sub index { +sub idx { my $c = shift; return if $c->validation_error('index'); diff --git a/lib/Pear/LocalLoop/Controller/Api/V1/User/Medals.pm b/lib/Pear/LocalLoop/Controller/Api/V1/User/Medals.pm index 8a10846..f920ec5 100644 --- a/lib/Pear/LocalLoop/Controller/Api/V1/User/Medals.pm +++ b/lib/Pear/LocalLoop/Controller/Api/V1/User/Medals.pm @@ -2,7 +2,7 @@ package Pear::LocalLoop::Controller::Api::V1::User::Medals; use Mojo::Base 'Mojolicious::Controller'; use Mojo::JSON qw/true false/; -sub index { +sub idx { my $c = shift; my $validation = $c->validation; diff --git a/lib/Pear/LocalLoop/Controller/Api/V1/User/Points.pm b/lib/Pear/LocalLoop/Controller/Api/V1/User/Points.pm index 688cd90..3d32421 100644 --- a/lib/Pear/LocalLoop/Controller/Api/V1/User/Points.pm +++ b/lib/Pear/LocalLoop/Controller/Api/V1/User/Points.pm @@ -2,7 +2,7 @@ package Pear::LocalLoop::Controller::Api::V1::User::Points; use Mojo::Base 'Mojolicious::Controller'; use Mojo::JSON qw/true false/; -sub index { +sub idx { my $c = shift; my $validation = $c->validation; diff --git a/lib/Pear/LocalLoop/Controller/Root.pm b/lib/Pear/LocalLoop/Controller/Root.pm index 6ed1bb9..9106a7f 100644 --- a/lib/Pear/LocalLoop/Controller/Root.pm +++ b/lib/Pear/LocalLoop/Controller/Root.pm @@ -1,7 +1,9 @@ package Pear::LocalLoop::Controller::Root; use Mojo::Base 'Mojolicious::Controller'; +## no critic (Subroutines::ProhibitBuiltinHomonyms) sub index { +## use critic my $c = shift; # if ( $c->is_user_authenticated ) {