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