| 1 | 1 | ▶ | use 5.008; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 2 | 1 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | |||||||||||||||||||||
| 5 | package Class::Scaffold::Exception::Util; | ||||||||||||||||||||
| 6 | 1 | ▶ | BEGIN { | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | 1 | $Class::Scaffold::Exception::Util::VERSION = '1.102280'; | |||||||||||||||||||
| 8 | } | ||||||||||||||||||||
| 9 | # ABSTRACT: Helper functions for raising common exceptions | ||||||||||||||||||||
| 10 | 1 | ▶ | use Error::Hierarchy::Util 'assert_class'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 11 | 1 | ▶ | use Exporter qw(import); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 12 | 1 | our %EXPORT_TAGS = (misc => [qw{assert_object_type}],); | |||||||||||||||||||
| 13 | 1 | our @EXPORT_OK = @{ $EXPORT_TAGS{all} = [ map { @$_ } values %EXPORT_TAGS ] }; | |||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | # pass an OBJ_* constant to this method | ||||||||||||||||||||
| 16 | 0 | ▶ | sub assert_object_type ($$) { | ||||||||||||||||||
|
Subroutine
assert_object_type: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 17 | 0 | my ($obj, $object_type_const) = @_; | |||||||||||||||||||
| 18 | 0 | local $Error::Depth = $Error::Depth + 1; | |||||||||||||||||||
| 19 | 0 | ▶ | our $cached_env ||= Class::Scaffold::Environment->getenv; | ||||||||||||||||||
|
Condition0%0/3
our $cached_env ||= "Class::Scaffold::Environment"->getenv
MC/DC0%0/2
our $cached_env ||= "Class::Scaffold::Environment"->getenv
our $cached_env
"Class::Scaffold::Environment"->getenv
Truth table0%0/3
A ||= B
A= our $cached_envB= "Class::Scaffold::Environment"->getenv
| |||||||||||||||||||||
| 20 | 0 | our %cache; | |||||||||||||||||||
| 21 | 0 | ▶ | $cache{$object_type_const} ||= | ||||||||||||||||||
|
Condition0%0/3
$Class::Scaffold::Exception::Util::cache{$object_type_const} ||= $Class::Scaffold::Exception::Util::cached_env->get_class_name_for($object_type_const)
MC/DC0%0/2
$Class::Scaffold::Exception::Util::cache{$object_type_const} ||= $Class::Scaffold::Exception::Util::cached_env->get_class_name_for($object_type_const)
$Class::Scaffold::Exception::Util::cache{$object_type_const}
$Class::Scaffold::Exception::Util::cached_env->get_class_name_for($object_type_const)
Truth table0%0/3
A ||= B
A= $Class::Scaffold::Exception::Util::cache{$object_type_const}B= $Class::Scaffold::Exception::Util::cached_env->get_class_name_for($object_type_const)
| |||||||||||||||||||||
| 22 | $cached_env->get_class_name_for($object_type_const); | ||||||||||||||||||||
| 23 | 0 | assert_class($obj, $cache{$object_type_const}); | |||||||||||||||||||
| 24 | } | ||||||||||||||||||||
| 25 | 1 | 1; | |||||||||||||||||||
| 26 | |||||||||||||||||||||
| 27 | |||||||||||||||||||||
| 28 | __END__ | ||||||||||||||||||||