From: gfx Date: Fri, 12 Mar 2010 06:21:07 +0000 (+0900) Subject: Remove unused vars, suggested by Test::Vars X-Git-Tag: 0.50_09~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=commitdiff_plain;h=230dd14a72d301932a9c10cd5121046bc50659ce Remove unused vars, suggested by Test::Vars --- diff --git a/lib/Mouse/Exporter.pm b/lib/Mouse/Exporter.pm index c27653f..0067fa8 100644 --- a/lib/Mouse/Exporter.pm +++ b/lib/Mouse/Exporter.pm @@ -55,7 +55,7 @@ sub setup_import_methods{ } sub build_import_methods{ - my($class, %args) = @_; + my($self, %args) = @_; my $exporting_package = $args{exporting_package} ||= caller(); diff --git a/lib/Mouse/Meta/Attribute.pm b/lib/Mouse/Meta/Attribute.pm index c5ddbf0..9aa79ad 100644 --- a/lib/Mouse/Meta/Attribute.pm +++ b/lib/Mouse/Meta/Attribute.pm @@ -136,7 +136,8 @@ sub interpolate_class{ } sub canonicalize_args{ # DEPRECATED - my ($self, $name, %args) = @_; + #my($self, $name, %args) = @_; + my($self, undef, %args) = @_; Carp::cluck("$self->canonicalize_args has been deprecated." . "Use \$self->_process_options instead."); @@ -145,7 +146,8 @@ sub canonicalize_args{ # DEPRECATED } sub create { # DEPRECATED - my ($self, $class, $name, %args) = @_; + #my($self, $class, $name, %args) = @_; + my($self) = @_; Carp::cluck("$self->create has been deprecated." . "Use \$meta->add_attribute and \$attr->install_accessors instead."); @@ -155,7 +157,8 @@ sub create { # DEPRECATED } sub _coerce_and_verify { - my($self, $value, $instance) = @_; + #my($self, $value, $instance) = @_; + my($self, $value) = @_; my $type_constraint = $self->{type_constraint}; return $value if !defined $type_constraint; @@ -300,7 +303,8 @@ sub clear_value { sub associate_method{ - my ($attribute, $method_name) = @_; + #my($attribute, $method_name) = @_; + my($attribute) = @_; $attribute->{associated_methods}++; return; } diff --git a/lib/Mouse/Meta/Method/Accessor.pm b/lib/Mouse/Meta/Method/Accessor.pm index dc9736c..e470b43 100755 --- a/lib/Mouse/Meta/Method/Accessor.pm +++ b/lib/Mouse/Meta/Method/Accessor.pm @@ -136,22 +136,26 @@ sub _generate_accessor_any{ } sub _generate_accessor{ - my $class = shift; - return $class->_generate_accessor_any(rw => @_); + #my($self, $attribute, $metaclass) = @_; + my $self = shift; + return $self->_generate_accessor_any(rw => @_); } sub _generate_reader { - my $class = shift; - return $class->_generate_accessor_any(ro => @_); + #my($self, $attribute, $metaclass) = @_; + my $self = shift; + return $self->_generate_accessor_any(ro => @_); } sub _generate_writer { - my $class = shift; - return $class->_generate_accessor_any(wo => @_); + #my($self, $attribute, $metaclass) = @_; + my $self = shift; + return $self->_generate_accessor_any(wo => @_); } sub _generate_predicate { - my (undef, $attribute, $class) = @_; + #my($self, $attribute, $metaclass) = @_; + my(undef, $attribute) = @_; my $slot = $attribute->name; return sub{ @@ -160,7 +164,8 @@ sub _generate_predicate { } sub _generate_clearer { - my (undef, $attribute, $class) = @_; + #my($self, $attribute, $metaclass) = @_; + my(undef, $attribute) = @_; my $slot = $attribute->name; return sub{ diff --git a/lib/Mouse/Meta/Module.pm b/lib/Mouse/Meta/Module.pm index d455ff9..e02d0a0 100755 --- a/lib/Mouse/Meta/Module.pm +++ b/lib/Mouse/Meta/Module.pm @@ -15,7 +15,7 @@ if(Mouse::Util::MOUSE_XS){ } sub _metaclass_cache { # DEPRECATED - my($class, $name) = @_; + my($self, $name) = @_; Carp::cluck('_metaclass_cache() has been deprecated. Use Mouse::Util::get_metaclass_by_name() instead'); return $METAS{$name}; } @@ -301,7 +301,7 @@ sub DESTROY{ } sub throw_error{ - my($class, $message, %args) = @_; + my($self, $message, %args) = @_; local $Carp::CarpLevel = $Carp::CarpLevel + 1 + ($args{depth} || 0); local $Carp::MaxArgNums = 20; # default is 8, usually we use named args which gets messier though diff --git a/lib/Mouse/Meta/Role.pm b/lib/Mouse/Meta/Role.pm index e48683f..ea73ade 100644 --- a/lib/Mouse/Meta/Role.pm +++ b/lib/Mouse/Meta/Role.pm @@ -129,7 +129,8 @@ sub _apply_methods{ } sub _apply_attributes{ - my($role, $consumer, $args) = @_; + #my($role, $consumer, $args) = @_; + my($role, $consumer) = @_; for my $attr_name ($role->get_attribute_list) { next if $consumer->has_attribute($attr_name); @@ -140,7 +141,9 @@ sub _apply_attributes{ } sub _apply_modifiers{ - my($role, $consumer, $args) = @_; + #my($role, $consumer, $args) = @_; + my($role, $consumer) = @_; + if(my $modifiers = $role->{override_method_modifiers}){ foreach my $method_name (keys %{$modifiers}){ @@ -165,7 +168,8 @@ sub _apply_modifiers{ } sub _append_roles{ - my($role, $consumer, $args) = @_; + #my($role, $consumer, $args) = @_; + my($role, $consumer) = @_; my $roles = $consumer->{roles}; @@ -242,7 +246,7 @@ sub apply { sub combine { - my($role_class, @role_specs) = @_; + my($self, @role_specs) = @_; require 'Mouse/Meta/Role/Composite.pm'; # we don't want to create its namespace