| 1 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 2 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||
| 4 | package Footprintless::InvalidEntityException; | ||||||||||||||||||||||||||||
| 5 | 2 | $Footprintless::InvalidEntityException::VERSION = '1.29'; | |||||||||||||||||||||||||||
| 6 | # ABSTRACT: An exception thrown when an entity is invalid for the context it is being used in | ||||||||||||||||||||||||||||
| 7 | # PODNAME: Footprintless::InvalidEntityException | ||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 2 | ▶ | use Term::ANSIColor; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | 2 | ▶ | use overload '""' => 'to_string'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 2 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 13 | 2 | return bless( {}, shift )->_init(@_); | |||||||||||||||||||||||||||
| 14 | } | ||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | 2 | ▶ | sub _init { | ||||||||||||||||||||||||||
|
Subroutine
_init: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 17 | 2 | my ( $self, $coordinate, $message ) = @_; | |||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | 2 | $self->{coordinate} = $coordinate; | |||||||||||||||||||||||||||
| 20 | 2 | $self->{message} = $message; | |||||||||||||||||||||||||||
| 21 | 2 | $self->{trace} = []; | |||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 2 | return $self; | |||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 0 | ▶ | sub get_coordinate { | ||||||||||||||||||||||||||
|
Subroutine
get_coordinate: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 27 | 0 | return $_[0]->{coordinate}; | |||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 2 | ▶ | sub get_message { | ||||||||||||||||||||||||||
|
Subroutine
get_message: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 31 | 2 | return $_[0]->{message}; | |||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | 0 | ▶ | sub get_trace { | ||||||||||||||||||||||||||
|
Subroutine
get_trace: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 35 | 0 | return $_[0]->{trace}; | |||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | 0 | ▶ | sub PROPAGATE { | ||||||||||||||||||||||||||
|
Subroutine
PROPAGATE: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 39 | 0 | my ( $self, $file, $line ) = @_; | |||||||||||||||||||||||||||
| 40 | 0 | push( @{ $self->{trace} }, [ $file, $line ] ); | |||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | 0 | ▶ | sub to_string { | ||||||||||||||||||||||||||
|
Subroutine
to_string: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||
| 44 | 0 | my ( $self, $trace ) = @_; | |||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | 0 | my @parts = ("invalid entity at [$self->{coordinate}]: $self->{message}"); | |||||||||||||||||||||||||||
| 47 | 0 | ▶ | if ( $trace && @{ $self->{trace} } ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$trace and @{$self->{"trace"};}
MC/DC0%0/2
$trace and @{$self->{"trace"};}
$trace
@{$self->{"trace"};}
Truth table0%0/3
A and B
A= $traceB= @{$self->{"trace"};}
| |||||||||||||||||||||||||||||
| 48 | 0 | push( @parts, "\n****TRACE****" ); | |||||||||||||||||||||||||||
| 49 | 0 | foreach my $stop ( @{ $self->{trace} } ) { | |||||||||||||||||||||||||||
| 50 | 0 | push( @parts, "$stop->[0]($stop->[1])" ); | |||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||
| 52 | 0 | push( @parts, "\n****TRACE****" ); | |||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | 0 | return join( '', @parts ); | |||||||||||||||||||||||||||
| 56 | } | ||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | 2 | 1; | |||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||
| 60 | __END__ | ||||||||||||||||||||||||||||