| 1 | package DBIx::Class::Helper::Schema::Verifier::Parent; | ||||||||||
| 2 | 2 | $DBIx::Class::Helper::Schema::Verifier::Parent::VERSION = '2.033001'; | |||||||||
| 3 | # ABSTRACT: Verify that the Results and ResultSets have the correct base class | ||||||||||
| 4 | |||||||||||
| 5 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 2 | ▶ | use MRO::Compat; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 2 | ▶ | use mro 'c3'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 2 | ▶ | use base 'DBIx::Class::Helper::Schema::Verifier'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | |||||||||||
| 13 | sub result_verifiers { | ||||||||||
| 14 | ( | ||||||||||
| 15 | sub { | ||||||||||
| 16 | 7 | ▶ | my ($s, $result, $set) = @_; | ||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.0
| |||||||||||
| 17 | |||||||||||
| 18 | 7 | my $base_result = $s->base_result; | |||||||||
| 19 | 7 | my $base_set = $s->base_resultset; | |||||||||
| 20 | |||||||||||
| 21 | 7 | ▶ | die "$result is not a $base_result" unless $result->isa($base_result); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | 6 | ▶ | die "$set is not a $base_set" unless $set->isa($base_set); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | }, | ||||||||||
| 24 | shift->next::method, | ||||||||||
| 25 | ) | ||||||||||
| 26 | 7 | ▶ | } | ||||||||
|
Subroutine
result_verifiers: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 27 | |||||||||||
| 28 | 4 | ▶ | sub base_result { 'DBIx::Class::Core' } | ||||||||
|
Subroutine
base_result: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 29 | 4 | ▶ | sub base_resultset { 'DBIx::Class::ResultSet' } | ||||||||
|
Subroutine
base_resultset: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 30 | |||||||||||
| 31 | 2 | 1; | |||||||||
| 32 | |||||||||||
| 33 | __END__ | ||||||||||
| 34 | |||||||||||
| 35 | =pod | ||||||||||
| 36 | |||||||||||
| 37 | =head1 NAME | ||||||||||
| 38 | |||||||||||
| 39 | DBIx::Class::Helper::Schema::Verifier::Parent - Verify that the Results and ResultSets have the correct base class | ||||||||||
| 40 | |||||||||||
| 41 | =head1 SYNOPSIS | ||||||||||
| 42 | |||||||||||
| 43 | package MyApp::Schema; | ||||||||||
| 44 | |||||||||||
| 45 | __PACKAGE__->load_components('Helper::Schema::Verifier::Parent'); | ||||||||||
| 46 | |||||||||||
| 47 | sub base_result { 'MyApp::Schema::Result' } | ||||||||||
| 48 | sub base_resultset { 'MyApp::Schema::ResultSet' } | ||||||||||
| 49 | |||||||||||
| 50 | =head1 DESCRIPTION | ||||||||||
| 51 | |||||||||||
| 52 | C<DBIx::Class::Helper::Schema::Verifier::Parent> verifies that all of your | ||||||||||
| 53 | results and resultsets use the base class that you specify. | ||||||||||
| 54 | |||||||||||
| 55 | =head1 AUTHOR | ||||||||||
| 56 | |||||||||||
| 57 | Arthur Axel "fREW" Schmidt <frioux+cpan@gmail.com> | ||||||||||
| 58 | |||||||||||
| 59 | =head1 COPYRIGHT AND LICENSE | ||||||||||
| 60 | |||||||||||
| 61 | This software is copyright (c) 2016 by Arthur Axel "fREW" Schmidt. | ||||||||||
| 62 | |||||||||||
| 63 | This is free software; you can redistribute it and/or modify it under | ||||||||||
| 64 | the same terms as the Perl 5 programming language system itself. | ||||||||||
| 65 | |||||||||||
| 66 | =cut | ||||||||||