line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
{ |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
use strict; |
4
|
108
|
|
|
108
|
|
723
|
use warnings; |
|
108
|
|
|
|
|
230
|
|
|
108
|
|
|
|
|
3177
|
|
5
|
108
|
|
|
108
|
|
516
|
no warnings qw( once void ); |
|
108
|
|
|
|
|
219
|
|
|
108
|
|
|
|
|
23390
|
|
6
|
108
|
|
|
108
|
|
522
|
|
|
108
|
|
|
|
|
212
|
|
|
108
|
|
|
|
|
11734
|
|
7
|
|
|
|
|
|
|
our $USES_MITE = "Mite::Class"; |
8
|
|
|
|
|
|
|
our $MITE_SHIM = "Mite::Shim"; |
9
|
|
|
|
|
|
|
our $MITE_VERSION = "0.010007"; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# Mite keywords |
12
|
|
|
|
|
|
|
BEGIN { |
13
|
|
|
|
|
|
|
my ( $SHIM, $CALLER ) = ( "Mite::Shim", "Mite::Class" ); |
14
|
108
|
|
|
108
|
|
11707
|
( |
15
|
|
|
|
|
|
|
*after, *around, *before, *extends, *field, |
16
|
|
|
|
|
|
|
*has, *param, *signature_for, *with |
17
|
|
|
|
|
|
|
) |
18
|
|
|
|
|
|
|
= do { |
19
|
108
|
|
|
|
|
272
|
|
20
|
|
|
|
|
|
|
no warnings 'redefine'; |
21
|
|
|
|
|
|
|
( |
22
|
108
|
|
|
108
|
|
714
|
sub { $SHIM->HANDLE_after( $CALLER, "class", @_ ) }, |
|
108
|
|
|
|
|
10129
|
|
|
108
|
|
|
|
|
25764
|
|
23
|
|
|
|
|
|
|
sub { $SHIM->HANDLE_around( $CALLER, "class", @_ ) }, |
24
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_before( $CALLER, "class", @_ ) }, |
25
|
216
|
|
|
216
|
|
851
|
sub { }, |
26
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_has( $CALLER, field => @_ ) }, |
27
|
|
|
|
108
|
|
|
sub { $SHIM->HANDLE_has( $CALLER, has => @_ ) }, |
28
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_has( $CALLER, param => @_ ) }, |
29
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_signature_for( $CALLER, "class", @_ ) }, |
30
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_with( $CALLER, @_ ) }, |
31
|
0
|
|
|
0
|
|
0
|
); |
32
|
108
|
|
|
108
|
|
770
|
} |
33
|
108
|
|
|
|
|
17242
|
|
34
|
|
|
|
|
|
|
# Mite imports |
35
|
|
|
|
|
|
|
BEGIN { |
36
|
|
|
|
|
|
|
require Scalar::Util; |
37
|
|
|
|
|
|
|
*STRICT = \&Mite::Shim::STRICT; |
38
|
|
|
|
|
|
|
*bare = \&Mite::Shim::bare; |
39
|
108
|
|
|
108
|
|
764
|
*blessed = \&Scalar::Util::blessed; |
40
|
108
|
|
|
|
|
359
|
*carp = \&Mite::Shim::carp; |
41
|
108
|
|
|
|
|
11165
|
*confess = \&Mite::Shim::confess; |
42
|
108
|
|
|
|
|
1801
|
*croak = \&Mite::Shim::croak; |
43
|
108
|
|
|
|
|
2225
|
*false = \&Mite::Shim::false; |
44
|
108
|
|
|
|
|
10448
|
*guard = \&Mite::Shim::guard; |
45
|
108
|
|
|
|
|
289
|
*lazy = \&Mite::Shim::lazy; |
46
|
108
|
|
|
|
|
239
|
*ro = \&Mite::Shim::ro; |
47
|
108
|
|
|
|
|
278
|
*rw = \&Mite::Shim::rw; |
48
|
108
|
|
|
|
|
249
|
*rwp = \&Mite::Shim::rwp; |
49
|
108
|
|
|
|
|
12293
|
*true = \&Mite::Shim::true; |
50
|
108
|
|
|
|
|
268
|
} |
51
|
108
|
|
|
|
|
281
|
|
52
|
108
|
|
|
|
|
4341
|
BEGIN { |
53
|
|
|
|
|
|
|
require Mite::Package; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
use mro 'c3'; |
56
|
108
|
|
|
108
|
|
57549
|
our @ISA; |
57
|
|
|
|
|
|
|
push @ISA, "Mite::Package"; |
58
|
108
|
|
|
108
|
|
712
|
} |
|
108
|
|
|
|
|
11703
|
|
|
108
|
|
|
|
|
2003
|
|
59
|
108
|
|
|
|
|
314
|
|
60
|
108
|
|
|
|
|
136247
|
# Standard Moose/Moo-style constructor |
61
|
|
|
|
|
|
|
my $class = ref( $_[0] ) ? ref(shift) : shift; |
62
|
|
|
|
|
|
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
63
|
|
|
|
|
|
|
my $self = bless {}, $class; |
64
|
|
|
|
|
|
|
my $args = |
65
|
150
|
50
|
|
150
|
0
|
1225
|
$meta->{HAS_BUILDARGS} |
66
|
150
|
|
66
|
|
|
1623
|
? $class->BUILDARGS(@_) |
67
|
150
|
|
|
|
|
535
|
: { ( @_ == 1 ) ? %{ $_[0] } : @_ }; |
68
|
|
|
|
|
|
|
my $no_build = delete $args->{__no_BUILD__}; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
# Attribute name (type: ValidClassName) |
71
|
150
|
50
|
|
|
|
1321
|
# has declaration, file lib/Mite/Package.pm, line 11 |
|
0
|
50
|
|
|
|
0
|
|
72
|
150
|
|
|
|
|
421
|
croak "Missing key in constructor: name" unless exists $args->{"name"}; |
73
|
|
|
|
|
|
|
( |
74
|
|
|
|
|
|
|
( |
75
|
|
|
|
|
|
|
do { |
76
|
150
|
50
|
|
|
|
533
|
|
77
|
|
|
|
|
|
|
defined( $args->{"name"} ) and do { |
78
|
|
|
|
|
|
|
ref( \$args->{"name"} ) eq 'SCALAR' |
79
|
|
|
|
|
|
|
or ref( \( my $val = $args->{"name"} ) ) eq 'SCALAR'; |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
) |
82
|
150
|
50
|
|
|
|
931
|
&& ( |
83
|
|
|
|
|
|
|
do { |
84
|
150
|
50
|
|
|
|
1383
|
local $_ = $args->{"name"}; |
85
|
|
|
|
|
|
|
/\A[^\W0-9]\w*(?:::[^\W0-9]\w*)*\z/; |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
) |
88
|
|
|
|
|
|
|
) |
89
|
150
|
50
|
33
|
|
|
312
|
or croak "Type check failed in constructor: %s should be %s", "name", |
90
|
150
|
|
|
|
|
450
|
"ValidClassName"; |
91
|
150
|
|
|
|
|
1819
|
$self->{"name"} = $args->{"name"}; |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
# Attribute shim_name (type: ValidClassName) |
94
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Package.pm, line 23 |
95
|
|
|
|
|
|
|
if ( exists $args->{"shim_name"} ) { |
96
|
|
|
|
|
|
|
( |
97
|
150
|
|
|
|
|
925
|
( |
98
|
|
|
|
|
|
|
do { |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
defined( $args->{"shim_name"} ) and do { |
101
|
150
|
50
|
|
|
|
577
|
ref( \$args->{"shim_name"} ) eq 'SCALAR' |
102
|
|
|
|
|
|
|
or ref( \( my $val = $args->{"shim_name"} ) ) eq |
103
|
|
|
|
|
|
|
'SCALAR'; |
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
) |
106
|
|
|
|
|
|
|
&& ( |
107
|
0
|
0
|
|
|
|
0
|
do { |
108
|
|
|
|
|
|
|
local $_ = $args->{"shim_name"}; |
109
|
0
|
0
|
|
|
|
0
|
/\A[^\W0-9]\w*(?:::[^\W0-9]\w*)*\z/; |
110
|
|
|
|
|
|
|
} |
111
|
|
|
|
|
|
|
) |
112
|
|
|
|
|
|
|
) |
113
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
114
|
|
|
|
|
|
|
"shim_name", "ValidClassName"; |
115
|
0
|
0
|
0
|
|
|
0
|
$self->{"shim_name"} = $args->{"shim_name"}; |
116
|
0
|
|
|
|
|
0
|
} |
117
|
0
|
|
|
|
|
0
|
|
118
|
|
|
|
|
|
|
# Attribute source (type: Mite::Source) |
119
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Package.pm, line 25 |
120
|
|
|
|
|
|
|
if ( exists $args->{"source"} ) { |
121
|
|
|
|
|
|
|
blessed( $args->{"source"} ) |
122
|
|
|
|
|
|
|
&& $args->{"source"}->isa("Mite::Source") |
123
|
0
|
|
|
|
|
0
|
or croak "Type check failed in constructor: %s should be %s", |
124
|
|
|
|
|
|
|
"source", "Mite::Source"; |
125
|
|
|
|
|
|
|
$self->{"source"} = $args->{"source"}; |
126
|
|
|
|
|
|
|
} |
127
|
|
|
|
|
|
|
require Scalar::Util && Scalar::Util::weaken( $self->{"source"} ) |
128
|
150
|
100
|
|
|
|
681
|
if ref $self->{"source"}; |
129
|
|
|
|
|
|
|
|
130
|
146
|
50
|
33
|
|
|
1816
|
# Attribute imported_functions (type: Map[MethodName,Str]) |
131
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Package.pm, line 34 |
132
|
|
|
|
|
|
|
do { |
133
|
146
|
|
|
|
|
508
|
my $value = |
134
|
|
|
|
|
|
|
exists( $args->{"imported_functions"} ) |
135
|
|
|
|
|
|
|
? $args->{"imported_functions"} |
136
|
150
|
100
|
33
|
|
|
2062
|
: $self->_build_imported_functions; |
137
|
|
|
|
|
|
|
do { |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
( ref($value) eq 'HASH' ) and do { |
140
|
150
|
|
|
|
|
279
|
my $ok = 1; |
141
|
|
|
|
|
|
|
for my $v ( values %{$value} ) { |
142
|
|
|
|
|
|
|
( $ok = 0, last ) unless do { |
143
|
150
|
50
|
|
|
|
1278
|
|
144
|
|
|
|
|
|
|
defined($v) and do { |
145
|
150
|
50
|
|
|
|
289
|
ref( \$v ) eq 'SCALAR' |
146
|
|
|
|
|
|
|
or ref( \( my $val = $v ) ) eq 'SCALAR'; |
147
|
|
|
|
|
|
|
} |
148
|
150
|
50
|
|
|
|
775
|
} |
149
|
150
|
|
|
|
|
328
|
}; |
150
|
150
|
|
|
|
|
251
|
for my $k ( keys %{$value} ) { |
|
150
|
|
|
|
|
604
|
|
151
|
0
|
0
|
|
|
|
0
|
( $ok = 0, last ) |
152
|
|
|
|
|
|
|
unless ( |
153
|
|
|
|
|
|
|
( |
154
|
0
|
0
|
|
|
|
0
|
do { |
155
|
0
|
0
|
|
|
|
0
|
|
156
|
|
|
|
|
|
|
defined($k) and do { |
157
|
|
|
|
|
|
|
ref( \$k ) eq 'SCALAR' |
158
|
|
|
|
|
|
|
or ref( \( my $val = $k ) ) eq |
159
|
|
|
|
|
|
|
'SCALAR'; |
160
|
150
|
|
|
|
|
291
|
} |
|
150
|
|
|
|
|
402
|
|
161
|
|
|
|
|
|
|
} |
162
|
|
|
|
|
|
|
) |
163
|
|
|
|
|
|
|
&& ( do { local $_ = $k; /\A[^\W0-9]\w*\z/ } ) |
164
|
|
|
|
|
|
|
); |
165
|
|
|
|
|
|
|
}; |
166
|
|
|
|
|
|
|
$ok; |
167
|
0
|
0
|
|
|
|
0
|
} |
168
|
0
|
0
|
|
|
|
0
|
or croak "Type check failed in constructor: %s should be %s", |
169
|
|
|
|
|
|
|
"imported_functions", "Map[MethodName,Str]"; |
170
|
|
|
|
|
|
|
$self->{"imported_functions"} = $value; |
171
|
|
|
|
|
|
|
}; |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
# Attribute imported_keywords (type: Map[MethodName,Str]) |
174
|
0
|
0
|
0
|
|
|
0
|
# has declaration, file lib/Mite/Package.pm, line 39 |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
175
|
|
|
|
|
|
|
do { |
176
|
|
|
|
|
|
|
my $value = |
177
|
150
|
|
|
|
|
739
|
exists( $args->{"imported_keywords"} ) |
178
|
|
|
|
|
|
|
? $args->{"imported_keywords"} |
179
|
|
|
|
|
|
|
: $self->_build_imported_keywords; |
180
|
|
|
|
|
|
|
do { |
181
|
|
|
|
|
|
|
|
182
|
150
|
|
|
|
|
522
|
( ref($value) eq 'HASH' ) and do { |
183
|
|
|
|
|
|
|
my $ok = 1; |
184
|
|
|
|
|
|
|
for my $v ( values %{$value} ) { |
185
|
|
|
|
|
|
|
( $ok = 0, last ) unless do { |
186
|
|
|
|
|
|
|
|
187
|
150
|
|
|
|
|
261
|
defined($v) and do { |
188
|
|
|
|
|
|
|
ref( \$v ) eq 'SCALAR' |
189
|
|
|
|
|
|
|
or ref( \( my $val = $v ) ) eq 'SCALAR'; |
190
|
150
|
50
|
|
|
|
1096
|
} |
191
|
|
|
|
|
|
|
} |
192
|
150
|
50
|
|
|
|
293
|
}; |
193
|
|
|
|
|
|
|
for my $k ( keys %{$value} ) { |
194
|
|
|
|
|
|
|
( $ok = 0, last ) |
195
|
150
|
50
|
|
|
|
997
|
unless ( |
196
|
150
|
|
|
|
|
324
|
( |
197
|
150
|
|
|
|
|
294
|
do { |
|
150
|
|
|
|
|
520
|
|
198
|
0
|
0
|
|
|
|
0
|
|
199
|
|
|
|
|
|
|
defined($k) and do { |
200
|
|
|
|
|
|
|
ref( \$k ) eq 'SCALAR' |
201
|
0
|
0
|
|
|
|
0
|
or ref( \( my $val = $k ) ) eq |
202
|
0
|
0
|
|
|
|
0
|
'SCALAR'; |
203
|
|
|
|
|
|
|
} |
204
|
|
|
|
|
|
|
} |
205
|
|
|
|
|
|
|
) |
206
|
|
|
|
|
|
|
&& ( do { local $_ = $k; /\A[^\W0-9]\w*\z/ } ) |
207
|
150
|
|
|
|
|
422
|
); |
|
150
|
|
|
|
|
532
|
|
208
|
|
|
|
|
|
|
}; |
209
|
|
|
|
|
|
|
$ok; |
210
|
|
|
|
|
|
|
} |
211
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
212
|
|
|
|
|
|
|
"imported_keywords", "Map[MethodName,Str]"; |
213
|
|
|
|
|
|
|
$self->{"imported_keywords"} = $value; |
214
|
0
|
0
|
|
|
|
0
|
}; |
215
|
0
|
0
|
|
|
|
0
|
|
216
|
|
|
|
|
|
|
# Attribute arg |
217
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Package.pm, line 41 |
218
|
|
|
|
|
|
|
$self->{"arg"} = ( exists( $args->{"arg"} ) ? $args->{"arg"} : {} ); |
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
# Attribute extends (type: ArrayRef[ValidClassName]) |
221
|
0
|
0
|
0
|
|
|
0
|
# has declaration, file lib/Mite/Trait/HasSuperclasses.pm, line 28 |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
222
|
|
|
|
|
|
|
do { |
223
|
|
|
|
|
|
|
my $value = |
224
|
150
|
|
|
|
|
581
|
exists( $args->{"extends"} ) |
225
|
|
|
|
|
|
|
? $args->{"extends"} |
226
|
|
|
|
|
|
|
: $Mite::Trait::HasSuperclasses::__extends_DEFAULT__->( |
227
|
|
|
|
|
|
|
$self); |
228
|
|
|
|
|
|
|
do { |
229
|
150
|
|
|
|
|
399
|
|
230
|
|
|
|
|
|
|
( ref($value) eq 'ARRAY' ) and do { |
231
|
|
|
|
|
|
|
my $ok = 1; |
232
|
|
|
|
|
|
|
for my $i ( @{$value} ) { |
233
|
|
|
|
|
|
|
( $ok = 0, last ) |
234
|
150
|
50
|
|
|
|
590
|
unless ( |
235
|
|
|
|
|
|
|
( |
236
|
|
|
|
|
|
|
do { |
237
|
|
|
|
|
|
|
|
238
|
150
|
|
|
|
|
413
|
defined($i) and do { |
239
|
|
|
|
|
|
|
ref( \$i ) eq 'SCALAR' |
240
|
|
|
|
|
|
|
or ref( \( my $val = $i ) ) eq |
241
|
150
|
50
|
|
|
|
1239
|
'SCALAR'; |
242
|
|
|
|
|
|
|
} |
243
|
|
|
|
|
|
|
} |
244
|
150
|
50
|
|
|
|
259
|
) |
245
|
|
|
|
|
|
|
&& ( |
246
|
|
|
|
|
|
|
do { |
247
|
150
|
50
|
|
|
|
1198
|
local $_ = $i; |
248
|
150
|
|
|
|
|
314
|
/\A[^\W0-9]\w*(?:::[^\W0-9]\w*)*\z/; |
249
|
150
|
|
|
|
|
951
|
} |
|
150
|
|
|
|
|
577
|
|
250
|
|
|
|
|
|
|
) |
251
|
|
|
|
|
|
|
); |
252
|
|
|
|
|
|
|
}; |
253
|
|
|
|
|
|
|
$ok; |
254
|
|
|
|
|
|
|
} |
255
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
256
|
0
|
0
|
|
|
|
0
|
"extends", "ArrayRef[ValidClassName]"; |
257
|
0
|
0
|
|
|
|
0
|
$self->{"extends"} = $value; |
258
|
|
|
|
|
|
|
$self->_trigger_extends( $self->{"extends"} ); |
259
|
|
|
|
|
|
|
}; |
260
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
# Attribute superclass_args (type: Map[NonEmptyStr,HashRef|Undef]) |
262
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Trait/HasSuperclasses.pm, line 33 |
263
|
|
|
|
|
|
|
do { |
264
|
0
|
0
|
0
|
|
|
0
|
my $value = |
265
|
0
|
|
|
|
|
0
|
exists( $args->{"superclass_args"} ) |
266
|
0
|
|
|
|
|
0
|
? $args->{"superclass_args"} |
267
|
|
|
|
|
|
|
: $self->_build_superclass_args; |
268
|
|
|
|
|
|
|
do { |
269
|
|
|
|
|
|
|
|
270
|
|
|
|
|
|
|
( ref($value) eq 'HASH' ) and do { |
271
|
150
|
|
|
|
|
576
|
my $ok = 1; |
272
|
|
|
|
|
|
|
for my $v ( values %{$value} ) { |
273
|
|
|
|
|
|
|
( $ok = 0, last ) unless do { |
274
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
( ( ref($v) eq 'HASH' ) or ( !defined($v) ) ); |
276
|
150
|
|
|
|
|
579
|
} |
277
|
150
|
|
|
|
|
738
|
}; |
278
|
|
|
|
|
|
|
for my $k ( keys %{$value} ) { |
279
|
|
|
|
|
|
|
( $ok = 0, last ) |
280
|
|
|
|
|
|
|
unless ( |
281
|
|
|
|
|
|
|
( |
282
|
150
|
|
|
|
|
296
|
do { |
283
|
|
|
|
|
|
|
|
284
|
|
|
|
|
|
|
defined($k) and do { |
285
|
150
|
50
|
|
|
|
948
|
ref( \$k ) eq 'SCALAR' |
286
|
|
|
|
|
|
|
or ref( \( my $val = $k ) ) eq |
287
|
150
|
50
|
|
|
|
276
|
'SCALAR'; |
288
|
|
|
|
|
|
|
} |
289
|
|
|
|
|
|
|
} |
290
|
150
|
50
|
|
|
|
795
|
) |
291
|
150
|
|
|
|
|
427
|
&& ( length($k) > 0 ) |
292
|
150
|
|
|
|
|
276
|
); |
|
150
|
|
|
|
|
498
|
|
293
|
0
|
0
|
|
|
|
0
|
}; |
294
|
|
|
|
|
|
|
$ok; |
295
|
|
|
|
|
|
|
} |
296
|
0
|
0
|
|
|
|
0
|
or croak "Type check failed in constructor: %s should be %s", |
297
|
|
|
|
|
|
|
"superclass_args", "Map[NonEmptyStr,HashRef|Undef]"; |
298
|
|
|
|
|
|
|
$self->{"superclass_args"} = $value; |
299
|
150
|
|
|
|
|
287
|
}; |
|
150
|
|
|
|
|
407
|
|
300
|
|
|
|
|
|
|
|
301
|
|
|
|
|
|
|
# Attribute parents (type: ArrayRef[Mite::Class]) |
302
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Trait/HasSuperclasses.pm, line 36 |
303
|
0
|
0
|
0
|
|
|
0
|
if ( exists $args->{"parents"} ) { |
304
|
|
|
|
|
|
|
( |
305
|
|
|
|
|
|
|
and do { |
306
|
0
|
0
|
|
|
|
0
|
my $ok = 1; |
307
|
0
|
0
|
|
|
|
0
|
for my $i ( @{ $args->{"parents"} } ) { |
308
|
|
|
|
|
|
|
( $ok = 0, last ) |
309
|
|
|
|
|
|
|
unless ( |
310
|
|
|
|
|
|
|
do { |
311
|
|
|
|
|
|
|
use Scalar::Util (); |
312
|
|
|
|
|
|
|
Scalar::Util::blessed($i) |
313
|
|
|
|
|
|
|
and $i->isa(q[Mite::Class]); |
314
|
|
|
|
|
|
|
} |
315
|
|
|
|
|
|
|
); |
316
|
150
|
|
|
|
|
645
|
}; |
317
|
|
|
|
|
|
|
$ok; |
318
|
|
|
|
|
|
|
} |
319
|
|
|
|
|
|
|
) |
320
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
321
|
150
|
|
|
|
|
434
|
"parents", "ArrayRef[Mite::Class]"; |
322
|
|
|
|
|
|
|
$self->{"parents"} = $args->{"parents"}; |
323
|
|
|
|
|
|
|
} |
324
|
|
|
|
|
|
|
|
325
|
|
|
|
|
|
|
# Attribute attributes (type: HashRef[Mite::Attribute]) |
326
|
150
|
50
|
|
|
|
513
|
# has declaration, file lib/Mite/Trait/HasAttributes.pm, line 16 |
327
|
|
|
|
|
|
|
do { |
328
|
0
|
|
|
|
|
0
|
my $value = |
329
|
0
|
0
|
0
|
|
|
0
|
exists( $args->{"attributes"} ) |
330
|
0
|
|
|
|
|
0
|
? $args->{"attributes"} |
331
|
0
|
|
|
|
|
0
|
: $Mite::Trait::HasAttributes::__attributes_DEFAULT__ |
|
0
|
|
|
|
|
0
|
|
332
|
|
|
|
|
|
|
->($self); |
333
|
|
|
|
|
|
|
do { |
334
|
0
|
0
|
|
|
|
0
|
|
335
|
108
|
|
|
108
|
|
930
|
( ref($value) eq 'HASH' ) and do { |
|
108
|
|
|
|
|
202
|
|
|
108
|
|
|
|
|
10973
|
|
336
|
0
|
0
|
|
|
|
0
|
my $ok = 1; |
337
|
|
|
|
|
|
|
for my $i ( values %{$value} ) { |
338
|
|
|
|
|
|
|
( $ok = 0, last ) |
339
|
|
|
|
|
|
|
unless ( |
340
|
|
|
|
|
|
|
do { |
341
|
0
|
|
|
|
|
0
|
use Scalar::Util (); |
342
|
|
|
|
|
|
|
Scalar::Util::blessed($i) |
343
|
|
|
|
|
|
|
and $i->isa(q[Mite::Attribute]); |
344
|
|
|
|
|
|
|
} |
345
|
|
|
|
|
|
|
); |
346
|
0
|
|
|
|
|
0
|
}; |
347
|
|
|
|
|
|
|
$ok; |
348
|
|
|
|
|
|
|
} |
349
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
350
|
|
|
|
|
|
|
"attributes", "HashRef[Mite::Attribute]"; |
351
|
150
|
|
|
|
|
305
|
$self->{"attributes"} = $value; |
352
|
|
|
|
|
|
|
}; |
353
|
|
|
|
|
|
|
|
354
|
150
|
50
|
|
|
|
994
|
# Attribute roles (type: ArrayRef[Mite::Role]) |
355
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Trait/HasRoles.pm, line 19 |
356
|
|
|
|
|
|
|
do { |
357
|
150
|
50
|
|
|
|
258
|
my $value = |
358
|
|
|
|
|
|
|
exists( $args->{"roles"} ) |
359
|
|
|
|
|
|
|
? $args->{"roles"} |
360
|
150
|
50
|
|
|
|
693
|
: $self->_build_roles; |
361
|
150
|
|
|
|
|
271
|
do { |
362
|
150
|
|
|
|
|
292
|
|
|
150
|
|
|
|
|
416
|
|
363
|
|
|
|
|
|
|
( ref($value) eq 'ARRAY' ) and do { |
364
|
|
|
|
|
|
|
my $ok = 1; |
365
|
0
|
0
|
|
|
|
0
|
for my $i ( @{$value} ) { |
366
|
108
|
|
|
108
|
|
595
|
( $ok = 0, last ) |
|
108
|
|
|
|
|
201
|
|
|
108
|
|
|
|
|
12486
|
|
367
|
0
|
0
|
|
|
|
0
|
unless ( |
368
|
|
|
|
|
|
|
do { |
369
|
|
|
|
|
|
|
use Scalar::Util (); |
370
|
|
|
|
|
|
|
Scalar::Util::blessed($i) |
371
|
|
|
|
|
|
|
and $i->isa(q[Mite::Role]); |
372
|
150
|
|
|
|
|
630
|
} |
373
|
|
|
|
|
|
|
); |
374
|
|
|
|
|
|
|
}; |
375
|
|
|
|
|
|
|
$ok; |
376
|
|
|
|
|
|
|
} |
377
|
150
|
|
|
|
|
573
|
or croak "Type check failed in constructor: %s should be %s", |
378
|
|
|
|
|
|
|
"roles", "ArrayRef[Mite::Role]"; |
379
|
|
|
|
|
|
|
$self->{"roles"} = $value; |
380
|
|
|
|
|
|
|
}; |
381
|
|
|
|
|
|
|
|
382
|
150
|
|
|
|
|
266
|
# Attribute role_args (type: Map[NonEmptyStr,HashRef|Undef]) |
383
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Trait/HasRoles.pm, line 24 |
384
|
|
|
|
|
|
|
do { |
385
|
150
|
50
|
|
|
|
729
|
my $value = |
386
|
|
|
|
|
|
|
exists( $args->{"role_args"} ) |
387
|
150
|
50
|
|
|
|
267
|
? $args->{"role_args"} |
388
|
|
|
|
|
|
|
: $self->_build_role_args; |
389
|
|
|
|
|
|
|
do { |
390
|
150
|
50
|
|
|
|
758
|
|
391
|
150
|
|
|
|
|
322
|
( ref($value) eq 'HASH' ) and do { |
392
|
150
|
|
|
|
|
382
|
my $ok = 1; |
|
150
|
|
|
|
|
386
|
|
393
|
|
|
|
|
|
|
for my $v ( values %{$value} ) { |
394
|
|
|
|
|
|
|
( $ok = 0, last ) unless do { |
395
|
0
|
0
|
|
|
|
0
|
|
396
|
108
|
|
|
108
|
|
695
|
( ( ref($v) eq 'HASH' ) or ( !defined($v) ) ); |
|
108
|
|
|
|
|
207
|
|
|
108
|
|
|
|
|
27251
|
|
397
|
0
|
0
|
|
|
|
0
|
} |
398
|
|
|
|
|
|
|
}; |
399
|
|
|
|
|
|
|
for my $k ( keys %{$value} ) { |
400
|
|
|
|
|
|
|
( $ok = 0, last ) |
401
|
|
|
|
|
|
|
unless ( |
402
|
150
|
|
|
|
|
1335
|
( |
403
|
|
|
|
|
|
|
do { |
404
|
|
|
|
|
|
|
|
405
|
|
|
|
|
|
|
defined($k) and do { |
406
|
|
|
|
|
|
|
ref( \$k ) eq 'SCALAR' |
407
|
150
|
|
|
|
|
411
|
or ref( \( my $val = $k ) ) eq |
408
|
|
|
|
|
|
|
'SCALAR'; |
409
|
|
|
|
|
|
|
} |
410
|
|
|
|
|
|
|
} |
411
|
|
|
|
|
|
|
) |
412
|
150
|
|
|
|
|
263
|
&& ( length($k) > 0 ) |
413
|
|
|
|
|
|
|
); |
414
|
|
|
|
|
|
|
}; |
415
|
150
|
50
|
|
|
|
865
|
$ok; |
416
|
|
|
|
|
|
|
} |
417
|
150
|
50
|
|
|
|
784
|
or croak "Type check failed in constructor: %s should be %s", |
418
|
|
|
|
|
|
|
"role_args", "Map[NonEmptyStr,HashRef|Undef]"; |
419
|
|
|
|
|
|
|
$self->{"role_args"} = $value; |
420
|
150
|
50
|
|
|
|
808
|
}; |
421
|
150
|
|
|
|
|
298
|
|
422
|
150
|
|
|
|
|
341
|
# Attribute method_signatures (type: Map[MethodName,Mite::Signature]) |
|
150
|
|
|
|
|
587
|
|
423
|
0
|
0
|
|
|
|
0
|
# has declaration, file lib/Mite/Trait/HasMethods.pm, line 20 |
424
|
|
|
|
|
|
|
do { |
425
|
|
|
|
|
|
|
my $value = |
426
|
0
|
0
|
|
|
|
0
|
exists( $args->{"method_signatures"} ) |
427
|
|
|
|
|
|
|
? $args->{"method_signatures"} |
428
|
|
|
|
|
|
|
: $self->_build_method_signatures; |
429
|
150
|
|
|
|
|
294
|
do { |
|
150
|
|
|
|
|
336
|
|
430
|
|
|
|
|
|
|
|
431
|
|
|
|
|
|
|
( ref($value) eq 'HASH' ) and do { |
432
|
|
|
|
|
|
|
my $ok = 1; |
433
|
0
|
0
|
0
|
|
|
0
|
for my $v ( values %{$value} ) { |
434
|
|
|
|
|
|
|
( $ok = 0, last ) |
435
|
|
|
|
|
|
|
unless ( |
436
|
0
|
0
|
|
|
|
0
|
do { |
437
|
0
|
0
|
|
|
|
0
|
use Scalar::Util (); |
438
|
|
|
|
|
|
|
Scalar::Util::blessed($v) |
439
|
|
|
|
|
|
|
and $v->isa(q[Mite::Signature]); |
440
|
|
|
|
|
|
|
} |
441
|
|
|
|
|
|
|
); |
442
|
|
|
|
|
|
|
}; |
443
|
|
|
|
|
|
|
for my $k ( keys %{$value} ) { |
444
|
|
|
|
|
|
|
( $ok = 0, last ) |
445
|
|
|
|
|
|
|
unless ( |
446
|
150
|
|
|
|
|
631
|
( |
447
|
|
|
|
|
|
|
do { |
448
|
|
|
|
|
|
|
|
449
|
|
|
|
|
|
|
defined($k) and do { |
450
|
|
|
|
|
|
|
ref( \$k ) eq 'SCALAR' |
451
|
150
|
|
|
|
|
399
|
or ref( \( my $val = $k ) ) eq |
452
|
|
|
|
|
|
|
'SCALAR'; |
453
|
|
|
|
|
|
|
} |
454
|
|
|
|
|
|
|
} |
455
|
|
|
|
|
|
|
) |
456
|
150
|
|
|
|
|
264
|
&& ( do { local $_ = $k; /\A[^\W0-9]\w*\z/ } ) |
457
|
|
|
|
|
|
|
); |
458
|
|
|
|
|
|
|
}; |
459
|
150
|
50
|
|
|
|
760
|
$ok; |
460
|
|
|
|
|
|
|
} |
461
|
150
|
50
|
|
|
|
252
|
or croak "Type check failed in constructor: %s should be %s", |
462
|
|
|
|
|
|
|
"method_signatures", "Map[MethodName,Mite::Signature]"; |
463
|
|
|
|
|
|
|
$self->{"method_signatures"} = $value; |
464
|
150
|
50
|
|
|
|
727
|
}; |
465
|
150
|
|
|
|
|
319
|
|
466
|
150
|
|
|
|
|
264
|
# Call BUILD methods |
|
150
|
|
|
|
|
573
|
|
467
|
|
|
|
|
|
|
$self->BUILDALL($args) if ( !$no_build and @{ $meta->{BUILD} || [] } ); |
468
|
|
|
|
|
|
|
|
469
|
0
|
0
|
|
|
|
0
|
# Unrecognized parameters |
470
|
108
|
|
|
108
|
|
772
|
my @unknown = grep not( |
|
108
|
|
|
|
|
271
|
|
|
108
|
|
|
|
|
106789
|
|
471
|
0
|
0
|
|
|
|
0
|
/\A(?:a(?:rg|ttributes)|extends|imported_(?:functions|keywords)|method_signatures|name|parents|role(?:_args|s)|s(?:him_name|ource|uperclass_args))\z/ |
472
|
|
|
|
|
|
|
), keys %{$args}; |
473
|
|
|
|
|
|
|
@unknown |
474
|
|
|
|
|
|
|
and croak( |
475
|
|
|
|
|
|
|
"Unexpected keys in constructor: " . join( q[, ], sort @unknown ) ); |
476
|
150
|
|
|
|
|
327
|
|
|
150
|
|
|
|
|
394
|
|
477
|
|
|
|
|
|
|
return $self; |
478
|
|
|
|
|
|
|
} |
479
|
|
|
|
|
|
|
|
480
|
|
|
|
|
|
|
my $__XS = !$ENV{PERL_ONLY} |
481
|
|
|
|
|
|
|
&& eval { require Class::XSAccessor; Class::XSAccessor->VERSION("1.19") }; |
482
|
|
|
|
|
|
|
|
483
|
0
|
0
|
|
|
|
0
|
# Accessors for attributes |
484
|
0
|
0
|
|
|
|
0
|
# has declaration, file lib/Mite/Trait/HasAttributes.pm, line 16 |
485
|
|
|
|
|
|
|
if ($__XS) { |
486
|
|
|
|
|
|
|
Class::XSAccessor->import( |
487
|
|
|
|
|
|
|
chained => 1, |
488
|
|
|
|
|
|
|
"getters" => { "attributes" => "attributes" }, |
489
|
|
|
|
|
|
|
); |
490
|
0
|
0
|
0
|
|
|
0
|
} |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
491
|
|
|
|
|
|
|
else { |
492
|
|
|
|
|
|
|
*attributes = sub { |
493
|
150
|
|
|
|
|
523
|
@_ == 1 or croak('Reader "attributes" usage: $self->attributes()'); |
494
|
|
|
|
|
|
|
$_[0]{"attributes"}; |
495
|
|
|
|
|
|
|
}; |
496
|
|
|
|
|
|
|
} |
497
|
|
|
|
|
|
|
|
498
|
150
|
|
|
|
|
724
|
# Accessors for extends |
499
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Trait/HasSuperclasses.pm, line 28 |
500
|
|
|
|
|
|
|
@_ > 1 |
501
|
|
|
|
|
|
|
? do { |
502
|
150
|
50
|
33
|
|
|
598
|
my @oldvalue; |
|
150
|
50
|
|
|
|
1921
|
|
503
|
|
|
|
|
|
|
@oldvalue = $_[0]{"extends"} if exists $_[0]{"extends"}; |
504
|
|
|
|
|
|
|
do { |
505
|
|
|
|
|
|
|
|
506
|
|
|
|
|
|
|
( ref( $_[1] ) eq 'ARRAY' ) and do { |
507
|
150
|
|
|
|
|
404
|
my $ok = 1; |
|
150
|
|
|
|
|
1643
|
|
508
|
|
|
|
|
|
|
for my $i ( @{ $_[1] } ) { |
509
|
150
|
50
|
|
|
|
580
|
( $ok = 0, last ) |
510
|
|
|
|
|
|
|
unless ( |
511
|
|
|
|
|
|
|
( |
512
|
150
|
|
|
|
|
1304
|
do { |
513
|
|
|
|
|
|
|
|
514
|
|
|
|
|
|
|
defined($i) and do { |
515
|
|
|
|
|
|
|
ref( \$i ) eq 'SCALAR' |
516
|
|
|
|
|
|
|
or ref( \( my $val = $i ) ) eq |
517
|
|
|
|
|
|
|
'SCALAR'; |
518
|
|
|
|
|
|
|
} |
519
|
|
|
|
|
|
|
} |
520
|
|
|
|
|
|
|
) |
521
|
|
|
|
|
|
|
&& ( |
522
|
|
|
|
|
|
|
do { |
523
|
|
|
|
|
|
|
local $_ = $i; |
524
|
|
|
|
|
|
|
/\A[^\W0-9]\w*(?:::[^\W0-9]\w*)*\z/; |
525
|
|
|
|
|
|
|
} |
526
|
|
|
|
|
|
|
) |
527
|
|
|
|
|
|
|
); |
528
|
|
|
|
|
|
|
}; |
529
|
|
|
|
|
|
|
$ok; |
530
|
|
|
|
|
|
|
} |
531
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
532
|
|
|
|
|
|
|
"accessor", "ArrayRef[ValidClassName]" ); |
533
|
|
|
|
|
|
|
$_[0]{"extends"} = $_[1]; |
534
|
|
|
|
|
|
|
$_[0]->_trigger_extends( $_[0]{"extends"}, @oldvalue ); |
535
|
|
|
|
|
|
|
$_[0]; |
536
|
|
|
|
|
|
|
} |
537
|
|
|
|
|
|
|
: ( $_[0]{"extends"} ); |
538
|
39
|
|
|
|
|
65
|
} |
539
|
39
|
50
|
|
|
|
164
|
|
540
|
39
|
50
|
|
|
|
59
|
# Accessors for method_signatures |
541
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Trait/HasMethods.pm, line 20 |
542
|
|
|
|
|
|
|
if ($__XS) { |
543
|
39
|
50
|
|
|
|
197
|
Class::XSAccessor->import( |
544
|
39
|
|
|
|
|
75
|
chained => 1, |
545
|
39
|
|
|
|
|
63
|
"getters" => { "method_signatures" => "method_signatures" }, |
|
39
|
|
|
|
|
133
|
|
546
|
|
|
|
|
|
|
); |
547
|
|
|
|
|
|
|
} |
548
|
|
|
|
|
|
|
else { |
549
|
|
|
|
|
|
|
*method_signatures = sub { |
550
|
|
|
|
|
|
|
@_ == 1 |
551
|
|
|
|
|
|
|
or croak( |
552
|
45
|
50
|
|
|
|
175
|
'Reader "method_signatures" usage: $self->method_signatures()'); |
553
|
45
|
50
|
|
|
|
276
|
$_[0]{"method_signatures"}; |
554
|
|
|
|
|
|
|
}; |
555
|
|
|
|
|
|
|
} |
556
|
|
|
|
|
|
|
|
557
|
|
|
|
|
|
|
# Accessors for parents |
558
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Trait/HasSuperclasses.pm, line 36 |
559
|
|
|
|
|
|
|
@_ == 1 |
560
|
45
|
50
|
33
|
|
|
78
|
or croak('Clearer "_clear_parents" usage: $self->_clear_parents()'); |
561
|
45
|
|
|
|
|
89
|
delete $_[0]{"parents"}; |
562
|
45
|
|
|
|
|
361
|
$_[0]; |
563
|
|
|
|
|
|
|
} |
564
|
|
|
|
|
|
|
|
565
|
|
|
|
|
|
|
@_ == 1 or croak('Reader "parents" usage: $self->parents()'); |
566
|
|
|
|
|
|
|
( |
567
|
39
|
|
|
|
|
149
|
exists( $_[0]{"parents"} ) ? $_[0]{"parents"} : ( |
568
|
|
|
|
|
|
|
$_[0]{"parents"} = do { |
569
|
|
|
|
|
|
|
my $default_value = $_[0]->_build_parents; |
570
|
|
|
|
|
|
|
do { |
571
|
|
|
|
|
|
|
|
572
|
39
|
|
|
|
|
84
|
( ref($default_value) eq 'ARRAY' ) and do { |
573
|
39
|
|
|
|
|
161
|
my $ok = 1; |
574
|
39
|
|
|
|
|
121
|
for my $i ( @{$default_value} ) { |
575
|
|
|
|
|
|
|
( $ok = 0, last ) |
576
|
804
|
100
|
|
804
|
0
|
3885
|
unless ( |
577
|
|
|
|
|
|
|
do { |
578
|
|
|
|
|
|
|
use Scalar::Util (); |
579
|
|
|
|
|
|
|
Scalar::Util::blessed($i) |
580
|
|
|
|
|
|
|
and $i->isa(q[Mite::Class]); |
581
|
|
|
|
|
|
|
} |
582
|
|
|
|
|
|
|
); |
583
|
|
|
|
|
|
|
}; |
584
|
|
|
|
|
|
|
$ok; |
585
|
|
|
|
|
|
|
} |
586
|
|
|
|
|
|
|
or croak( "Type check failed in default: %s should be %s", |
587
|
|
|
|
|
|
|
"parents", "ArrayRef[Mite::Class]" ); |
588
|
|
|
|
|
|
|
$default_value; |
589
|
|
|
|
|
|
|
} |
590
|
|
|
|
|
|
|
) |
591
|
|
|
|
|
|
|
); |
592
|
|
|
|
|
|
|
} |
593
|
|
|
|
|
|
|
|
594
|
|
|
|
|
|
|
# Accessors for role_args |
595
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Trait/HasRoles.pm, line 24 |
596
|
|
|
|
|
|
|
@_ > 1 |
597
|
|
|
|
|
|
|
? do { |
598
|
|
|
|
|
|
|
do { |
599
|
189
|
50
|
|
189
|
|
677
|
|
600
|
|
|
|
|
|
|
( ref( $_[1] ) eq 'HASH' ) and do { |
601
|
189
|
|
|
|
|
450
|
my $ok = 1; |
602
|
189
|
|
|
|
|
432
|
for my $v ( values %{ $_[1] } ) { |
603
|
|
|
|
|
|
|
( $ok = 0, last ) unless do { |
604
|
|
|
|
|
|
|
|
605
|
|
|
|
|
|
|
( ( ref($v) eq 'HASH' ) or ( !defined($v) ) ); |
606
|
112
|
50
|
|
112
|
0
|
479
|
} |
607
|
|
|
|
|
|
|
}; |
608
|
|
|
|
|
|
|
for my $k ( keys %{ $_[1] } ) { |
609
|
112
|
50
|
|
|
|
504
|
( $ok = 0, last ) |
610
|
112
|
|
|
|
|
570
|
unless ( |
611
|
112
|
50
|
|
|
|
254
|
( |
612
|
|
|
|
|
|
|
do { |
613
|
|
|
|
|
|
|
|
614
|
112
|
50
|
|
|
|
667
|
defined($k) and do { |
615
|
112
|
|
|
|
|
275
|
ref( \$k ) eq 'SCALAR' |
616
|
112
|
|
|
|
|
223
|
or ref( \( my $val = $k ) ) eq |
|
112
|
|
|
|
|
363
|
|
617
|
|
|
|
|
|
|
'SCALAR'; |
618
|
|
|
|
|
|
|
} |
619
|
24
|
50
|
|
|
|
38
|
} |
620
|
108
|
|
|
108
|
|
857
|
) |
|
108
|
|
|
|
|
244
|
|
|
108
|
|
|
|
|
36572
|
|
621
|
24
|
50
|
|
|
|
263
|
&& ( length($k) > 0 ) |
622
|
|
|
|
|
|
|
); |
623
|
|
|
|
|
|
|
}; |
624
|
|
|
|
|
|
|
$ok; |
625
|
|
|
|
|
|
|
} |
626
|
112
|
|
|
|
|
493
|
or croak( "Type check failed in %s: value should be %s", |
627
|
|
|
|
|
|
|
"accessor", "Map[NonEmptyStr,HashRef|Undef]" ); |
628
|
|
|
|
|
|
|
$_[0]{"role_args"} = $_[1]; |
629
|
|
|
|
|
|
|
$_[0]; |
630
|
|
|
|
|
|
|
} |
631
|
112
|
|
|
|
|
453
|
: ( $_[0]{"role_args"} ); |
632
|
|
|
|
|
|
|
} |
633
|
|
|
|
|
|
|
|
634
|
|
|
|
|
|
|
# Accessors for roles |
635
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Trait/HasRoles.pm, line 19 |
636
|
|
|
|
|
|
|
@_ > 1 |
637
|
|
|
|
|
|
|
? do { |
638
|
|
|
|
|
|
|
do { |
639
|
|
|
|
|
|
|
|
640
|
|
|
|
|
|
|
( ref( $_[1] ) eq 'ARRAY' ) and do { |
641
|
|
|
|
|
|
|
my $ok = 1; |
642
|
0
|
0
|
|
|
|
0
|
for my $i ( @{ $_[1] } ) { |
643
|
|
|
|
|
|
|
( $ok = 0, last ) |
644
|
|
|
|
|
|
|
unless ( |
645
|
0
|
0
|
|
|
|
0
|
do { |
646
|
0
|
|
|
|
|
0
|
use Scalar::Util (); |
647
|
0
|
|
|
|
|
0
|
Scalar::Util::blessed($i) |
|
0
|
|
|
|
|
0
|
|
648
|
0
|
0
|
|
|
|
0
|
and $i->isa(q[Mite::Role]); |
649
|
|
|
|
|
|
|
} |
650
|
|
|
|
|
|
|
); |
651
|
0
|
0
|
|
|
|
0
|
}; |
652
|
|
|
|
|
|
|
$ok; |
653
|
|
|
|
|
|
|
} |
654
|
0
|
|
|
|
|
0
|
or croak( "Type check failed in %s: value should be %s", |
|
0
|
|
|
|
|
0
|
|
655
|
|
|
|
|
|
|
"accessor", "ArrayRef[Mite::Role]" ); |
656
|
|
|
|
|
|
|
$_[0]{"roles"} = $_[1]; |
657
|
|
|
|
|
|
|
$_[0]; |
658
|
0
|
0
|
0
|
|
|
0
|
} |
659
|
|
|
|
|
|
|
: ( $_[0]{"roles"} ); |
660
|
|
|
|
|
|
|
} |
661
|
0
|
0
|
|
|
|
0
|
|
662
|
0
|
0
|
|
|
|
0
|
# Accessors for superclass_args |
663
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Trait/HasSuperclasses.pm, line 33 |
664
|
|
|
|
|
|
|
@_ > 1 |
665
|
|
|
|
|
|
|
? do { |
666
|
|
|
|
|
|
|
do { |
667
|
|
|
|
|
|
|
|
668
|
|
|
|
|
|
|
( ref( $_[1] ) eq 'HASH' ) and do { |
669
|
|
|
|
|
|
|
my $ok = 1; |
670
|
|
|
|
|
|
|
for my $v ( values %{ $_[1] } ) { |
671
|
0
|
|
|
|
|
0
|
( $ok = 0, last ) unless do { |
672
|
|
|
|
|
|
|
|
673
|
|
|
|
|
|
|
( ( ref($v) eq 'HASH' ) or ( !defined($v) ) ); |
674
|
|
|
|
|
|
|
} |
675
|
|
|
|
|
|
|
}; |
676
|
0
|
|
|
|
|
0
|
for my $k ( keys %{ $_[1] } ) { |
677
|
0
|
|
|
|
|
0
|
( $ok = 0, last ) |
678
|
|
|
|
|
|
|
unless ( |
679
|
28
|
50
|
|
28
|
0
|
211
|
( |
680
|
|
|
|
|
|
|
do { |
681
|
|
|
|
|
|
|
|
682
|
|
|
|
|
|
|
defined($k) and do { |
683
|
|
|
|
|
|
|
ref( \$k ) eq 'SCALAR' |
684
|
|
|
|
|
|
|
or ref( \( my $val = $k ) ) eq |
685
|
|
|
|
|
|
|
'SCALAR'; |
686
|
|
|
|
|
|
|
} |
687
|
0
|
0
|
|
|
|
0
|
} |
688
|
|
|
|
|
|
|
) |
689
|
|
|
|
|
|
|
&& ( length($k) > 0 ) |
690
|
0
|
0
|
|
|
|
0
|
); |
691
|
0
|
|
|
|
|
0
|
}; |
692
|
0
|
|
|
|
|
0
|
$ok; |
|
0
|
|
|
|
|
0
|
|
693
|
|
|
|
|
|
|
} |
694
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
695
|
0
|
0
|
|
|
|
0
|
"accessor", "Map[NonEmptyStr,HashRef|Undef]" ); |
696
|
108
|
|
|
108
|
|
759
|
$_[0]{"superclass_args"} = $_[1]; |
|
108
|
|
|
|
|
260
|
|
|
108
|
|
|
|
|
39330
|
|
697
|
0
|
0
|
|
|
|
0
|
$_[0]; |
698
|
|
|
|
|
|
|
} |
699
|
|
|
|
|
|
|
: ( $_[0]{"superclass_args"} ); |
700
|
|
|
|
|
|
|
} |
701
|
|
|
|
|
|
|
|
702
|
0
|
|
|
|
|
0
|
BEGIN { |
703
|
|
|
|
|
|
|
require Mite::Trait::HasSuperclasses; |
704
|
|
|
|
|
|
|
require Mite::Trait::HasConstructor; |
705
|
|
|
|
|
|
|
require Mite::Trait::HasDestructor; |
706
|
|
|
|
|
|
|
require Mite::Trait::HasAttributes; |
707
|
0
|
|
|
|
|
0
|
require Mite::Trait::HasRoles; |
708
|
0
|
|
|
|
|
0
|
require Mite::Trait::HasMethods; |
709
|
|
|
|
|
|
|
require Mite::Trait::HasMOP; |
710
|
260
|
50
|
|
260
|
0
|
1296
|
|
711
|
|
|
|
|
|
|
our %DOES = ( |
712
|
|
|
|
|
|
|
"Mite::Class" => 1, |
713
|
|
|
|
|
|
|
"Mite::Trait::HasSuperclasses" => 1, |
714
|
|
|
|
|
|
|
"Mite::Trait::HasConstructor" => 1, |
715
|
|
|
|
|
|
|
"Mite::Trait::HasDestructor" => 1, |
716
|
|
|
|
|
|
|
"Mite::Trait::HasAttributes" => 1, |
717
|
|
|
|
|
|
|
"Mite::Trait::HasRoles" => 1, |
718
|
23
|
50
|
|
|
|
47
|
"Mite::Trait::HasMethods" => 1, |
719
|
|
|
|
|
|
|
"Mite::Trait::HasMOP" => 1 |
720
|
|
|
|
|
|
|
); |
721
|
23
|
50
|
|
|
|
214
|
} |
722
|
23
|
|
|
|
|
52
|
|
723
|
23
|
|
|
|
|
46
|
# See UNIVERSAL |
|
23
|
|
|
|
|
111
|
|
724
|
25
|
50
|
|
|
|
52
|
my ( $self, $role ) = @_; |
725
|
|
|
|
|
|
|
our %DOES; |
726
|
|
|
|
|
|
|
return $DOES{$role} if exists $DOES{$role}; |
727
|
25
|
50
|
|
|
|
201
|
return 1 if $role eq __PACKAGE__; |
728
|
|
|
|
|
|
|
return $self->SUPER::DOES($role); |
729
|
|
|
|
|
|
|
} |
730
|
23
|
|
|
|
|
53
|
|
|
23
|
|
|
|
|
72
|
|
731
|
|
|
|
|
|
|
# Alias for Moose/Moo-compatibility |
732
|
|
|
|
|
|
|
shift->DOES(@_); |
733
|
|
|
|
|
|
|
} |
734
|
25
|
50
|
33
|
|
|
40
|
|
735
|
|
|
|
|
|
|
# Methods from roles |
736
|
|
|
|
|
|
|
|
737
|
25
|
50
|
|
|
|
94
|
goto \&Mite::Trait::HasMethods::_build_method_signatures; |
738
|
25
|
50
|
|
|
|
206
|
} |
739
|
|
|
|
|
|
|
|
740
|
|
|
|
|
|
|
goto \&Mite::Trait::HasSuperclasses::_build_parents; |
741
|
|
|
|
|
|
|
} |
742
|
|
|
|
|
|
|
|
743
|
|
|
|
|
|
|
goto \&Mite::Trait::HasRoles::_build_role_args; |
744
|
|
|
|
|
|
|
} |
745
|
|
|
|
|
|
|
|
746
|
|
|
|
|
|
|
goto \&Mite::Trait::HasSuperclasses::_build_superclass_args; |
747
|
23
|
|
|
|
|
90
|
} |
748
|
|
|
|
|
|
|
|
749
|
|
|
|
|
|
|
goto |
750
|
|
|
|
|
|
|
\&Mite::Trait::HasAttributes::_compile_attribute_accessors; |
751
|
|
|
|
|
|
|
} |
752
|
23
|
|
|
|
|
66
|
|
753
|
23
|
|
|
|
|
53
|
goto \&Mite::Trait::HasConstructor::_compile_bless; |
754
|
|
|
|
|
|
|
} |
755
|
56
|
100
|
|
56
|
0
|
321
|
|
756
|
|
|
|
|
|
|
goto \&Mite::Trait::HasConstructor::_compile_buildall; |
757
|
|
|
|
|
|
|
} |
758
|
|
|
|
|
|
|
|
759
|
108
|
|
|
108
|
|
49666
|
goto \&Mite::Trait::HasConstructor::_compile_buildall_method; |
760
|
108
|
|
|
|
|
49039
|
} |
761
|
108
|
|
|
|
|
41932
|
|
762
|
108
|
|
|
|
|
42156
|
goto \&Mite::Trait::HasConstructor::_compile_buildargs; |
763
|
108
|
|
|
|
|
42910
|
} |
764
|
108
|
|
|
|
|
45720
|
|
765
|
108
|
|
|
|
|
43494
|
goto \&Mite::Trait::HasRoles::_compile_composed_methods; |
766
|
|
|
|
|
|
|
} |
767
|
108
|
|
|
|
|
103047
|
|
768
|
|
|
|
|
|
|
goto \&Mite::Trait::HasDestructor::_compile_destroy; |
769
|
|
|
|
|
|
|
} |
770
|
|
|
|
|
|
|
|
771
|
|
|
|
|
|
|
goto \&Mite::Trait::HasSuperclasses::_compile_extends; |
772
|
|
|
|
|
|
|
} |
773
|
|
|
|
|
|
|
|
774
|
|
|
|
|
|
|
goto \&Mite::Trait::HasAttributes::_compile_init_attributes; |
775
|
|
|
|
|
|
|
} |
776
|
|
|
|
|
|
|
|
777
|
|
|
|
|
|
|
goto \&Mite::Trait::HasMethods::_compile_method_signatures; |
778
|
|
|
|
|
|
|
} |
779
|
|
|
|
|
|
|
|
780
|
|
|
|
|
|
|
goto \&Mite::Trait::HasMOP::_compile_mop_attributes; |
781
|
0
|
|
|
0
|
0
|
0
|
} |
782
|
0
|
|
|
|
|
0
|
|
783
|
0
|
0
|
|
|
|
0
|
goto \&Mite::Trait::HasMOP::_compile_mop_methods; |
784
|
0
|
0
|
|
|
|
0
|
} |
785
|
0
|
|
|
|
|
0
|
|
786
|
|
|
|
|
|
|
goto \&Mite::Trait::HasMOP::_compile_mop_modifiers; |
787
|
|
|
|
|
|
|
} |
788
|
|
|
|
|
|
|
|
789
|
|
|
|
|
|
|
goto \&Mite::Trait::HasMOP::_compile_mop_postamble; |
790
|
0
|
|
|
0
|
0
|
0
|
} |
791
|
|
|
|
|
|
|
|
792
|
|
|
|
|
|
|
goto \&Mite::Trait::HasMOP::_compile_mop_required_methods; |
793
|
|
|
|
|
|
|
} |
794
|
121
|
|
|
121
|
|
451
|
|
795
|
|
|
|
|
|
|
goto \&Mite::Trait::HasMOP::_compile_mop_tc; |
796
|
|
|
|
|
|
|
} |
797
|
150
|
|
|
150
|
|
767
|
|
798
|
|
|
|
|
|
|
goto \&Mite::Trait::HasConstructor::_compile_new; |
799
|
|
|
|
|
|
|
} |
800
|
|
|
|
|
|
|
|
801
|
112
|
|
|
112
|
|
520
|
goto |
802
|
|
|
|
|
|
|
\&Mite::Trait::HasConstructor::_compile_strict_constructor; |
803
|
|
|
|
|
|
|
} |
804
|
|
|
|
|
|
|
|
805
|
150
|
|
|
150
|
|
625
|
goto \&Mite::Trait::HasSuperclasses::_get_parent; |
806
|
|
|
|
|
|
|
} |
807
|
150
|
|
|
150
|
|
793
|
|
808
|
|
|
|
|
|
|
goto \&Mite::Trait::HasSuperclasses::_trigger_extends; |
809
|
|
|
|
|
|
|
} |
810
|
150
|
|
|
150
|
|
732
|
|
811
|
|
|
|
|
|
|
goto \&Mite::Trait::HasAttributes::add_attribute; |
812
|
|
|
|
|
|
|
} |
813
|
|
|
|
|
|
|
|
814
|
|
|
|
|
|
|
goto \&Mite::Trait::HasAttributes::add_attributes; |
815
|
121
|
|
|
121
|
|
604
|
} |
816
|
|
|
|
|
|
|
|
817
|
|
|
|
|
|
|
goto \&Mite::Trait::HasMethods::add_method_signature; |
818
|
|
|
|
|
|
|
} |
819
|
108
|
|
|
108
|
|
538
|
|
820
|
|
|
|
|
|
|
goto \&Mite::Trait::HasRoles::add_roles_by_name; |
821
|
|
|
|
|
|
|
} |
822
|
|
|
|
|
|
|
|
823
|
108
|
|
|
108
|
|
599
|
goto \&Mite::Trait::HasAttributes::all_attributes; |
824
|
|
|
|
|
|
|
} |
825
|
|
|
|
|
|
|
|
826
|
|
|
|
|
|
|
goto \&Mite::Trait::HasAttributes::extend_attribute; |
827
|
93
|
|
|
93
|
|
939
|
} |
828
|
|
|
|
|
|
|
|
829
|
|
|
|
|
|
|
goto \&Mite::Trait::HasSuperclasses::handle_extends_keyword; |
830
|
|
|
|
|
|
|
} |
831
|
109
|
|
|
109
|
|
490
|
|
832
|
|
|
|
|
|
|
goto \&Mite::Trait::HasRoles::handle_with_keyword; |
833
|
|
|
|
|
|
|
} |
834
|
|
|
|
|
|
|
goto \&Mite::Trait::HasSuperclasses::linear_isa; |
835
|
121
|
|
|
121
|
|
409
|
} |
836
|
|
|
|
|
|
|
|
837
|
|
|
|
|
|
|
goto \&Mite::Trait::HasSuperclasses::linear_parents; |
838
|
|
|
|
|
|
|
} |
839
|
93
|
|
|
93
|
|
562
|
|
840
|
|
|
|
|
|
|
goto \&Mite::Trait::HasRoles::methods_to_import_from_roles; |
841
|
121
|
|
|
121
|
|
470
|
} |
842
|
|
|
|
|
|
|
|
843
|
|
|
|
|
|
|
goto \&Mite::Trait::HasMethods::native_methods; |
844
|
121
|
|
|
121
|
|
647
|
} |
845
|
|
|
|
|
|
|
|
846
|
|
|
|
|
|
|
1; |
847
|
|
|
|
|
|
|
|