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