| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package DBIx::Class::Helper::Schema::Verifier::C3; |
|
2
|
|
|
|
|
|
|
$DBIx::Class::Helper::Schema::Verifier::C3::VERSION = '2.036000'; |
|
3
|
|
|
|
|
|
|
# ABSTRACT: Verify that the Results and ResultSets of your Schemata use c3 |
|
4
|
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
86876
|
use strict; |
|
|
1
|
|
|
|
|
10
|
|
|
|
1
|
|
|
|
|
24
|
|
|
6
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
20
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
401
|
use MRO::Compat; |
|
|
1
|
|
|
|
|
1454
|
|
|
|
1
|
|
|
|
|
25
|
|
|
9
|
1
|
|
|
1
|
|
5
|
use mro 'c3'; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
4
|
|
|
10
|
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
25
|
use base 'DBIx::Class::Helper::Schema::Verifier'; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
437
|
|
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub result_verifiers { |
|
14
|
|
|
|
|
|
|
( |
|
15
|
|
|
|
|
|
|
sub { |
|
16
|
3
|
|
|
3
|
|
14
|
my ($s, $result, $set) = @_; |
|
17
|
|
|
|
|
|
|
|
|
18
|
3
|
|
|
|
|
5
|
for ($result, $set) { |
|
19
|
5
|
|
|
|
|
18
|
my $mro = mro::get_mro($_); |
|
20
|
5
|
100
|
|
|
|
26
|
die "$_ does not use c3, it uses $mro" unless $mro eq 'c3'; |
|
21
|
|
|
|
|
|
|
} |
|
22
|
|
|
|
|
|
|
}, |
|
23
|
|
|
|
|
|
|
shift->next::method, |
|
24
|
|
|
|
|
|
|
) |
|
25
|
3
|
|
|
3
|
1
|
1422
|
} |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
__END__ |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=pod |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 NAME |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
DBIx::Class::Helper::Schema::Verifier::C3 - Verify that the Results and ResultSets of your Schemata use c3 |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
package MyApp::Schema; |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__PACKAGE__->load_components('Helper::Schema::Verifier::C3'); |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
C<DBIx::Class::Helper::Schema::Verifier::C3> verifies that all of your results |
|
46
|
|
|
|
|
|
|
and resultsets use the C<c3> C<mro>. If you didn't know this was important |
|
47
|
|
|
|
|
|
|
L<you know now|https://blog.afoolishmanifesto.com/posts/mros-and-you>. Note: |
|
48
|
|
|
|
|
|
|
this will probably fail on your schema because L<DBIx::Class::ResultSet> does |
|
49
|
|
|
|
|
|
|
not use C<c3>. |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 AUTHOR |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Arthur Axel "fREW" Schmidt <frioux+cpan@gmail.com> |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
This software is copyright (c) 2020 by Arthur Axel "fREW" Schmidt. |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
|
60
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=cut |