X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FAttribute.pm;fp=lib%2FMouse%2FMeta%2FAttribute.pm;h=3df565a5fdfc0ac85b6e7054a9c69c684e86272e;hb=64397f9ae9f1971da37dcd218253071637f592a8;hp=714ee8fc336fc1f728380c16dbdbc7fd31d0c4de;hpb=5f08b772ca296d444b5cc88a55a55361bae6108e;p=gitmo%2FMouse.git diff --git a/lib/Mouse/Meta/Attribute.pm b/lib/Mouse/Meta/Attribute.pm index 714ee8f..3df565a 100644 --- a/lib/Mouse/Meta/Attribute.pm +++ b/lib/Mouse/Meta/Attribute.pm @@ -8,11 +8,6 @@ use Mouse::Meta::TypeConstraint; sub _process_options{ my($class, $name, $args) = @_; - # XXX: for backward compatibility (with method modifiers) - if($class->can('canonicalize_args') != \&canonicalize_args){ - %{$args} = $class->canonicalize_args($name, %{$args}); - } - # taken from Class::MOP::Attribute::new defined($name) @@ -156,11 +151,6 @@ sub new { sub has_read_method { $_[0]->has_reader || $_[0]->has_accessor } sub has_write_method { $_[0]->has_writer || $_[0]->has_accessor } -sub _create_args { # DEPRECATED - $_[0]->{_create_args} = $_[1] if @_ > 1; - $_[0]->{_create_args} -} - sub interpolate_class{ my($class, $args) = @_; @@ -195,25 +185,6 @@ sub interpolate_class{ return( $class, @traits ); } -sub canonicalize_args{ # DEPRECATED - my ($self, $name, %args) = @_; - - Carp::cluck("$self->canonicalize_args has been deprecated." - . "Use \$self->_process_options instead."); - - return %args; -} - -sub create { # DEPRECATED - my ($self, $class, $name, %args) = @_; - - Carp::cluck("$self->create has been deprecated." - . "Use \$meta->add_attribute and \$attr->install_accessors instead."); - - # noop - return $self; -} - sub _coerce_and_verify { my($self, $value, $instance) = @_; @@ -249,15 +220,6 @@ sub _throw_type_constraint_error { ); } -sub coerce_constraint { # DEPRECATED - my $type = $_[0]->{type_constraint} - or return $_[1]; - - Carp::cluck("coerce_constraint() has been deprecated, which was an internal utility anyway"); - - return Mouse::Util::TypeConstraints->typecast_constraints($_[0]->associated_class->name, $type, $_[1]); -} - sub clone_and_inherit_options{ my($self, %args) = @_; @@ -273,33 +235,6 @@ sub clone_and_inherit_options{ return $attribute_class->new($self->name, %args); } -sub clone_parent { # DEPRECATED - my $self = shift; - my $class = shift; - my $name = shift; - my %args = ($self->get_parent_args($class, $name), @_); - - Carp::cluck("$self->clone_parent has been deprecated." - . "Use \$meta->add_attribute and \$attr->install_accessors instead."); - - $self->clone_and_inherited_args($class, $name, %args); -} - -sub get_parent_args { # DEPRECATED - my $self = shift; - my $class = shift; - my $name = shift; - - for my $super ($class->linearized_isa) { - my $super_attr = $super->can("meta") && $super->meta->get_attribute($name) - or next; - return %{ $super_attr->_create_args }; - } - - $self->throw_error("Could not find an attribute by the name of '$name' to inherit from"); -} - - sub get_read_method { return $_[0]->reader || $_[0]->accessor } @@ -393,11 +328,6 @@ sub install_accessors{ } } - if($attribute->can('create') != \&create){ - # backword compatibility - $attribute->create($metaclass, $attribute->name, %{$attribute}); - } - return; }