sub add_before_method_modifier {
my ($self, $method_name, $method_modifier) = @_;
- (defined $method_name && $method_name)
+ (defined $method_name && length $method_name)
|| confess "You must pass in a method name";
my $method = $fetch_and_prepare_method->($self, $method_name);
$method->add_before_modifier(
sub add_after_method_modifier {
my ($self, $method_name, $method_modifier) = @_;
- (defined $method_name && $method_name)
+ (defined $method_name && length $method_name)
|| confess "You must pass in a method name";
my $method = $fetch_and_prepare_method->($self, $method_name);
$method->add_after_modifier(
sub add_around_method_modifier {
my ($self, $method_name, $method_modifier) = @_;
- (defined $method_name && $method_name)
+ (defined $method_name && length $method_name)
|| confess "You must pass in a method name";
my $method = $fetch_and_prepare_method->($self, $method_name);
$method->add_around_modifier(
sub find_method_by_name {
my ($self, $method_name) = @_;
- (defined $method_name && $method_name)
+ (defined $method_name && length $method_name)
|| confess "You must define a method name to find";
foreach my $class ($self->linearized_isa) {
my $method = $self->initialize($class)->get_method($method_name);
sub find_all_methods_by_name {
my ($self, $method_name) = @_;
- (defined $method_name && $method_name)
+ (defined $method_name && length $method_name)
|| confess "You must define a method name to find";
my @methods;
foreach my $class ($self->linearized_isa) {
sub find_next_method_by_name {
my ($self, $method_name) = @_;
- (defined $method_name && $method_name)
+ (defined $method_name && length $method_name)
|| confess "You must define a method name to find";
my @cpl = $self->linearized_isa;
shift @cpl; # discard ourselves
sub add_method {
my ($self, $method_name, $method) = @_;
- (defined $method_name && $method_name)
+ (defined $method_name && length $method_name)
|| confess "You must define a method name";
my $body;
sub has_method {
my ($self, $method_name) = @_;
- defined($method_name)
+ (defined $method_name && length $method_name)
|| confess "You must define a method name";
return defined($self->get_method($method_name));
sub get_method {
my ( $self, $method_name ) = @_;
- defined($method_name)
+ (defined $method_name && length $method_name)
|| confess "You must define a method name";
my $method_map = $self->_method_map;
sub remove_method {
my ($self, $method_name) = @_;
- (defined $method_name && $method_name)
+ (defined $method_name && length $method_name)
|| confess "You must define a method name";
my $removed_method = delete $self->_full_method_map->{$method_name};