From: Justin Hunter Date: Sun, 18 Oct 2009 06:23:32 +0000 (-0700) Subject: (Any $) is not necessary anymore for a multi method without any args X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a20ea10d89b1959fedeef92eb350057e81adfbaa;p=dbsrgits%2FSQL-Translator-2.0-ish.git (Any $) is not necessary anymore for a multi method without any args --- diff --git a/lib/SQL/Translator/Object/Column.pm b/lib/SQL/Translator/Object/Column.pm index b815228..616fb08 100644 --- a/lib/SQL/Translator/Object/Column.pm +++ b/lib/SQL/Translator/Object/Column.pm @@ -115,7 +115,7 @@ class SQL::Translator::Object::Column extends SQL::Translator::Object is dirty { multi method size(Int $length, Int $precision) { $self->length($length); $self->precision($precision); $self->size } multi method size(ArrayRef $size) { $self->length($size->[0]); $self->precision($size->[1]) if @$size == 2; $self->size } - multi method size(Any $) { + multi method size { return $self->has_precision ? wantarray ? ($self->length, $self->precision) diff --git a/lib/SQL/Translator/Object/Compat.pm b/lib/SQL/Translator/Object/Compat.pm index 8f2389f..0e7a5c7 100644 --- a/lib/SQL/Translator/Object/Compat.pm +++ b/lib/SQL/Translator/Object/Compat.pm @@ -24,7 +24,7 @@ role SQL::Translator::Object::Compat { $self->column_ids; } - multi method fields(Any $) { $self->column_ids } + multi method fields { $self->column_ids } method add_field(Column $column does coerce) { $self->add_column($column) } diff --git a/lib/SQL/Translator/Object/Procedure.pm b/lib/SQL/Translator/Object/Procedure.pm index 09c14db..d1cc90e 100644 --- a/lib/SQL/Translator/Object/Procedure.pm +++ b/lib/SQL/Translator/Object/Procedure.pm @@ -35,5 +35,5 @@ class SQL::Translator::Object::Procedure extends SQL::Translator::Object { multi method parameters(Str $parameter) { $self->add_parameter($parameter) } multi method parameters(ArrayRef $parameter) { $self->add_parameter($parameter) } - multi method parameters(Any $) { wantarray ? @{$self->_parameters} : $self->_parameters } + multi method parameters { wantarray ? @{$self->_parameters} : $self->_parameters } } diff --git a/lib/SQL/Translator/Object/Table.pm b/lib/SQL/Translator/Object/Table.pm index 6131ff9..79b8d8d 100644 --- a/lib/SQL/Translator/Object/Table.pm +++ b/lib/SQL/Translator/Object/Table.pm @@ -123,7 +123,7 @@ class SQL::Translator::Object::Table extends SQL::Translator::Object is dirty { around add_sequence(Sequence $sequence does coerce) { $self->$orig($sequence->name, $sequence) } - multi method primary_key(Any $) { grep /^PRIMARY KEY$/, $_->type for $self->get_constraints } + multi method primary_key { grep /^PRIMARY KEY$/, $_->type for $self->get_constraints } multi method primary_key(Str $column) { $self->get_column($column)->is_primary_key(1) } method is_valid { return $self->get_columns ? 1 : undef }