DRI/Protocol/EPP/Extensions/Afilias/IDNLanguage.pm

filter: Statementstmt 53.3% 16 / 30 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 55.5% 5 / 9 Podpod 0.0% 0 / 4 totaltotal 44.6% 21 / 47 CC 3 SCAR 14.5
CC
3
Cov
47%
add_language
12.0
register_commands
2.0
create
2.0
CRAP 4.3
« DRI/DRD/BookMyName.pm ↑ Summary DRI/Transport/Dummy.pm »
1 ## Domain Registry Interface, EPP IDN Language (EPP-IDN-Lang-Mapping.pdf)
2 ##
3 ## Copyright (c) 2007,2008,2013 Tonnerre Lombard <tonnerre.lombard@sygroup.ch>. All rights reserved.
4 ## Copyright (c) 2016 Patrick Mevzek <netdri@dotandco.com>. All rights reserved.
5 ##
6 ## This file is part of Net::DRI
7 ##
8 ## Net::DRI is free software; you can redistribute it and/or modify
9 ## it under the terms of the GNU General Public License as published by
10 ## the Free Software Foundation; either version 2 of the License, or
11 ## (at your option) any later version.
12 ##
13 ## See the LICENSE file that comes with this distribution for more details.
14 ####################################################################################################
15  
16 package Net::DRI::Protocol::EPP::Extensions::Afilias::IDNLanguage;
17  
18 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 1 ▶use feature 'state';
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22 1 ▶use Net::DRI::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 1 ▶use Net::DRI::Exception;
Subroutine BEGIN: called CC=1 SCAR=0.0
24  
25 =pod
26  
27 =head1 NAME
28  
29 Net::DRI::Protocol::EPP::Extensions::Afilias::IDNLanguage - Afilias EPP IDN Language commands (EPP-IDN-Lang-Mapping.pdf) for Net::DRI
30  
31 =head1 DESCRIPTION
32  
33 Please see the README file for details.
34  
35 =head1 SUPPORT
36  
37 For now, support questions should be sent to:
38  
39 E<lt>netdri@dotandco.comE<gt>
40  
41 Please also see the SUPPORT file in the distribution.
42  
43 =head1 SEE ALSO
44  
45 E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt> and
46 E<lt>http://oss.bdsprojects.net/projects/netdri/E<gt>
47  
48 =head1 AUTHOR
49  
50 Tonnerre Lombard E<lt>tonnerre.lombard@sygroup.chE<gt>
51  
52 =head1 COPYRIGHT
53  
54 Copyright (c) 2007,2008,2013 Tonnerre Lombard <tonnerre.lombard@sygroup.ch>.
55 Copyright (c) 2016 Patrick Mevzek <netdri@dotandco.com>.
56 All rights reserved.
57  
58 This program is free software; you can redistribute it and/or modify
59 it under the terms of the GNU General Public License as published by
60 the Free Software Foundation; either version 2 of the License, or
61 (at your option) any later version.
62  
63 See the LICENSE file that comes with this distribution for more details.
64  
65 =cut
66  
67 ####################################################################################################
68  
69 sub register_commands
70 {
71 0 ▶ my ($class,$version)=@_;
Subroutine register_commands: not called CC=1 SCAR=6.9
Pod undocumented
72 0 state $cmds = { 'domain' => { 'create' => [ \&create, undef ], 'check' => [ \&check, undef ] } };
73  
74 0 return $cmds;
75 }
76  
77 ####################################################################################################
78  
79 sub add_language
80 {
81 0 ▶ my ($tag,$epp,$domain,$rd)=@_;
Subroutine add_language: not called CC=3 SCAR=24.8
Pod undocumented
82 0 my $mes=$epp->message();
83  
84 0 ▶ if (Net::DRI::Util::has_key($rd,'language'))
Branch: 1 branch
BranchTrueFalseTotal
if (Net::DRI::Util::has_key($rd, "language")) 0 0 0
85 {
86 0 ▶ Net::DRI::Exception::usererr_invalid_parameters('IDN language tag must be of type XML schema language') unless Net::DRI::Util::xml_is_language($rd->{language});
Branch: 1 branch
BranchTrueFalseTotal
unless Net::DRI::Util::xml_is_language($rd->{"language"}) 0 0 0
87 0 my $eid=$mes->command_extension_register('idn', $tag);
88 0 $mes->command_extension($eid,['idn:script', $rd->{language}]);
89 }
90 0 return;
91 }
92  
93 sub create
94 {
95 0 ▶ my (@args)=@_;
Subroutine create: not called CC=1 SCAR=6.9
Pod undocumented
96 0 return add_language('create',@args);
97 }
98  
99 sub check
100 {
101 0 ▶ my (@args)=@_;
Subroutine check: not called CC=1 SCAR=6.9
Pod undocumented
102 0 return add_language('check',@args);
103 }
104  
105 ####################################################################################################
106 1 1;
« DRI/DRD/BookMyName.pm ↑ Summary DRI/Transport/Dummy.pm »