line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Git::Validate::Errors; |
2
|
|
|
|
|
|
|
{ |
3
|
|
|
|
|
|
|
$Git::Validate::Errors::VERSION = '0.001000'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
872
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
7
|
|
|
|
|
|
|
use overload |
8
|
1
|
|
|
|
|
7
|
q("") => '_stringify', |
9
|
|
|
|
|
|
|
'bool' => '_boolify', |
10
|
1
|
|
|
1
|
|
345
|
; |
|
1
|
|
|
|
|
2
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has errors => ( |
13
|
|
|
|
|
|
|
is => 'ro', |
14
|
|
|
|
|
|
|
required => 1, |
15
|
|
|
|
|
|
|
isa => sub { |
16
|
|
|
|
|
|
|
die 'errors must be an arrayref' |
17
|
|
|
|
|
|
|
unless ref $_[0] && ref $_[0] eq 'ARRAY' |
18
|
|
|
|
|
|
|
}, |
19
|
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub _stringify { |
22
|
1
|
50
|
|
1
|
|
2193
|
return "" . $_[0]->errors->[0] if @{$_[0]->errors} == 1; |
|
1
|
|
|
|
|
10
|
|
23
|
|
|
|
|
|
|
|
24
|
1
|
|
|
|
|
3
|
join "\n", map " * $_", @{$_[0]->errors} |
|
1
|
|
|
|
|
8
|
|
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
0
|
|
|
sub _boolify { scalar @{$_[0]->errors} } |
|
0
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |