Helper/Schema/Verifier/C3.pm

filter: Statementstmt 100% 22 / 22 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 100% 1 / 1 totaltotal 100% 32 / 32 CC 3 SCAR 5.1
CC
3
Cov
100%
__ANON__
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.7
« Helper/Schema/LintContents.pm ↑ Summary Helper/Schema/Verifier/RelationshipColumnName.pm »
1 package DBIx::Class::Helper::Schema::Verifier::C3;
2 1 $DBIx::Class::Helper::Schema::Verifier::C3::VERSION = '2.032002';
3 # ABSTRACT: Verify that the Results and ResultSets of your Schemata use c3
4  
5 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶use MRO::Compat;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use mro 'c3';
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 ▶use base 'DBIx::Class::Helper::Schema::Verifier';
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 sub result_verifiers {
14 (
15 sub {
16 3 ▶ my ($s, $result, $set) = @_;
Subroutine __ANON__: called CC=3 SCAR=11.0
17  
18 3 for ($result, $set) {
19 5 my $mro = mro::get_mro($_);
20 5 ▶ die "$_ does not use c3, it uses $mro" unless $mro eq 'c3';
Branch: 1 branch
BranchTrueFalseTotal
unless $mro eq "c3" 2 3 5
21 }
22 },
23 shift->next::method,
24 )
25 3 ▶}
Subroutine result_verifiers: called CC=1 SCAR=0.0
Pod documented
26  
27 1 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) 2016 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
« Helper/Schema/LintContents.pm ↑ Summary Helper/Schema/Verifier/RelationshipColumnName.pm »