aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r--perllib/FixMyStreet/Cobrand.pm13
-rw-r--r--perllib/FixMyStreet/DB/Result/Alert.pm5
-rw-r--r--perllib/FixMyStreet/DB/Result/Comment.pm5
-rw-r--r--perllib/FixMyStreet/DB/Result/Contact.pm5
-rw-r--r--perllib/FixMyStreet/DB/Result/Nearby.pm5
-rw-r--r--perllib/FixMyStreet/DB/Result/Problem.pm5
-rw-r--r--perllib/FixMyStreet/DB/Result/Questionnaire.pm2
-rw-r--r--perllib/FixMyStreet/Roles/Abuser.pm2
-rw-r--r--perllib/FixMyStreet/Roles/Extra.pm7
-rw-r--r--perllib/FixMyStreet/SendReport.pm19
-rw-r--r--perllib/FixMyStreet/SendReport/EastHants.pm2
-rw-r--r--perllib/FixMyStreet/SendReport/Email.pm2
-rw-r--r--perllib/FixMyStreet/SendReport/EmptyHomes.pm2
-rw-r--r--perllib/FixMyStreet/SendReport/Noop.pm2
-rw-r--r--perllib/FixMyStreet/SendReport/Open311.pm2
-rw-r--r--perllib/FixMyStreet/SendReport/Refused.pm2
-rw-r--r--perllib/FixMyStreet/SendReport/Zurich.pm2
17 files changed, 33 insertions, 49 deletions
diff --git a/perllib/FixMyStreet/Cobrand.pm b/perllib/FixMyStreet/Cobrand.pm
index ff7d7f943..9f61635d8 100644
--- a/perllib/FixMyStreet/Cobrand.pm
+++ b/perllib/FixMyStreet/Cobrand.pm
@@ -8,7 +8,7 @@ use warnings;
use FixMyStreet;
use Carp;
-use Moose;
+use Package::Stash;
use Module::Pluggable
sub_name => '_cobrands',
@@ -77,11 +77,12 @@ sub available_cobrand_classes {
sub class {
my $avail = shift;
return $avail->{class} if $avail->{class};
- my $moniker = $avail->{moniker};
- Class::MOP::Class->create("FixMyStreet::Cobrand::$moniker" => (
- superclasses => [ 'FixMyStreet::Cobrand::Default' ],
- ));
- return "FixMyStreet::Cobrand::$moniker";
+ my $moniker = "FixMyStreet::Cobrand::$avail->{moniker}";
+ my $class = bless {}, $moniker;
+ my $stash = Package::Stash->new($moniker);
+ my $isa = $stash->get_or_add_symbol('@ISA');
+ @{$isa} = ('FixMyStreet::Cobrand::Default');
+ return $moniker;
}
=head2 get_class_for_host
diff --git a/perllib/FixMyStreet/DB/Result/Alert.pm b/perllib/FixMyStreet/DB/Result/Alert.pm
index 35cce8368..2a52a7bca 100644
--- a/perllib/FixMyStreet/DB/Result/Alert.pm
+++ b/perllib/FixMyStreet/DB/Result/Alert.pm
@@ -70,7 +70,7 @@ __PACKAGE__->belongs_to(
# You can replace this text with custom code or comments, and it will be preserved on regeneration
-use Moose;
+use Moo;
use namespace::clean -except => [ 'meta' ];
with 'FixMyStreet::Roles::Abuser';
@@ -113,7 +113,4 @@ sub disable {
return 1;
}
-# need the inline_constuctor bit as we don't inherit from Moose
-__PACKAGE__->meta->make_immutable( inline_constructor => 0 );
-
1;
diff --git a/perllib/FixMyStreet/DB/Result/Comment.pm b/perllib/FixMyStreet/DB/Result/Comment.pm
index 04493b5b5..41e8cf315 100644
--- a/perllib/FixMyStreet/DB/Result/Comment.pm
+++ b/perllib/FixMyStreet/DB/Result/Comment.pm
@@ -96,7 +96,7 @@ __PACKAGE__->belongs_to(
__PACKAGE__->load_components("+FixMyStreet::DB::RABXColumn");
__PACKAGE__->rabx_column('extra');
-use Moose;
+use Moo;
use Utils::Photo;
use namespace::clean -except => [ 'meta' ];
@@ -214,7 +214,4 @@ __PACKAGE__->might_have(
{ cascade_copy => 0, cascade_delete => 1 },
);
-# we need the inline_constructor bit as we don't inherit from Moose
-__PACKAGE__->meta->make_immutable( inline_constructor => 0 );
-
1;
diff --git a/perllib/FixMyStreet/DB/Result/Contact.pm b/perllib/FixMyStreet/DB/Result/Contact.pm
index 2fbb0716d..dab5432c6 100644
--- a/perllib/FixMyStreet/DB/Result/Contact.pm
+++ b/perllib/FixMyStreet/DB/Result/Contact.pm
@@ -63,12 +63,9 @@ __PACKAGE__->belongs_to(
__PACKAGE__->load_components("+FixMyStreet::DB::RABXColumn");
__PACKAGE__->rabx_column('extra');
-use Moose;
+use Moo;
use namespace::clean -except => [ 'meta' ];
with 'FixMyStreet::Roles::Extra';
-# we need the inline_constructor bit as we don't inherit from Moose
-__PACKAGE__->meta->make_immutable( inline_constructor => 0 );
-
1;
diff --git a/perllib/FixMyStreet/DB/Result/Nearby.pm b/perllib/FixMyStreet/DB/Result/Nearby.pm
index d3d228788..adeba703a 100644
--- a/perllib/FixMyStreet/DB/Result/Nearby.pm
+++ b/perllib/FixMyStreet/DB/Result/Nearby.pm
@@ -6,7 +6,7 @@ use strict;
use warnings;
use base 'DBIx::Class::Core';
-use Moose;
+use Moo;
use namespace::clean -except => [ 'meta' ];
__PACKAGE__->table( 'NONE' );
@@ -27,7 +27,4 @@ __PACKAGE__->belongs_to(
__PACKAGE__->result_source_instance
->name( \'problem_find_nearby(?,?,?)' );
-# we need the inline_constructor bit as we don't inherit from Moose
-__PACKAGE__->meta->make_immutable( inline_constructor => 0 );
-
1;
diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm
index e340acf1e..5c4511268 100644
--- a/perllib/FixMyStreet/DB/Result/Problem.pm
+++ b/perllib/FixMyStreet/DB/Result/Problem.pm
@@ -157,7 +157,7 @@ __PACKAGE__->load_components("+FixMyStreet::DB::RABXColumn");
__PACKAGE__->rabx_column('extra');
__PACKAGE__->rabx_column('geocode');
-use Moose;
+use Moo;
use namespace::clean -except => [ 'meta' ];
use Utils;
use Utils::Photo;
@@ -891,7 +891,4 @@ sub get_time_spent {
return $admin_logs ? $admin_logs->get_column('sum_time_spent') : 0;
}
-# we need the inline_constructor bit as we don't inherit from Moose
-__PACKAGE__->meta->make_immutable( inline_constructor => 0 );
-
1;
diff --git a/perllib/FixMyStreet/DB/Result/Questionnaire.pm b/perllib/FixMyStreet/DB/Result/Questionnaire.pm
index 6f2941546..30f2ab7ce 100644
--- a/perllib/FixMyStreet/DB/Result/Questionnaire.pm
+++ b/perllib/FixMyStreet/DB/Result/Questionnaire.pm
@@ -43,7 +43,7 @@ __PACKAGE__->belongs_to(
# Created by DBIx::Class::Schema::Loader v0.07035 @ 2013-09-10 17:11:54
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:oL1Hk4/bNG14CY74GA75SA
-use Moose;
+use Moo;
use namespace::clean -except => [ 'meta' ];
my $stz = sub {
diff --git a/perllib/FixMyStreet/Roles/Abuser.pm b/perllib/FixMyStreet/Roles/Abuser.pm
index b9e951305..fc76565ca 100644
--- a/perllib/FixMyStreet/Roles/Abuser.pm
+++ b/perllib/FixMyStreet/Roles/Abuser.pm
@@ -1,6 +1,6 @@
package FixMyStreet::Roles::Abuser;
-use Moose::Role;
+use Moo::Role;
=head2 is_from_abuser
diff --git a/perllib/FixMyStreet/Roles/Extra.pm b/perllib/FixMyStreet/Roles/Extra.pm
index f815a3e9a..19fc91873 100644
--- a/perllib/FixMyStreet/Roles/Extra.pm
+++ b/perllib/FixMyStreet/Roles/Extra.pm
@@ -1,5 +1,5 @@
package FixMyStreet::Roles::Extra;
-use Moose::Role;
+use Moo::Role;
=head1 NAME
@@ -9,12 +9,9 @@ FixMyStreet::Roles::Extra - role for accessing {extra} field
This is to applied to a DB class like Problem or Contacts that has a rich {extra} field:
- use Moose;
+ use Moo;
with 'FixMyStreet::Roles::Extra';
-(NB: there is actually a little more boilerplate, because DBIC doesn't actually
-inherit from Moose, see ::Problem for an example.)
-
Then:
$contact->set_extra_fields(
diff --git a/perllib/FixMyStreet/SendReport.pm b/perllib/FixMyStreet/SendReport.pm
index 9967b0663..40ec4caf2 100644
--- a/perllib/FixMyStreet/SendReport.pm
+++ b/perllib/FixMyStreet/SendReport.pm
@@ -1,20 +1,21 @@
package FixMyStreet::SendReport;
-use Moose;
+use Moo;
+use MooX::Types::MooseLike::Base qw(:all);
use Module::Pluggable
sub_name => 'senders',
search_path => __PACKAGE__,
require => 1;
-has 'body_config' => ( is => 'rw', isa => 'HashRef', default => sub { {} } );
-has 'bodies' => ( is => 'rw', isa => 'ArrayRef', default => sub { [] } );
-has 'to' => ( is => 'rw', isa => 'ArrayRef', default => sub { [] } );
-has 'bcc' => ( is => 'rw', isa => 'ArrayRef', default => sub { [] } );
-has 'success' => ( is => 'rw', isa => 'Bool', default => 0 );
-has 'error' => ( is => 'rw', isa => 'Str', default => '' );
-has 'unconfirmed_counts' => ( 'is' => 'rw', isa => 'HashRef', default => sub { {} } );
-has 'unconfirmed_notes' => ( 'is' => 'rw', isa => 'HashRef', default => sub { {} } );
+has 'body_config' => ( is => 'rw', isa => HashRef, default => sub { {} } );
+has 'bodies' => ( is => 'rw', isa => ArrayRef, default => sub { [] } );
+has 'to' => ( is => 'rw', isa => ArrayRef, default => sub { [] } );
+has 'bcc' => ( is => 'rw', isa => ArrayRef, default => sub { [] } );
+has 'success' => ( is => 'rw', isa => Bool, default => 0 );
+has 'error' => ( is => 'rw', isa => Str, default => '' );
+has 'unconfirmed_counts' => ( 'is' => 'rw', isa => HashRef, default => sub { {} } );
+has 'unconfirmed_notes' => ( 'is' => 'rw', isa => HashRef, default => sub { {} } );
sub should_skip {
diff --git a/perllib/FixMyStreet/SendReport/EastHants.pm b/perllib/FixMyStreet/SendReport/EastHants.pm
index 44bc084b1..697519b48 100644
--- a/perllib/FixMyStreet/SendReport/EastHants.pm
+++ b/perllib/FixMyStreet/SendReport/EastHants.pm
@@ -1,6 +1,6 @@
package FixMyStreet::SendReport::EastHants;
-use Moose;
+use Moo;
BEGIN { extends 'FixMyStreet::SendReport'; }
diff --git a/perllib/FixMyStreet/SendReport/Email.pm b/perllib/FixMyStreet/SendReport/Email.pm
index bc526ded2..3e993ecd6 100644
--- a/perllib/FixMyStreet/SendReport/Email.pm
+++ b/perllib/FixMyStreet/SendReport/Email.pm
@@ -1,6 +1,6 @@
package FixMyStreet::SendReport::Email;
-use Moose;
+use Moo;
use FixMyStreet::Email;
BEGIN { extends 'FixMyStreet::SendReport'; }
diff --git a/perllib/FixMyStreet/SendReport/EmptyHomes.pm b/perllib/FixMyStreet/SendReport/EmptyHomes.pm
index bf7164e21..a4cdd3e40 100644
--- a/perllib/FixMyStreet/SendReport/EmptyHomes.pm
+++ b/perllib/FixMyStreet/SendReport/EmptyHomes.pm
@@ -1,6 +1,6 @@
package FixMyStreet::SendReport::EmptyHomes;
-use Moose;
+use Moo;
use namespace::autoclean;
use mySociety::MaPit;
diff --git a/perllib/FixMyStreet/SendReport/Noop.pm b/perllib/FixMyStreet/SendReport/Noop.pm
index f2e0a3bdb..60edda373 100644
--- a/perllib/FixMyStreet/SendReport/Noop.pm
+++ b/perllib/FixMyStreet/SendReport/Noop.pm
@@ -1,6 +1,6 @@
package FixMyStreet::SendReport::Noop;
-use Moose;
+use Moo;
BEGIN { extends 'FixMyStreet::SendReport'; }
diff --git a/perllib/FixMyStreet/SendReport/Open311.pm b/perllib/FixMyStreet/SendReport/Open311.pm
index 14dd65fa6..1917c2f58 100644
--- a/perllib/FixMyStreet/SendReport/Open311.pm
+++ b/perllib/FixMyStreet/SendReport/Open311.pm
@@ -1,6 +1,6 @@
package FixMyStreet::SendReport::Open311;
-use Moose;
+use Moo;
use namespace::autoclean;
BEGIN { extends 'FixMyStreet::SendReport'; }
diff --git a/perllib/FixMyStreet/SendReport/Refused.pm b/perllib/FixMyStreet/SendReport/Refused.pm
index d71fc5c2c..c6c1a660d 100644
--- a/perllib/FixMyStreet/SendReport/Refused.pm
+++ b/perllib/FixMyStreet/SendReport/Refused.pm
@@ -1,6 +1,6 @@
package FixMyStreet::SendReport::Refused;
-use Moose;
+use Moo;
BEGIN { extends 'FixMyStreet::SendReport::Noop'; }
diff --git a/perllib/FixMyStreet/SendReport/Zurich.pm b/perllib/FixMyStreet/SendReport/Zurich.pm
index 7af4cf4f5..a8730bbe4 100644
--- a/perllib/FixMyStreet/SendReport/Zurich.pm
+++ b/perllib/FixMyStreet/SendReport/Zurich.pm
@@ -1,6 +1,6 @@
package FixMyStreet::SendReport::Zurich;
-use Moose;
+use Moo;
BEGIN { extends 'FixMyStreet::SendReport::Email'; }