| 1 |
|
| package Chart::GGPlot::Theme; |
| 2 |
|
| |
| 3 |
|
| # ABSTRACT: Class for themes |
| 4 |
|
| |
| 5 |
3 |
▶ | use Chart::GGPlot::Setup; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 6 |
3 |
▶ | use Function::Parameters qw(classmethod); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 7 |
|
| |
| 8 |
3 |
| our $VERSION = '0.002003'; # VERSION |
| 9 |
|
| |
| 10 |
3 |
▶ | use parent qw(Chart::GGPlot::Params); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 11 |
|
| |
| 12 |
3 |
▶ | use List::AllUtils qw(reduce pairmap); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 13 |
3 |
▶ | use Types::Standard qw(ArrayRef Bool HashRef InstanceOf Num Str); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 14 |
|
| |
| 15 |
3 |
▶ | use Chart::GGPlot::Global; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 16 |
3 |
▶ | use Chart::GGPlot::Theme::ElementTree; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 17 |
3 |
▶ | use Chart::GGPlot::Types qw(:all); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
|
| 18 |
|
| |
| 19 |
18 |
▶ | classmethod new ( @rest ) { |
|
Subroutine
new: called CC=3 SCAR=11.6
Pod
undocumented
Branch: 1 branch
| Branch | True | False | Total |
| @_ < 1 and Function::Parameters::_croak('Too few arguments for classmethod new (expected 1, got ' . @_ . ')') |
0 |
18 |
18 |
|
| 20 |
0 |
▶ | my %params = @rest == 1 ? %{ $rest[0] } : @rest; |
Branch: 1 branch
| Branch | True | False | Total |
| @rest == 1 ? : |
0 |
18 |
18 |
|
| 21 |
18 |
| return $class->_theme(%params); |
| 22 |
3 |
| } |
| 23 |
|
| |
| 24 |
18 |
▶ | classmethod _theme (:$complete = false, %elements ) { |
|
Subroutine
_theme: called CC=6 SCAR=18.3
Branch: 3 branches
| Branch | True | False | Total |
| @_ < 1 and Function::Parameters::_croak('Too few arguments for classmethod _theme (expected 1, got ' . @_ . ')') |
0 |
18 |
18 |
| @_ > 1 and (@_ - 1) % 2 and Function::Parameters::_croak("Odd number of paired arguments for classmethod _theme") |
0 |
18 |
18 |
| exists $elements{'complete'} ? : |
18 |
0 |
18 |
MC/DC0%0/2
@_ > 1 and (@_ - 1) % 2
@_ > 1
(@_ - 1) % 2
Truth table33%1/3
A and B
A= @_ > 1B= (@_ - 1) % 2
|
| 25 |
|
| |
| 26 |
|
| # Check that all elements have the correct class (element_text, unit, etc) |
| 27 |
|
| %elements = |
| 28 |
18 |
| map { $_ => $class->_validate_element( $elements{$_}, $_ ); } |
| 29 |
|
| (sort keys %elements); |
| 30 |
|
| |
| 31 |
|
| # If complete theme set all non-blank elements to inherit from blanks |
| 32 |
18 |
▶ | if ($complete) { |
Branch: 1 branch
| Branch | True | False | Total |
| if ($complete) |
18 |
0 |
18 |
|
| 33 |
438 |
▶ | %elements = pairmap { |
|
Subroutine
__ANON__: called CC=3 SCAR=11.0
|
| 34 |
438 |
| my $el = $b; |
| 35 |
438 |
▶ | if ( $el->$_DOES('Chart::GGPlot::Theme::Element') |
Branch: 1 branch
| Branch | True | False | Total |
| if ($el->$Chart::GGPlot::Theme::_DOES("Chart::GGPlot::Theme::Element") and not $el->$Chart::GGPlot::Theme::_DOES("Chart::GGPlot::Theme::Element::Blank")) |
283 |
155 |
438 |
Condition100%3/3
$el->$Chart::GGPlot::Theme::_DOES("Chart::GGPlot::Theme::Element") and not $el->$Chart::GGPlot::Theme::_DOES("Chart::GGPlot::Theme::Element::Blank")
MC/DC100%2/2
$el->$Chart::GGPlot::Theme::_DOES("Chart::GGPlot::Theme::Element") and not $el->$Chart::GGPlot::Theme::_DOES("Chart::GGPlot::Theme::Element::Blank")
$el->$Chart::GGPlot::Theme::_DOES("Chart::GGPlot::Theme::Element")
not $el->$Chart::GGPlot::Theme::_DOES("Chart::GGPlot::Theme::Element::Blank")
Truth table100%3/3
A and not(B)
A= $el->$Chart::GGPlot::Theme::_DOES("Chart::GGPlot::Theme::Element")B= not $el->$Chart::GGPlot::Theme::_DOES("Chart::GGPlot::Theme::Element::Blank")
|
| 36 |
|
| and !$el->$_DOES('Chart::GGPlot::Theme::Element::Blank') ) |
| 37 |
|
| { |
| 38 |
283 |
| $el->set( 'inherit_blank', true ); |
| 39 |
|
| } |
| 40 |
438 |
| $a => $el; |
| 41 |
|
| } |
| 42 |
18 |
| %elements; |
| 43 |
|
| } |
| 44 |
|
| |
| 45 |
18 |
| return bless( |
| 46 |
|
| { |
| 47 |
|
| _hash => \%elements, |
| 48 |
|
| complete => $complete, |
| 49 |
|
| }, |
| 50 |
|
| $class |
| 51 |
|
| ); |
| 52 |
3 |
| } |
| 53 |
|
| |
| 54 |
0 |
▶ | method is_complete() { $self->{complete} } |
|
Subroutine
is_complete: not called CC=3 SCAR=22.6
Pod
undocumented
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 1 and Function::Parameters::_croak('Too few arguments for method is_complete (expected 1, got ' . @_ . ')') |
0 |
0 |
0 |
| @_ > 1 and Function::Parameters::_croak('Too many arguments for method is_complete (expected 1, got ' . @_ . ')') |
0 |
0 |
0 |
|
| 55 |
|
| |
| 56 |
|
| # override Chart::GGPlot::Aes's transform_key(). |
| 57 |
127 |
▶ | method transform_key ($key) { |
|
Subroutine
transform_key: called CC=3 SCAR=11.2
Pod
documented
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 2 and Function::Parameters::_croak('Too few arguments for method transform_key (expected 2, got ' . @_ . ')') |
0 |
127 |
127 |
| @_ > 2 and Function::Parameters::_croak('Too many arguments for method transform_key (expected 2, got ' . @_ . ')') |
0 |
127 |
127 |
|
| 58 |
127 |
| return Chart::GGPlot::Theme::ElementTree->transform_key($key); |
| 59 |
3 |
| } |
| 60 |
|
| |
| 61 |
|
| |
| 62 |
3 |
▶ | method calc_element ($elname) { |
|
Subroutine
calc_element: called CC=11 SCAR=26.9
Pod
documented
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 2 and Function::Parameters::_croak('Too few arguments for method calc_element (expected 2, got ' . @_ . ')') |
0 |
3 |
3 |
| @_ > 2 and Function::Parameters::_croak('Too many arguments for method calc_element (expected 2, got ' . @_ . ')') |
0 |
3 |
3 |
|
| 63 |
3 |
| my $message = "calc_element: $elname -->"; |
| 64 |
|
| |
| 65 |
|
| # If this is element_blank, don't inherit anything from parents |
| 66 |
3 |
| my $el = $self->at($elname); |
| 67 |
3 |
▶ | if ( $el->$_DOES('Chart::GGPlot::Theme::Element::Blank') ) { |
Branch: 1 branch
| Branch | True | False | Total |
| if ($el->$Chart::GGPlot::Theme::_DOES("Chart::GGPlot::Theme::Element::Blank")) |
0 |
3 |
3 |
|
| 68 |
0 |
▶ | $log->debug( $message . ' element_blank (no inheritance)' ) |
Branch: 1 branch
| Branch | True | False | Total |
| if $Chart::GGPlot::Theme::log->is_debug |
0 |
0 |
0 |
|
| 69 |
|
| if $log->is_debug; |
| 70 |
0 |
| return $el; |
| 71 |
|
| } |
| 72 |
|
| |
| 73 |
|
| # If the element is defined (and not just inherited), check that |
| 74 |
|
| # it is of the class specified in .element_tree |
| 75 |
3 |
| my $eldef = Chart::GGPlot::Global->element_tree->at($elname); |
| 76 |
|
| |
| 77 |
3 |
| my $eldef_type = $eldef->{type}; |
| 78 |
3 |
▶ | if ( defined $el and not $eldef_type->check($el) ) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (defined $el and not $eldef_type->check($el)) |
0 |
3 |
3 |
Condition33%1/3
defined $el and not $eldef_type->check($el)
MC/DC0%0/2
defined $el and not $eldef_type->check($el)
defined $el
not $eldef_type->check($el)
Truth table33%1/3
A and not(B)
A= defined $elB= not $eldef_type->check($el)
|
| 79 |
0 |
| die( "Invalid element type for '$elname': " |
| 80 |
|
| . $eldef_type->get_message() ); |
| 81 |
|
| } |
| 82 |
|
| |
| 83 |
|
| # Get the names of parents from the inheritance tree |
| 84 |
3 |
| my $pnames = $eldef->{inherit}; |
| 85 |
|
| |
| 86 |
|
| # If no parents, this is a "root" node. Just return this element. |
| 87 |
3 |
▶ | if ( !@$pnames ) { |
Branch: 1 branch
| Branch | True | False | Total |
| unless (@$pnames) |
1 |
2 |
3 |
|
| 88 |
1 |
▶ | my $nullprops = $el->parameters->grep( sub { !defined $el->at($_) } ); |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
|
| 89 |
1 |
▶ | if (@$nullprops) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (@$nullprops) |
0 |
1 |
1 |
|
| 90 |
0 |
| die( sprintf "Theme element '%s' has undef property: %s", |
| 91 |
|
| $elname, join( ", ", @$nullprops ) ); |
| 92 |
|
| } |
| 93 |
1 |
▶ | $log->debug( $message . ' nothing (top level)' ) if $log->is_debug; |
Branch: 1 branch
| Branch | True | False | Total |
| if $Chart::GGPlot::Theme::log->is_debug |
0 |
1 |
1 |
|
| 94 |
1 |
| return $el; |
| 95 |
|
| } |
| 96 |
|
| |
| 97 |
|
| # Calculate the parent objects' inheritance |
| 98 |
2 |
▶ | $log->debug( $message . ' ' . join( ', ', @$pnames ) ) if $log->is_debug; |
Branch: 1 branch
| Branch | True | False | Total |
| if $Chart::GGPlot::Theme::log->is_debug |
0 |
2 |
2 |
|
| 99 |
2 |
▶ | my $parents = $pnames->map( sub { $self->calc_element($_) } ); |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
|
| 100 |
|
| |
| 101 |
2 |
▶ | return reduce { $self->_combine_elements( $a, $b ) } $el, @$parents; |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
|
| 102 |
3 |
| } |
| 103 |
|
| |
| 104 |
|
| # Check that an element object has the proper class |
| 105 |
438 |
▶ | classmethod _validate_element ( $el, $elname ) { |
|
Subroutine
_validate_element: called CC=7 SCAR=20.1
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 3 and Function::Parameters::_croak('Too few arguments for classmethod _validate_element (expected 3, got ' . @_ . ')') |
0 |
438 |
438 |
| @_ > 3 and Function::Parameters::_croak('Too many arguments for classmethod _validate_element (expected 3, got ' . @_ . ')') |
0 |
438 |
438 |
|
| 106 |
438 |
| my $eldef = Chart::GGPlot::Global->element_tree->at($elname); |
| 107 |
438 |
▶ | unless ($eldef) { |
Branch: 1 branch
| Branch | True | False | Total |
| unless ($eldef) |
0 |
438 |
438 |
|
| 108 |
0 |
| die("'$elname' is not a valid theme element name."); |
| 109 |
|
| } |
| 110 |
|
| |
| 111 |
|
| # undef values for elements are OK |
| 112 |
438 |
▶ | return undef unless defined $el; |
Branch: 1 branch
| Branch | True | False | Total |
| unless defined $el |
73 |
365 |
438 |
|
| 113 |
|
| |
| 114 |
365 |
| my $eldef_type = $eldef->{type}; |
| 115 |
365 |
| eval { |
| 116 |
365 |
| ($el) = Type::Params::validate([$el], $eldef_type); |
| 117 |
|
| }; |
| 118 |
365 |
▶ | if ($@) { |
Branch: 1 branch
| Branch | True | False | Total |
| if ($@) |
39 |
326 |
365 |
|
| 119 |
39 |
▶ | unless ($el->$_DOES('Chart::GGPlot::Theme::Element::Blank')) { |
Branch: 1 branch
| Branch | True | False | Total |
| unless ($el->$Chart::GGPlot::Theme::_DOES("Chart::GGPlot::Theme::Element::Blank")) |
0 |
39 |
39 |
|
| 120 |
0 |
| die( "Invalid element type for '$elname': $@" ); |
| 121 |
|
| } |
| 122 |
|
| } |
| 123 |
365 |
| return $el; |
| 124 |
3 |
| } |
| 125 |
|
| |
| 126 |
2 |
▶ | classmethod _combine_elements ($e1, $e2) { |
|
Subroutine
_combine_elements: called CC=11 SCAR=26.1
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 3 and Function::Parameters::_croak('Too few arguments for classmethod _combine_elements (expected 3, got ' . @_ . ')') |
0 |
2 |
2 |
| @_ > 3 and Function::Parameters::_croak('Too many arguments for classmethod _combine_elements (expected 3, got ' . @_ . ')') |
0 |
2 |
2 |
|
| 127 |
2 |
▶ | return $e1 |
Branch: 1 branch
| Branch | True | False | Total |
| if not defined $e2 or $e1->$Chart::GGPlot::Theme::_DOES("Chart::GGPlot::Theme::Element::Blank") |
0 |
2 |
2 |
Condition33%1/3
not defined $e2 or $e1->$Chart::GGPlot::Theme::_DOES("Chart::GGPlot::Theme::Element::Blank")
MC/DC0%0/2
not defined $e2 or $e1->$Chart::GGPlot::Theme::_DOES("Chart::GGPlot::Theme::Element::Blank")
not defined $e2
$e1->$Chart::GGPlot::Theme::_DOES("Chart::GGPlot::Theme::Element::Blank")
Truth table33%1/3
not(A) or B
A= not defined $e2B= $e1->$Chart::GGPlot::Theme::_DOES("Chart::GGPlot::Theme::Element::Blank")
|
| 128 |
|
| if ( !defined $e2 |
| 129 |
|
| or $e1->$_DOES("Chart::GGPlot::Theme::Element::Blank") ); |
| 130 |
2 |
▶ | return $e2 unless defined $e1; |
Branch: 1 branch
| Branch | True | False | Total |
| unless defined $e1 |
0 |
2 |
2 |
|
| 131 |
2 |
▶ | if ( $e2->$_DOES("Chart::GGPlot::Theme::Element::Blank") ) { |
Branch: 1 branch
| Branch | True | False | Total |
| if ($e2->$Chart::GGPlot::Theme::_DOES("Chart::GGPlot::Theme::Element::Blank")) |
0 |
2 |
2 |
|
| 132 |
0 |
▶ | return ( $e1->at('inherit_blank') ? $e2 : $e1 ); |
Branch: 1 branch
| Branch | True | False | Total |
| $e1->at('inherit_blank') ? : |
0 |
0 |
0 |
|
| 133 |
|
| } |
| 134 |
|
| |
| 135 |
2 |
| my $rslt = $e1->clone; |
| 136 |
2 |
| for ( $e2->parameters->flatten ) { |
| 137 |
18 |
▶ | unless ( defined $e1->at($_) ) { |
Branch: 1 branch
| Branch | True | False | Total |
| unless (defined $e1->at($_)) |
13 |
5 |
18 |
|
| 138 |
13 |
| $rslt->set( $_, $e2->at($_) ); |
| 139 |
|
| } |
| 140 |
|
| } |
| 141 |
|
| |
| 142 |
|
| # Calculate relative sizes |
| 143 |
2 |
| my $e1_size = $e1->at('size'); |
| 144 |
2 |
▶ | if ( $e1_size->$_DOES('Chart::GGPlot::Theme::Rel') ) |
Branch: 1 branch
| Branch | True | False | Total |
| if ($e1_size->$Chart::GGPlot::Theme::_DOES("Chart::GGPlot::Theme::Rel")) |
1 |
1 |
2 |
|
| 145 |
|
| { |
| 146 |
1 |
| $rslt->set('size', $e2->at('size') * $e1->at('size') ); |
| 147 |
|
| } |
| 148 |
|
| |
| 149 |
2 |
| return $rslt; |
| 150 |
3 |
| } |
| 151 |
|
| |
| 152 |
|
| |
| 153 |
0 |
▶ | method add_theme (Theme $other) { |
|
Subroutine
add_theme: not called CC=11 SCAR=48.8
Pod
documented
Branch: 3 branches
| Branch | True | False | Total |
| @_ < 2 and Function::Parameters::_croak('Too few arguments for method add_theme (expected 2, got ' . @_ . ')') |
0 |
0 |
0 |
| @_ > 2 and Function::Parameters::_croak('Too many arguments for method add_theme (expected 2, got ' . @_ . ')') |
0 |
0 |
0 |
| Type::Tiny::XS::AUTO::TC9($other) or Function::Parameters::_croak('In method add_theme: parameter 1 ($other): ' . ${my $v = bless( {"_overload_coderef" => sub { package Sub::Defer; use warnings; use strict; $undeferred ||= undefer_sub($deferred_info->[4]); goto \&$undeferred;},"_overload_coderef_no_rebuild" => 1,"_overrides_assert_return" => !!0,"compiled_type_constraint" => sub ;,"constraint" => sub { package Type::Tiny; use warnings; use strict; !0;},"definition_context" => {"file" => "/home/cpancover/.cpan/build/Chart-GGPlot-0.002003-0/blib/lib/Chart/GGPlot/Types.pm","line" => 34,"package" => "Chart::GGPlot::Types"},"deprecated" => !!0,"display_name" => "Theme","exception_class" => "Error::TypeTiny::Assertion","library" => "Chart::GGPlot::Types","name" => "Theme","parent" => bless( {"_default_message" => sub { package Type::Tiny::Class; BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"} use strict; sprintf '%s did not pass type constraint (not isa %s)', Type::Tiny::_dd($_[0]), $c;},"class" => "Chart::GGPlot::Theme","coercion" => bless( {"_compiled_type_constraint_check" => do{my $o},"frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 985,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "InstanceOf[\"Chart::GGPlot::Theme\"]","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Type::Tiny::Class; use warnings; use strict; my $var = $_[1]; return "do { use Scalar::Util (); Scalar::Util::blessed($var) and $var->isa(q[$class]) }" if $Type::Tiny::AvoidCallbacks; return "$xsub($var)" if $xsub; "Scalar::Util::blessed($var) and $var->isa(q[$class])";},"name" => "__ANON__","parent" => bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00\x00"} use strict; Ref::Util::XS::is_blessed_ref($_[0]) or _failed_check(24, 'Object', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Object","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"constraint" => sub { package Types::Standard; no warnings; use strict; builtin::blessed($_);},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 578,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Object","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; !$Type::Tiny::AvoidCallbacks ? "Ref::Util::XS::is_blessed_ref($_[1])" : &$maybe_load_modules('Scalar::Util', "Scalar::Util::blessed($_[1])");},"is_object" => 1,"library" => "Types::Standard","moose_type" => bless( {"Types::TypeTiny::to_TypeTiny" => {},"_default_message" => sub { package Moose::Meta::TypeConstraint; use warnings; use strict; my $value = shift(); my $can_partialdump = &try(sub { require Devel::PartialDump; 'Devel::PartialDump'->VERSION(0.14); 1; } ); if ($can_partialdump) { $value = 'Devel::PartialDump'->new->dump($value); } else { $value = defined $value ? overload::StrVal($value) : 'undef'; } return q[Validation failed for '] . $name . "' with value $value";},"compiled_type_constraint" => sub { package Eval::Closure::Sandbox_58; use warnings; use strict; do { builtin::blessed($_[0]) };},"constraint" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; builtin::blessed($_);},"inline_environment" => {},"inlined" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; 'Scalar::Util::blessed(' . $_[1] . ')';},"name" => "Object","package_defined_in" => "Moose::Util::TypeConstraints::Builtins","parent" => bless( {"Types::TypeTiny::to_TypeTiny" => bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00\x00"} use strict; not ref $_[0] and _failed_check(16, 'Ref', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Ref","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"constraint" => sub { package Types::Standard; no warnings; use strict; ref $_;},"constraint_generator" => sub { package Types::Standard; no warnings; use strict; return $meta->get_type('Ref') unless @_; Type::Tiny::check_parameter_count_for_parameterized_type('Types::Standard', 'Ref', \@_, 1); my $reftype = shift(); $reftype =~ /^(SCALAR|ARRAY|HASH|CODE|REF|GLOB|LVALUE|FORMAT|IO|VSTRING|REGEXP|Regexp)$/i or _croak "Parameter to Ref[`a] expected to be a Perl ref type; got $reftype"; $reftype = "$reftype"; return sub { ref $_[0] and builtin::reftype($_[0]) eq $reftype; } ;},"deep_explanation" => sub { package Types::Standard; no warnings; use strict; require B; my($type, $value, $varname) = @_; my $param = $type->parameters->[0]; return if $type->check($value); my $reftype = builtin::reftype($value); return [sprintf('"%s" constrains reftype(%s) to be equal to %s', $type, $varname, B::perlstring($param)), sprintf('reftype(%s) is %s', $varname, defined $reftype ? B::perlstring($reftype) : 'undef')];},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 438,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Ref","exception_class" => "Error::TypeTiny::Assertion","inline_generator" => sub { package Types::Standard; no warnings; use strict; my $reftype = shift(); return sub { my $v = $_[1]; &$maybe_load_modules('Scalar::Util', "ref($v) and Scalar::Util::reftype($v) eq q($reftype)"); } ;},"inlined" => sub { package Types::Standard; no warnings; use strict; "!!ref($_[1])";},"library" => "Types::Standard","moose_type" => {},"name" => "Ref","parent" => bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00\x00"} use strict; defined $_[0] or _failed_check(7, 'Defined', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Defined","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"complementary_type" => bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00\x00"} use strict; defined $_[0] and _failed_check(6, 'Undef', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Undef","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"complementary_type" => {},"constraint" => sub { package Types::Standard; no warnings; use strict; not defined $_;},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 254,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Undef","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; "!defined($_[1])";},"library" => "Types::Standard","name" => "Undef","parent" => bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00\x00"} use strict; '???'; $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Item","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"constraint" => do{my $o},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 226,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Item","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; '!!1';},"library" => "Types::Standard","name" => "Item","parent" => bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00\x00"} use strict; '???'; $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => do{my $o},"display_name" => "to_Any","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"complement_name" => "None","constraint" => do{my $o},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 220,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Any","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; '!!1';},"library" => "Types::Standard","moose_type" => bless( {"Types::TypeTiny::to_TypeTiny" => {},"_default_message" => sub { package Moose::Meta::TypeConstraint; use warnings; use strict; my $value = shift(); my $can_partialdump = &try(sub { require Devel::PartialDump; 'Devel::PartialDump'->VERSION(0.14); 1; } ); if ($can_partialdump) { $value = 'Devel::PartialDump'->new->dump($value); } else { $value = defined $value ? overload::StrVal($value) : 'undef'; } return q[Validation failed for '] . $name . "' with value $value";},"compiled_type_constraint" => sub { package Eval::Closure::Sandbox_44; use warnings; use strict; do { 1 };},"constraint" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; 1;},"inline_environment" => {},"inlined" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; '1';},"name" => "Any","package_defined_in" => "Moose::Util::TypeConstraints::Builtins"}, 'Moose::Meta::TypeConstraint' ),"name" => "Any","type_default" => sub { package Types::Standard; no warnings; use strict; return undef;},"uniq" => 1}, 'Type::Tiny' ),"uniq" => 2}, 'Type::Tiny' ),"type_default" => sub { package Types::Standard; no warnings; use strict; return undef;},"uniq" => 6}, 'Type::Tiny' ),"constraint" => sub { package Types::Standard; no warnings; use strict; defined $_;},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 262,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Defined","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; "defined($_[1])";},"library" => "Types::Standard","moose_type" => bless( {"Types::TypeTiny::to_TypeTiny" => {},"_default_message" => sub { package Moose::Meta::TypeConstraint; use warnings; use strict; my $value = shift(); my $can_partialdump = &try(sub { require Devel::PartialDump; 'Devel::PartialDump'->VERSION(0.14); 1; } ); if ($can_partialdump) { $value = 'Devel::PartialDump'->new->dump($value); } else { $value = defined $value ? overload::StrVal($value) : 'undef'; } return q[Validation failed for '] . $name . "' with value $value";},"compiled_type_constraint" => sub { package Eval::Closure::Sandbox_47; use warnings; use strict; do { defined $_[0] };},"constraint" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; defined $_;},"inline_environment" => {},"inlined" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; 'defined(' . $_[1] . ')';},"name" => "Defined","package_defined_in" => "Moose::Util::TypeConstraints::Builtins","parent" => bless( {"_default_message" => sub { package Moose::Meta::TypeConstraint; use warnings; use strict; my $value = shift(); my $can_partialdump = &try(sub { require Devel::PartialDump; 'Devel::PartialDump'->VERSION(0.14); 1; } ); if ($can_partialdump) { $value = 'Devel::PartialDump'->new->dump($value); } else { $value = defined $value ? overload::StrVal($value) : 'undef'; } return q[Validation failed for '] . $name . "' with value $value";},"compiled_type_constraint" => sub { package Eval::Closure::Sandbox_45; use warnings; use strict; do { 1 };},"constraint" => sub { package Moose::Meta::TypeConstraint; use warnings; use strict; 1;},"inline_environment" => {},"inlined" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; '1';},"name" => "Item","package_defined_in" => "Moose::Util::TypeConstraints::Builtins","parent" => {}}, 'Moose::Meta::TypeConstraint' )}, 'Moose::Meta::TypeConstraint' ),"name" => "Defined","parent" => {},"uniq" => 7}, 'Type::Tiny' ),"uniq" => 16}, 'Type::Tiny' ),"_default_message" => sub { package Moose::Meta::TypeConstraint; use warnings; use strict; my $value = shift(); my $can_partialdump = &try(sub { require Devel::PartialDump; 'Devel::PartialDump'->VERSION(0.14); 1; } ); if ($can_partialdump) { $value = 'Devel::PartialDump'->new->dump($value); } else { $value = defined $value ? overload::StrVal($value) : 'undef'; } return q[Validation failed for '] . $name . "' with value $value";},"compiled_type_constraint" => sub { package Eval::Closure::Sandbox_50; use warnings; use strict; do { ref $_[0] };},"constraint" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; ref $_;},"inline_environment" => {},"inlined" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; 'ref(' . $_[1] . ')';},"name" => "Ref","package_defined_in" => "Moose::Util::TypeConstraints::Builtins","parent" => {}}, 'Moose::Meta::TypeConstraint' )}, 'Moose::Meta::TypeConstraint' ),"name" => "Object","parent" => {},"uniq" => 24}, 'Type::Tiny' ),"uniq" => 109}, 'Type::Tiny::Class' ),"uniq" => 110}, 'Type::Tiny' );$v->{"parent"}{"coercion"}{"_compiled_type_constraint_check"} = $v->{"compiled_type_constraint"};$v->{"parent"}{"coercion"}{"type_constraint"} = $v->{"parent"};$v->{"parent"}{"compiled_type_constraint"} = $v->{"compiled_type_constraint"};$v->{"parent"}{"parent"}{"coercion"}{"type_constraint"} = $v->{"parent"}{"parent"};$v->{"parent"}{"parent"}{"compiled_type_constraint"} = $v->{"parent"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"parent"}{"parent"}{"moose_type"}{"Types::TypeTiny::to_TypeTiny"} = $v->{"parent"}{"parent"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"coercion"}{"type_constraint"} = $v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"compiled_type_constraint"} = $v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"moose_type"} = $v->{"parent"}{"parent"}{"moose_type"}{"parent"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"coercion"}{"type_constraint"} = $v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"compiled_type_constraint"} = $v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"coercion"}{"type_constraint"} = $v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"compiled_type_constraint"} = $v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"complementary_type"} = $v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"coercion"}{"type_constraint"} = $v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"compiled_type_constraint"} = $v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"constraint"} = $v->{"constraint"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"} = $v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"coercion"}{"type_constraint"} = $v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"compiled_type_constraint"} = $v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"constraint"} = $v->{"constraint"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"moose_type"}{"Types::TypeTiny::to_TypeTiny"} = $v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"Types::TypeTiny::to_TypeTiny"} = $v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"parent"} = $v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"moose_type"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"parent"} = $v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"parent"} = $v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"};$v->{"parent"}{"parent"}{"parent"} = $v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}; \$v}->get_message($other)) |
0 |
0 |
0 |
|
| 154 |
|
| |
| 155 |
|
| # Iterate over the elements that are to be updated |
| 156 |
0 |
| for my $item ( $other->names ) { |
| 157 |
0 |
| my $x = $self->at($item); |
| 158 |
0 |
| my $y = $other->at($item); |
| 159 |
|
| |
| 160 |
0 |
▶ | if ( !defined $x or $x->$_DOES('Chart::GGProt::Theme::Element::Blank') ) |
Branch: 2 branches
| Branch | True | False | Total |
| if (not defined $x or $x->$Chart::GGPlot::Theme::_DOES('Chart::GGProt::Theme::Element::Blank')) { } |
0 |
0 |
0 |
| elsif (not defined $y or $y->$Chart::GGPlot::Theme::_DOES('Chart::GGProt::Theme::Element::Blank') or ref $y) { } |
0 |
0 |
0 |
Condition0%0/3
not defined $x or $x->$Chart::GGPlot::Theme::_DOES("Chart::GGProt::Theme::Element::Blank")
MC/DC0%0/2
not defined $x or $x->$Chart::GGPlot::Theme::_DOES("Chart::GGProt::Theme::Element::Blank")
not defined $x
$x->$Chart::GGPlot::Theme::_DOES("Chart::GGProt::Theme::Element::Blank")
Truth table0%0/3
not(A) or B
A= not defined $xB= $x->$Chart::GGPlot::Theme::_DOES("Chart::GGProt::Theme::Element::Blank")
|
| 161 |
|
| { |
| 162 |
0 |
| $x = $y; |
| 163 |
|
| } |
| 164 |
|
▶ | elsif (!defined $y |
Condition0%0/6
not defined $y or $y->$Chart::GGPlot::Theme::_DOES("Chart::GGProt::Theme::Element::Blank") or ref $y
not defined $y or $y->$Chart::GGPlot::Theme::_DOES("Chart::GGProt::Theme::Element::Blank")
MC/DC0%0/3
not defined $y or $y->$Chart::GGPlot::Theme::_DOES("Chart::GGProt::Theme::Element::Blank") or ref $y
not defined $y
$y->$Chart::GGPlot::Theme::_DOES("Chart::GGProt::Theme::Element::Blank")
ref $y
Truth table0%0/4
not(A) or B or C
A= not defined $yB= $y->$Chart::GGPlot::Theme::_DOES("Chart::GGProt::Theme::Element::Blank")C= ref $y
| A | B | C | result |
| 1 | X | X | 1 |
| 0 | 1 | X | 1 |
| 0 | 0 | 1 | 1 |
| 0 | 0 | 0 | 0 |
|
| 165 |
|
| or $y->$_DOES('Chart::GGProt::Theme::Element::Blank') |
| 166 |
|
| or ref($y) ) |
| 167 |
|
| { |
| 168 |
0 |
| $x = $y; |
| 169 |
|
| } |
| 170 |
|
| else { |
| 171 |
0 |
| $x = $x->merge($y); |
| 172 |
|
| } |
| 173 |
|
| |
| 174 |
|
| # Assign it back to $self |
| 175 |
0 |
| $self->set( $item, $x ); |
| 176 |
|
| } |
| 177 |
|
| |
| 178 |
|
| # If either theme is complete, then the combined theme is complete |
| 179 |
0 |
▶ | $self->{complete} = ( $self->{complete} or $other->{complete} ); |
Condition0%0/3
$self->{'complete'} || $other->{'complete'}
MC/DC0%0/2
$self->{'complete'} || $other->{'complete'}
$self->{'complete'}
$other->{'complete'}
Truth table0%0/3
A || B
A= $self->{'complete'}B= $other->{'complete'}
|
| 180 |
0 |
| return $self; |
| 181 |
3 |
| } |
| 182 |
|
| |
| 183 |
9 |
▶ | method replace (Theme $other) { |
|
Subroutine
replace: called CC=5 SCAR=16.4
Pod
undocumented
Branch: 3 branches
| Branch | True | False | Total |
| @_ < 2 and Function::Parameters::_croak('Too few arguments for method replace (expected 2, got ' . @_ . ')') |
0 |
9 |
9 |
| @_ > 2 and Function::Parameters::_croak('Too many arguments for method replace (expected 2, got ' . @_ . ')') |
0 |
9 |
9 |
| Type::Tiny::XS::AUTO::TC9($other) or Function::Parameters::_croak('In method replace: parameter 1 ($other): ' . ${my $v = bless( {"_overload_coderef" => sub { package Sub::Defer; use warnings; use strict; $undeferred ||= undefer_sub($deferred_info->[4]); goto \&$undeferred;},"_overload_coderef_no_rebuild" => 1,"_overrides_assert_return" => !!0,"compiled_type_constraint" => sub ;,"constraint" => sub { package Type::Tiny; use warnings; use strict; !0;},"definition_context" => {"file" => "/home/cpancover/.cpan/build/Chart-GGPlot-0.002003-0/blib/lib/Chart/GGPlot/Types.pm","line" => 34,"package" => "Chart::GGPlot::Types"},"deprecated" => !!0,"display_name" => "Theme","exception_class" => "Error::TypeTiny::Assertion","library" => "Chart::GGPlot::Types","name" => "Theme","parent" => bless( {"_default_message" => sub { package Type::Tiny::Class; BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"} use strict; sprintf '%s did not pass type constraint (not isa %s)', Type::Tiny::_dd($_[0]), $c;},"class" => "Chart::GGPlot::Theme","coercion" => bless( {"_compiled_type_constraint_check" => do{my $o},"frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 985,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "InstanceOf[\"Chart::GGPlot::Theme\"]","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Type::Tiny::Class; use warnings; use strict; my $var = $_[1]; return "do { use Scalar::Util (); Scalar::Util::blessed($var) and $var->isa(q[$class]) }" if $Type::Tiny::AvoidCallbacks; return "$xsub($var)" if $xsub; "Scalar::Util::blessed($var) and $var->isa(q[$class])";},"name" => "__ANON__","parent" => bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00\x00"} use strict; Ref::Util::XS::is_blessed_ref($_[0]) or _failed_check(24, 'Object', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Object","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"constraint" => sub { package Types::Standard; no warnings; use strict; builtin::blessed($_);},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 578,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Object","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; !$Type::Tiny::AvoidCallbacks ? "Ref::Util::XS::is_blessed_ref($_[1])" : &$maybe_load_modules('Scalar::Util', "Scalar::Util::blessed($_[1])");},"is_object" => 1,"library" => "Types::Standard","moose_type" => bless( {"Types::TypeTiny::to_TypeTiny" => {},"_default_message" => sub { package Moose::Meta::TypeConstraint; use warnings; use strict; my $value = shift(); my $can_partialdump = &try(sub { require Devel::PartialDump; 'Devel::PartialDump'->VERSION(0.14); 1; } ); if ($can_partialdump) { $value = 'Devel::PartialDump'->new->dump($value); } else { $value = defined $value ? overload::StrVal($value) : 'undef'; } return q[Validation failed for '] . $name . "' with value $value";},"compiled_type_constraint" => sub { package Eval::Closure::Sandbox_58; use warnings; use strict; do { builtin::blessed($_[0]) };},"constraint" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; builtin::blessed($_);},"inline_environment" => {},"inlined" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; 'Scalar::Util::blessed(' . $_[1] . ')';},"name" => "Object","package_defined_in" => "Moose::Util::TypeConstraints::Builtins","parent" => bless( {"Types::TypeTiny::to_TypeTiny" => bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00\x00"} use strict; not ref $_[0] and _failed_check(16, 'Ref', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Ref","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"constraint" => sub { package Types::Standard; no warnings; use strict; ref $_;},"constraint_generator" => sub { package Types::Standard; no warnings; use strict; return $meta->get_type('Ref') unless @_; Type::Tiny::check_parameter_count_for_parameterized_type('Types::Standard', 'Ref', \@_, 1); my $reftype = shift(); $reftype =~ /^(SCALAR|ARRAY|HASH|CODE|REF|GLOB|LVALUE|FORMAT|IO|VSTRING|REGEXP|Regexp)$/i or _croak "Parameter to Ref[`a] expected to be a Perl ref type; got $reftype"; $reftype = "$reftype"; return sub { ref $_[0] and builtin::reftype($_[0]) eq $reftype; } ;},"deep_explanation" => sub { package Types::Standard; no warnings; use strict; require B; my($type, $value, $varname) = @_; my $param = $type->parameters->[0]; return if $type->check($value); my $reftype = builtin::reftype($value); return [sprintf('"%s" constrains reftype(%s) to be equal to %s', $type, $varname, B::perlstring($param)), sprintf('reftype(%s) is %s', $varname, defined $reftype ? B::perlstring($reftype) : 'undef')];},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 438,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Ref","exception_class" => "Error::TypeTiny::Assertion","inline_generator" => sub { package Types::Standard; no warnings; use strict; my $reftype = shift(); return sub { my $v = $_[1]; &$maybe_load_modules('Scalar::Util', "ref($v) and Scalar::Util::reftype($v) eq q($reftype)"); } ;},"inlined" => sub { package Types::Standard; no warnings; use strict; "!!ref($_[1])";},"library" => "Types::Standard","moose_type" => {},"name" => "Ref","parent" => bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00\x00"} use strict; defined $_[0] or _failed_check(7, 'Defined', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Defined","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"complementary_type" => bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00\x00"} use strict; defined $_[0] and _failed_check(6, 'Undef', $_[0], 'exception_class', 'Error::TypeTiny::Assertion'); $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Undef","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"complementary_type" => {},"constraint" => sub { package Types::Standard; no warnings; use strict; not defined $_;},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 254,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Undef","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; "!defined($_[1])";},"library" => "Types::Standard","name" => "Undef","parent" => bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00\x00"} use strict; '???'; $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => sub ;,"display_name" => "to_Item","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"constraint" => do{my $o},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 226,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Item","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; '!!1';},"library" => "Types::Standard","name" => "Item","parent" => bless( {"_is_core" => 1,"_overload_coderef" => sub { package Type::Tiny; BEGIN {${^WARNING_BITS} = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x05\x45\x55\x15\x55\x55\x01\x00\x00"} use strict; '???'; $_[0];},"_overrides_assert_return" => !!0,"coercion" => bless( {"_compiled_type_constraint_check" => do{my $o},"display_name" => "to_Any","frozen" => 1,"name" => "__ANON__","type_coercion_map" => [],"type_constraint" => {}}, 'Type::Coercion' ),"compiled_type_constraint" => do{my $o},"complement_name" => "None","constraint" => do{my $o},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 220,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Any","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; '!!1';},"library" => "Types::Standard","moose_type" => bless( {"Types::TypeTiny::to_TypeTiny" => {},"_default_message" => sub { package Moose::Meta::TypeConstraint; use warnings; use strict; my $value = shift(); my $can_partialdump = &try(sub { require Devel::PartialDump; 'Devel::PartialDump'->VERSION(0.14); 1; } ); if ($can_partialdump) { $value = 'Devel::PartialDump'->new->dump($value); } else { $value = defined $value ? overload::StrVal($value) : 'undef'; } return q[Validation failed for '] . $name . "' with value $value";},"compiled_type_constraint" => sub { package Eval::Closure::Sandbox_44; use warnings; use strict; do { 1 };},"constraint" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; 1;},"inline_environment" => {},"inlined" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; '1';},"name" => "Any","package_defined_in" => "Moose::Util::TypeConstraints::Builtins"}, 'Moose::Meta::TypeConstraint' ),"name" => "Any","type_default" => sub { package Types::Standard; no warnings; use strict; return undef;},"uniq" => 1}, 'Type::Tiny' ),"uniq" => 2}, 'Type::Tiny' ),"type_default" => sub { package Types::Standard; no warnings; use strict; return undef;},"uniq" => 6}, 'Type::Tiny' ),"constraint" => sub { package Types::Standard; no warnings; use strict; defined $_;},"definition_context" => {"file" => "/usr/local/lib/perl5/site_perl/5.44.0/Types/Standard.pm","line" => 262,"package" => "Types::Standard"},"deprecated" => !!0,"display_name" => "Defined","exception_class" => "Error::TypeTiny::Assertion","inlined" => sub { package Types::Standard; no warnings; use strict; "defined($_[1])";},"library" => "Types::Standard","moose_type" => bless( {"Types::TypeTiny::to_TypeTiny" => {},"_default_message" => sub { package Moose::Meta::TypeConstraint; use warnings; use strict; my $value = shift(); my $can_partialdump = &try(sub { require Devel::PartialDump; 'Devel::PartialDump'->VERSION(0.14); 1; } ); if ($can_partialdump) { $value = 'Devel::PartialDump'->new->dump($value); } else { $value = defined $value ? overload::StrVal($value) : 'undef'; } return q[Validation failed for '] . $name . "' with value $value";},"compiled_type_constraint" => sub { package Eval::Closure::Sandbox_47; use warnings; use strict; do { defined $_[0] };},"constraint" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; defined $_;},"inline_environment" => {},"inlined" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; 'defined(' . $_[1] . ')';},"name" => "Defined","package_defined_in" => "Moose::Util::TypeConstraints::Builtins","parent" => bless( {"_default_message" => sub { package Moose::Meta::TypeConstraint; use warnings; use strict; my $value = shift(); my $can_partialdump = &try(sub { require Devel::PartialDump; 'Devel::PartialDump'->VERSION(0.14); 1; } ); if ($can_partialdump) { $value = 'Devel::PartialDump'->new->dump($value); } else { $value = defined $value ? overload::StrVal($value) : 'undef'; } return q[Validation failed for '] . $name . "' with value $value";},"compiled_type_constraint" => sub { package Eval::Closure::Sandbox_45; use warnings; use strict; do { 1 };},"constraint" => sub { package Moose::Meta::TypeConstraint; use warnings; use strict; 1;},"inline_environment" => {},"inlined" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; '1';},"name" => "Item","package_defined_in" => "Moose::Util::TypeConstraints::Builtins","parent" => {}}, 'Moose::Meta::TypeConstraint' )}, 'Moose::Meta::TypeConstraint' ),"name" => "Defined","parent" => {},"uniq" => 7}, 'Type::Tiny' ),"uniq" => 16}, 'Type::Tiny' ),"_default_message" => sub { package Moose::Meta::TypeConstraint; use warnings; use strict; my $value = shift(); my $can_partialdump = &try(sub { require Devel::PartialDump; 'Devel::PartialDump'->VERSION(0.14); 1; } ); if ($can_partialdump) { $value = 'Devel::PartialDump'->new->dump($value); } else { $value = defined $value ? overload::StrVal($value) : 'undef'; } return q[Validation failed for '] . $name . "' with value $value";},"compiled_type_constraint" => sub { package Eval::Closure::Sandbox_50; use warnings; use strict; do { ref $_[0] };},"constraint" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; ref $_;},"inline_environment" => {},"inlined" => sub { package Moose::Util::TypeConstraints::Builtins; use warnings; use strict; 'ref(' . $_[1] . ')';},"name" => "Ref","package_defined_in" => "Moose::Util::TypeConstraints::Builtins","parent" => {}}, 'Moose::Meta::TypeConstraint' )}, 'Moose::Meta::TypeConstraint' ),"name" => "Object","parent" => {},"uniq" => 24}, 'Type::Tiny' ),"uniq" => 109}, 'Type::Tiny::Class' ),"uniq" => 110}, 'Type::Tiny' );$v->{"parent"}{"coercion"}{"_compiled_type_constraint_check"} = $v->{"compiled_type_constraint"};$v->{"parent"}{"coercion"}{"type_constraint"} = $v->{"parent"};$v->{"parent"}{"compiled_type_constraint"} = $v->{"compiled_type_constraint"};$v->{"parent"}{"parent"}{"coercion"}{"type_constraint"} = $v->{"parent"}{"parent"};$v->{"parent"}{"parent"}{"compiled_type_constraint"} = $v->{"parent"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"parent"}{"parent"}{"moose_type"}{"Types::TypeTiny::to_TypeTiny"} = $v->{"parent"}{"parent"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"coercion"}{"type_constraint"} = $v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"compiled_type_constraint"} = $v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"moose_type"} = $v->{"parent"}{"parent"}{"moose_type"}{"parent"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"coercion"}{"type_constraint"} = $v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"compiled_type_constraint"} = $v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"coercion"}{"type_constraint"} = $v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"compiled_type_constraint"} = $v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"complementary_type"} = $v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"coercion"}{"type_constraint"} = $v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"compiled_type_constraint"} = $v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"constraint"} = $v->{"constraint"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"} = $v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"coercion"}{"type_constraint"} = $v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"compiled_type_constraint"} = $v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"coercion"}{"_compiled_type_constraint_check"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"constraint"} = $v->{"constraint"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"moose_type"}{"Types::TypeTiny::to_TypeTiny"} = $v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"Types::TypeTiny::to_TypeTiny"} = $v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"}{"parent"}{"parent"} = $v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"}{"parent"}{"moose_type"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"parent"} = $v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"complementary_type"}{"parent"};$v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"parent"} = $v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}{"parent"}{"moose_type"};$v->{"parent"}{"parent"}{"parent"} = $v->{"parent"}{"parent"}{"moose_type"}{"parent"}{"Types::TypeTiny::to_TypeTiny"}; \$v}->get_message($other)) |
9 |
0 |
9 |
|
| 184 |
9 |
| my $new = $self->clone; |
| 185 |
9 |
| for my $elname ( $other->names->flatten ) { |
| 186 |
62 |
| $new->set( $elname, $other->at($elname) ); |
| 187 |
|
| } |
| 188 |
9 |
| $new->{complete} = $other->{complete}; |
| 189 |
9 |
| return $new; |
| 190 |
3 |
| } |
| 191 |
|
| |
| 192 |
|
| |
| 193 |
0 |
▶ | method string () { |
|
Subroutine
string: not called CC=3 SCAR=24.8
Pod
documented
Branch: 2 branches
| Branch | True | False | Total |
| @_ < 1 and Function::Parameters::_croak('Too few arguments for method string (expected 1, got ' . @_ . ')') |
0 |
0 |
0 |
| @_ > 1 and Function::Parameters::_croak('Too many arguments for method string (expected 1, got ' . @_ . ')') |
0 |
0 |
0 |
|
| 194 |
0 |
| return Dumper( $self->elements ); |
| 195 |
3 |
| } |
| 196 |
|
| |
| 197 |
3 |
| 1; |
| 198 |
|
| |
| 199 |
|
| __END__ |