Catmandu/Fix/Condition/is_valid_orcid.pm

filter: Statementstmt 100% 18 / 18 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 95.8% 23 / 24 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Catmandu/Fix/Condition/is_valid_issn.pm ↑ Summary Catmandu/Fix/Condition/is_web_uri.pm »
1 package Catmandu::Fix::Condition::is_valid_orcid;
2  
3 1 our $VERSION = '0.15';
4  
5 1 ▶use Catmandu::Sane;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use WWW::ORCID;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use Catmandu::Fix::Has;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 has path => (fix_arg => 1);
11  
12 1 with 'Catmandu::Fix::Condition::SimpleAllTest';
13  
14 4 ▶sub emit_test {
Subroutine emit_test: called CC=1 SCAR=0.0
Pod undocumented
15 4 my ($self, $var) = @_;
16  
17 4 "(is_value(${var}) && ${var} =~/^(\\d{4})-(\\d{4})-(\\d{4})-(\\d{3}[0-9X])\$/)";
18 }
19  
20 =head1 NAME
21  
22 Catmandu::Fix::Condition::is_valid_orcid - checks of a field looks like an ORCID
23  
24 =head1 SYNOPSIS
25  
26 # Checks is a field looks like an ORCID
27 if is_valid_orcid(orcid)
28 ...
29 else
30 ...
31 end
32  
33 =head1 SEE ALSO
34  
35 L<Catmandu::Fix>
36  
37 =cut
38  
39 1 1;
« Catmandu/Fix/Condition/is_valid_issn.pm ↑ Summary Catmandu/Fix/Condition/is_web_uri.pm »