| 1 | package DBIx::Class::Helper::Schema::Verifier::C3; | ||||||||||
| 2 | 1 | $DBIx::Class::Helper::Schema::Verifier::C3::VERSION = '2.033001'; | |||||||||
| 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
| |||||||||||
| 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 | ||||||||||