line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mock::Quick::Object::Control; |
2
|
7
|
|
|
7
|
|
24
|
use strict; |
|
7
|
|
|
|
|
6
|
|
|
7
|
|
|
|
|
149
|
|
3
|
7
|
|
|
7
|
|
23
|
use warnings; |
|
7
|
|
|
|
|
7
|
|
|
7
|
|
|
|
|
122
|
|
4
|
7
|
|
|
7
|
|
22
|
use Mock::Quick::Util; |
|
7
|
|
|
|
|
6
|
|
|
7
|
|
|
|
|
324
|
|
5
|
7
|
|
|
7
|
|
21
|
use Mock::Quick::Object; |
|
7
|
|
|
|
|
7
|
|
|
7
|
|
|
|
|
128
|
|
6
|
7
|
|
|
7
|
|
22
|
use Mock::Quick::Method; |
|
7
|
|
|
|
|
10
|
|
|
7
|
|
|
|
|
1896
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our %META; |
9
|
|
|
|
|
|
|
|
10
|
258
|
|
|
258
|
0
|
811
|
sub target { shift->{target} } |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new { |
13
|
101
|
|
|
101
|
1
|
86
|
my $class = shift; |
14
|
101
|
|
|
|
|
86
|
my ( $target ) = @_; |
15
|
101
|
|
|
|
|
239
|
return bless( { target => $target }, $class ); |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub set_methods { |
19
|
2
|
|
|
2
|
1
|
273
|
my $self = shift; |
20
|
2
|
|
|
|
|
5
|
my %params = @_; |
21
|
2
|
|
|
|
|
7
|
for my $key ( keys %params ) { |
22
|
2
|
|
|
|
|
10
|
$self->target->{$key} = Mock::Quick::Method->new( $params{$key} ); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub set_attributes { |
27
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
28
|
1
|
|
|
|
|
2
|
my %params = @_; |
29
|
1
|
|
|
|
|
2
|
for my $key ( keys %params ) { |
30
|
1
|
|
|
|
|
3
|
$self->target->{$key} = $params{$key}; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub clear { |
35
|
2
|
|
|
2
|
1
|
4
|
my $self = shift; |
36
|
2
|
|
|
|
|
5
|
for my $field ( @_ ) { |
37
|
2
|
|
|
|
|
4
|
delete $self->target->{$field}; |
38
|
2
|
|
|
|
|
5
|
delete $self->metrics->{$field}; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub strict { |
43
|
92
|
|
|
92
|
1
|
1780
|
my $self = shift; |
44
|
92
|
100
|
|
|
|
162
|
($META{$self->target}->{strict}) = @_ if @_; |
45
|
92
|
|
|
|
|
104
|
return $META{$self->target}->{strict}; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub metrics { |
49
|
70
|
|
|
70
|
1
|
46
|
my $self = shift; |
50
|
70
|
|
100
|
|
|
85
|
$META{$self->target}->{metrics} ||= {}; |
51
|
70
|
|
|
|
|
83
|
return $META{$self->target}->{metrics}; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub _clean { |
55
|
13
|
|
|
13
|
|
12
|
my $self = shift; |
56
|
13
|
|
|
|
|
21
|
delete $META{$self->target}; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
purge_util(); |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
1; |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
__END__ |