Branch Coverage

blib/lib/Beam/Wire.pm
Criterion Covered Total %
branch 155 188 82.4


line true false branch
139 5 27 unless $self->file
226 39 284 if (index($name, "/") != -1)
232 4 35 if (ref $container eq "HASH" and not builtin::blessed($container) && $container->isa('Beam::Wire'))
243 4 280 if (keys %override)
252 174 106 unless ($service)
256 2 172 unless ($config_ref)
265 156 16 if (ref $config_ref eq 'HASH' and $self->is_meta($config_ref, 1)) { }
268 141 5 if (not $config{'lifecycle'} or lc $config{'lifecycle'} ne "factory")
328 1 1 if ($name =~ m[/])
348 4 232 if ($name =~ m[/])
391 178 23 unless grep {$meta{$_};} keys %$conf
395 30 9 if ($meta{$key}) { }
544 0 173 if (@other > 1)
552 6 167 if (@classy and @other)
560 2 165 if (exists $service_info{'value'})
564 2 163 if (exists $service_info{'env'})
565 1 1 exists $ENV{$service_info{'env'}} ? :
568 1 162 if (exists $service_info{'ref'})
577 9 153 if ($service_info{'config'})
579 5 4 unless ($conf_path->is_absolute)
582 1 8 if ($service_info{'default'} and not $conf_path && $conf_path->is_file)
588 2 151 unless ($service_info{'class'})
602 2 149 $service_info{'version'} ? :
604 4 146 if (my $with = $service_info{'with'})
605 2 2 ref $with ? :
612 2 148 if (ref $method eq 'ARRAY') { }
618 2 2 defined $service ? :
620 3 1 !defined($service) || $return eq 'chain' ? :
626 4 144 if ($service_info{'class'}->can("DOES") and $service_info{'class'}->DOES("Beam::Service"))
632 7 140 if ($service_info{'on'})
636 1 6 if (ref $service_info{'on'} eq 'ARRAY') { }
6 0 elsif (ref $service_info{'on'} eq 'HASH') { }
641 1 5 if (ref $service_info{'on'}{$event} eq 'ARRAY') { }
654 1 8 if ($$conf{$meta{'method'}} and not $$conf{$meta{'sub'}})
692 38 177 if ($service_info{'extends'})
694 3 35 unless ($base_config_ref)
703 8 27 if (ref $service_info{'args'} eq 'HASH' and ref $base_config{'args'} eq 'HASH') { }
1 26 elsif (ref $service_info{'args'} eq 'ARRAY' and @{$service_info{'args'};} == 1 and ref $service_info{'args'}[0] eq 'HASH' and ref $base_config{'args'} eq 'ARRAY' and @{$base_config{'args'};} == 1 and ref $base_config{'args'}[0] eq 'HASH') { }
710 9 26 if ($args)
748 30 122 unless $args
750 22 100 if (ref $args eq 'ARRAY') { }
95 5 elsif (ref $args eq 'HASH') { }
756 16 79 if ($class->isa('Beam::Wire')) { }
763 9 7 if (exists $args{'file'} and not path($args{'file'})->is_absolute)
767 2 11 if (exists $args{'file'} and not $args{'file'} && path($args{'file'})->is_file and $fallback)
772 2 14 if ($config)
778 0 79 if (builtin::blessed($maybe_ref)) { }
782 0 0 ref $maybe_ref eq 'ARRAY' ? :
79 0 ref $maybe_ref eq 'HASH' ? :
822 146 310 if (ref $arg eq 'HASH') { }
29 281 elsif (ref $arg eq 'ARRAY') { }
823 46 100 if ($self->is_meta($arg)) { }
824 36 10 if ($$arg{$meta{'ref'}}) { }
847 268 16 wantarray ? :
873 0 334 unless ref $arg eq "HASH"
876 3 331 unless @keys
882 153 178 if $root and scalar @keys eq grep({$meta{$_};} @keys)
889 66 112 if grep {exists $arg->{$_};} map({$meta{$_};} "ref", "class", "extends", "config", "value", "env")
926 1004 0 wantarray ? :
1001 0 37 if (my $path = $$arg{$meta{'path'}}) { }
4 33 elsif (my $call = $$arg{$meta{'call'}}) { }
3 30 elsif (my $method = $$arg{$meta{'method'}}) { }
1012 2 2 if (ref $call eq 'HASH') { }
1016 1 1 ref $args eq 'ARRAY' ? :
0 2 !$args ? :
1029 1 1 ref $args eq 'ARRAY' ? :
1 2 !$args ? :
1060 9 13 if (ref $arg eq 'HASH') { }
3 10 elsif (ref $arg eq 'ARRAY') { }
1061 6 3 if ($self->is_meta($arg, 1)) { }
1065 3 7 if ($key =~ /(?:ref|extends)$/) { }
1101 3 124 if ($self->file and not path($self->file)->exists)
1113 203 10 if (ref $config eq "HASH")
1115 1 202 if ($lifecycle and $lifecycle eq "eager")
1126 0 4 if $deprecated_warnings{$warning}
1141 1 34 if ($@)
1148 34 0 'HASH' eq ref $loader ? :
1156 0 11 !(builtin::blessed($dir) && $dir->isa('Path::Tiny')) ? :
1157 9 2 if ($dir->child($file)->exists)
1176 0 5 if ($instantiate)
1177 0 0 if ($show_all_errors) { }
1181 0 0 if $@
1195 0 4 if (@other > 1)
1199 0 0 if ($show_all_errors)
1211 3 1 if (@classy and @other)
1215 0 3 if ($show_all_errors)
1227 0 1 if (exists $config{'value'} and exists $config{'class'} || exists $config{'extends'})
1229 0 0 if ($show_all_errors)
1241 0 1 if ($config{'config'})
1243 0 0 if ($self->file)
1249 0 0 unless ($config{'value'} or $config{'class'} or $config{'extends'} or $config{'ref'})
1253 0 1 if ($config{'class'})
1254 0 0 if $config{'class'}
1396 1 6 $file ? :