| 1 | package Locale::TextDomain::OO::Plugin::Expand::Gettext::DomainAndCategory; ## no critic (TidyCode) | ||||||||||
| 2 | |||||||||||
| 3 | 6 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 6 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 6 | ▶ | use Locale::Utils::PlaceholderNamed; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 6 | ▶ | use Moo::Role; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 6 | our $VERSION = '1.030'; | |||||||||
| 9 | |||||||||||
| 10 | 6 | with qw( | |||||||||
| 11 | Locale::TextDomain::OO::Plugin::Expand::Gettext | ||||||||||
| 12 | Locale::TextDomain::OO::Role::DomainAndCategory | ||||||||||
| 13 | ); | ||||||||||
| 14 | |||||||||||
| 15 | 6 | requires qw( | |||||||||
| 16 | __x | ||||||||||
| 17 | __nx | ||||||||||
| 18 | __px | ||||||||||
| 19 | __npx | ||||||||||
| 20 | |||||||||||
| 21 | begin_c | ||||||||||
| 22 | begin_d | ||||||||||
| 23 | begin_dc | ||||||||||
| 24 | callback_scope | ||||||||||
| 25 | end_c | ||||||||||
| 26 | end_d | ||||||||||
| 27 | end_dc | ||||||||||
| 28 | ); | ||||||||||
| 29 | |||||||||||
| 30 | 0 | ▶ | sub __dx { | ||||||||
|
Subroutine
__dx: not called CC=1 SCAR=6.9
| |||||||||||
| 31 | 0 | my ( $self, $domain, @more ) = @_; | |||||||||
| 32 | |||||||||||
| 33 | return $self->callback_scope( | ||||||||||
| 34 | 0 | ▶ | sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 35 | 0 | $self->begin_d($domain); | |||||||||
| 36 | 0 | return $self->__x(@more); | |||||||||
| 37 | }, | ||||||||||
| 38 | 0 | ); | |||||||||
| 39 | } | ||||||||||
| 40 | |||||||||||
| 41 | 0 | ▶ | sub __cx { | ||||||||
|
Subroutine
__cx: not called CC=1 SCAR=6.9
| |||||||||||
| 42 | 0 | my ($self, @more) = @_; | |||||||||
| 43 | |||||||||||
| 44 | return $self->callback_scope( | ||||||||||
| 45 | 0 | ▶ | sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 46 | 0 | $self->begin_c( splice @more, 1, 1 ); | |||||||||
| 47 | 0 | return $self->__x(@more); | |||||||||
| 48 | }, | ||||||||||
| 49 | 0 | ); | |||||||||
| 50 | } | ||||||||||
| 51 | |||||||||||
| 52 | 0 | ▶ | sub __dcx { | ||||||||
|
Subroutine
__dcx: not called CC=1 SCAR=6.9
| |||||||||||
| 53 | 0 | my ( $self, $domain, @more ) = @_; | |||||||||
| 54 | |||||||||||
| 55 | return $self->callback_scope( | ||||||||||
| 56 | 0 | ▶ | sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 57 | 0 | $self->begin_d($domain); | |||||||||
| 58 | 0 | $self->begin_c( splice @more, 1, 1 ); | |||||||||
| 59 | 0 | return $self->__x(@more); | |||||||||
| 60 | }, | ||||||||||
| 61 | 0 | ); | |||||||||
| 62 | } | ||||||||||
| 63 | |||||||||||
| 64 | 0 | ▶ | sub __dnx { | ||||||||
|
Subroutine
__dnx: not called CC=1 SCAR=6.9
| |||||||||||
| 65 | 0 | my ( $self, $domain, @more ) = @_; | |||||||||
| 66 | |||||||||||
| 67 | return $self->callback_scope( | ||||||||||
| 68 | 0 | ▶ | sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 69 | 0 | $self->begin_d($domain); | |||||||||
| 70 | 0 | return $self->__nx(@more); | |||||||||
| 71 | }, | ||||||||||
| 72 | 0 | ); | |||||||||
| 73 | } | ||||||||||
| 74 | |||||||||||
| 75 | 0 | ▶ | sub __cnx { | ||||||||
|
Subroutine
__cnx: not called CC=1 SCAR=6.9
| |||||||||||
| 76 | 0 | my ( $self, @more ) = @_; | |||||||||
| 77 | |||||||||||
| 78 | return $self->callback_scope( | ||||||||||
| 79 | 0 | ▶ | sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 80 | 0 | $self->begin_c( splice @more, 3, 1 ); ## no critic (MagicNumbers) | |||||||||
| 81 | 0 | return $self->__nx(@more); | |||||||||
| 82 | }, | ||||||||||
| 83 | 0 | ); | |||||||||
| 84 | } | ||||||||||
| 85 | |||||||||||
| 86 | 0 | ▶ | sub __dcnx { | ||||||||
|
Subroutine
__dcnx: not called CC=1 SCAR=6.9
| |||||||||||
| 87 | 0 | my ( $self, $domain, @more ) = @_; | |||||||||
| 88 | |||||||||||
| 89 | return $self->callback_scope( | ||||||||||
| 90 | 0 | ▶ | sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 91 | 0 | $self->begin_d($domain); | |||||||||
| 92 | 0 | $self->begin_c( splice @more, 3, 1 ); ## no critic (MagicNumbers) | |||||||||
| 93 | 0 | return $self->__nx(@more); | |||||||||
| 94 | }, | ||||||||||
| 95 | 0 | ); | |||||||||
| 96 | } | ||||||||||
| 97 | |||||||||||
| 98 | 0 | ▶ | sub __dpx { | ||||||||
|
Subroutine
__dpx: not called CC=1 SCAR=6.9
| |||||||||||
| 99 | 0 | my ( $self, $domain, @more ) = @_; | |||||||||
| 100 | |||||||||||
| 101 | return $self->callback_scope( | ||||||||||
| 102 | 0 | ▶ | sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 103 | 0 | $self->begin_d($domain); | |||||||||
| 104 | 0 | return $self->__px(@more); | |||||||||
| 105 | }, | ||||||||||
| 106 | 0 | ); | |||||||||
| 107 | } | ||||||||||
| 108 | |||||||||||
| 109 | 0 | ▶ | sub __cpx { | ||||||||
|
Subroutine
__cpx: not called CC=1 SCAR=6.9
| |||||||||||
| 110 | 0 | my ( $self, @more ) = @_; | |||||||||
| 111 | |||||||||||
| 112 | return $self->callback_scope( | ||||||||||
| 113 | 0 | ▶ | sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 114 | 0 | $self->begin_c( splice @more, 2, 1 ); | |||||||||
| 115 | 0 | return $self->__px(@more); | |||||||||
| 116 | }, | ||||||||||
| 117 | 0 | ); | |||||||||
| 118 | } | ||||||||||
| 119 | |||||||||||
| 120 | 0 | ▶ | sub __dcpx { | ||||||||
|
Subroutine
__dcpx: not called CC=1 SCAR=6.9
| |||||||||||
| 121 | 0 | my ( $self, $domain, @more ) = @_; | |||||||||
| 122 | |||||||||||
| 123 | return $self->callback_scope( | ||||||||||
| 124 | 0 | ▶ | sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 125 | 0 | $self->begin_d($domain); | |||||||||
| 126 | 0 | $self->begin_c( splice @more, 2, 1 ); | |||||||||
| 127 | 0 | return $self->__px(@more); | |||||||||
| 128 | }, | ||||||||||
| 129 | 0 | ); | |||||||||
| 130 | } | ||||||||||
| 131 | |||||||||||
| 132 | 0 | ▶ | sub __dnpx { | ||||||||
|
Subroutine
__dnpx: not called CC=1 SCAR=6.9
| |||||||||||
| 133 | 0 | my ( $self, $domain, @more ) = @_; | |||||||||
| 134 | |||||||||||
| 135 | return $self->callback_scope( | ||||||||||
| 136 | 0 | ▶ | sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 137 | 0 | $self->begin_d($domain); | |||||||||
| 138 | 0 | return $self->__npx(@more); | |||||||||
| 139 | }, | ||||||||||
| 140 | 0 | ); | |||||||||
| 141 | } | ||||||||||
| 142 | |||||||||||
| 143 | 0 | ▶ | sub __cnpx { | ||||||||
|
Subroutine
__cnpx: not called CC=1 SCAR=6.9
| |||||||||||
| 144 | 0 | my ($self, @more) = @_; | |||||||||
| 145 | |||||||||||
| 146 | return $self->callback_scope( | ||||||||||
| 147 | 0 | ▶ | sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 148 | 0 | $self->begin_c( splice @more, 4, 1 ); ## no critic (MagicNumbers) | |||||||||
| 149 | 0 | return $self->__npx(@more); | |||||||||
| 150 | }, | ||||||||||
| 151 | 0 | ); | |||||||||
| 152 | } | ||||||||||
| 153 | |||||||||||
| 154 | 2 | ▶ | sub __dcnpx { | ||||||||
|
Subroutine
__dcnpx: called CC=1 SCAR=0.0
| |||||||||||
| 155 | 2 | my ( $self, $domain, @more ) = @_; | |||||||||
| 156 | |||||||||||
| 157 | return $self->callback_scope( | ||||||||||
| 158 | 2 | ▶ | sub { | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 159 | 2 | $self->begin_d($domain); | |||||||||
| 160 | 2 | $self->begin_c( splice @more, 4, 1 ); ## no critic (MagicNumbers) | |||||||||
| 161 | 2 | return $self->__npx(@more); | |||||||||
| 162 | }, | ||||||||||
| 163 | 2 | ); | |||||||||
| 164 | } | ||||||||||
| 165 | |||||||||||
| 166 | { | ||||||||||
| 167 | 6 | ▶ | no warnings qw(redefine); ## no critic (NoWarnings) | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 168 | |||||||||||
| 169 | # Dummy methods for string marking. | ||||||||||
| 170 | 0 | ▶ | my $dummy = sub { | ||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||
| 171 | 0 | my (undef, @more) = @_; | |||||||||
| 172 | 0 | ▶ | return wantarray ? @more : $more[0]; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 173 | 6 | }; | |||||||||
| 174 | |||||||||||
| 175 | 6 | *__begin_c = \&begin_c; | |||||||||
| 176 | 6 | *__begin_d = \&begin_d; | |||||||||
| 177 | 6 | *__begin_dc = \&begin_dc; | |||||||||
| 178 | |||||||||||
| 179 | 6 | *__end_c = \&end_c; | |||||||||
| 180 | 6 | *__end_d = \&end_d; | |||||||||
| 181 | 6 | *__end_dc = \&end_dc; | |||||||||
| 182 | |||||||||||
| 183 | 6 | *__d = \&__dx; | |||||||||
| 184 | 6 | *__dn = \&__dnx; | |||||||||
| 185 | 6 | *__dp = \&__dpx; | |||||||||
| 186 | 6 | *__dnp = \&__dnpx; | |||||||||
| 187 | |||||||||||
| 188 | 6 | *__c = \&__cx; | |||||||||
| 189 | 6 | *__cn = \&__cnx; | |||||||||
| 190 | 6 | *__cp = \&__cpx; | |||||||||
| 191 | 6 | *__cnp = \&__cnpx; | |||||||||
| 192 | |||||||||||
| 193 | 6 | *__dc = \&__dcx; | |||||||||
| 194 | 6 | *__dcn = \&__dcnx; | |||||||||
| 195 | 6 | *__dcp = \&__dcpx; | |||||||||
| 196 | 6 | *__dcnp = \&__dcnpx; | |||||||||
| 197 | |||||||||||
| 198 | 6 | *N__d = $dummy; | |||||||||
| 199 | 6 | *N__dn = $dummy; | |||||||||
| 200 | 6 | *N__dp = $dummy; | |||||||||
| 201 | 6 | *N__dnp = $dummy; | |||||||||
| 202 | |||||||||||
| 203 | 6 | *N__dx = $dummy; | |||||||||
| 204 | 6 | *N__dnx = $dummy; | |||||||||
| 205 | 6 | *N__dpx = $dummy; | |||||||||
| 206 | 6 | *N__dnpx = $dummy; | |||||||||
| 207 | |||||||||||
| 208 | 6 | *N__c = $dummy; | |||||||||
| 209 | 6 | *N__cn = $dummy; | |||||||||
| 210 | 6 | *N__cp = $dummy; | |||||||||
| 211 | 6 | *N__cnp = $dummy; | |||||||||
| 212 | |||||||||||
| 213 | 6 | *N__cx = $dummy; | |||||||||
| 214 | 6 | *N__cnx = $dummy; | |||||||||
| 215 | 6 | *N__cpx = $dummy; | |||||||||
| 216 | 6 | *N__cnpx = $dummy; | |||||||||
| 217 | |||||||||||
| 218 | 6 | *N__dc = $dummy; | |||||||||
| 219 | 6 | *N__dcn = $dummy; | |||||||||
| 220 | 6 | *N__dcp = $dummy; | |||||||||
| 221 | 6 | *N__dcnp = $dummy; | |||||||||
| 222 | |||||||||||
| 223 | 6 | *N__dcx = $dummy; | |||||||||
| 224 | 6 | *N__dcnx = $dummy; | |||||||||
| 225 | 6 | *N__dcpx = $dummy; | |||||||||
| 226 | 6 | *N__dcnpx = $dummy; | |||||||||
| 227 | } | ||||||||||
| 228 | |||||||||||
| 229 | 6 | 1; | |||||||||
| 230 | |||||||||||
| 231 | __END__ | ||||||||||