B-Lint-StrictOO
view release on metacpan or search on metacpan
lib/B/Lint/StrictOO.pm view on Meta::CPAN
@children && ! ${$children[-1]};
pop @children ) {
}
my B::SVOP $invocant_op = $children[0];
my B::SVOP $method_op = $children[-1];
# Not a method call at all!
return if $invocant_op == $method_op;
my $category = guess_invocant_category( $invocant_op );
if ( _invocant_is_literal_class() == $category ) {
lint_class_method_call(
$invocant_op,
$method_op
);
return;
}
# TODO:
lib/B/Lint/StrictOO.pm view on Meta::CPAN
my ( $method_name ) = @_;
for my $class_name ( @{nearby_classes_in_current_file()} ) {
return 1 if $class_name->can($method_name);
}
return 0;
}
sub guess_invocant_category {
my ( $op ) = @_;
# We've been handed a B::NULL object which is a representation for
# a null pointer.
if ( ! $$op ) {
return _invocant_is_unknown();
}
my $op_name = $op->oldname;
lib/B/Lint/StrictOO.pm view on Meta::CPAN
=head1 METHODS
=head2 match
=head2 class_exists
=head2 lint_class_method_call
=head2 nearby_classes_perform
=head2 guess_invocant_category
=head2 nearby_classes_in_current_file
=head2 nearby_classes_in_file
=head1 SYNOPSIS
Validates that classes exist, that methods that are called on classes
and objects, and variables aren't used as method names.
From the command line:
( run in 0.887 second using v1.01-cache-2.11-cpan-702932259ff )