Remove deprecated stuff
[gitmo/Mouse.git] / lib / Mouse / Meta / Attribute.pm
index 714ee8f..3df565a 100644 (file)
@@ -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;
 }