aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Cobrand.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2015-11-20 21:21:44 +0000
committerMatthew Somerville <matthew@mysociety.org>2015-12-02 17:41:41 +0000
commit358faad2426a11573ec9597592076cc0ac43e5f7 (patch)
tree437d54dffb9442b6030ae7decfa9b495d97533b8 /perllib/FixMyStreet/Cobrand.pm
parent55412b79394ff1b1cabe368aed67fa8f68680ecc (diff)
Move from Moose to Moo in non-App code.
And create default cobrand class without all of Moose.
Diffstat (limited to 'perllib/FixMyStreet/Cobrand.pm')
-rw-r--r--perllib/FixMyStreet/Cobrand.pm13
1 files changed, 7 insertions, 6 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