X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMooseX%2FStrictConstructor%2FRole%2FObject.pm;h=2e1d8710180826c15d0902073553a5be4307a85d;hb=5a0d49213abe7095b652c725efaad35cff6e24b9;hp=9f29e60a09a1f468485519850479324d18eb453b;hpb=d2d0fb5ec1ca61dbf8a44dd87fe3fa9ef112e50c;p=gitmo%2FMooseX-StrictConstructor.git diff --git a/lib/MooseX/StrictConstructor/Role/Object.pm b/lib/MooseX/StrictConstructor/Role/Object.pm index 9f29e60..2e1d871 100644 --- a/lib/MooseX/StrictConstructor/Role/Object.pm +++ b/lib/MooseX/StrictConstructor/Role/Object.pm @@ -5,24 +5,21 @@ use warnings; use Moose::Role; - -after 'BUILDALL' => sub -{ +after 'BUILDALL' => sub { my $self = shift; my $params = shift; - my %attrs = - ( map { $_ => 1 } - grep { defined } - map { $_->init_arg() } - $self->meta()->get_all_attributes() - ); + my %attrs = ( + map { $_ => 1 } + grep {defined} + map { $_->init_arg() } $self->meta()->get_all_attributes() + ); - my @bad = sort grep { ! $attrs{$_} } keys %{ $params }; + my @bad = sort grep { !$attrs{$_} } keys %{$params}; - if (@bad) - { - confess "Found unknown attribute(s) init_arg passed to the constructor: @bad"; + if (@bad) { + confess + "Found unknown attribute(s) init_arg passed to the constructor: @bad"; } return;