blib/lib/Iterator/Flex/Role/Exhaustion/Throw.pm

filter: Statementstmt 100% 30 / 30 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod 100% 1 / 1 totaltotal 97.6% 41 / 42 CC 2 SCAR 1.8
CC
2
Cov
97%
signal_exhaustion
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« blib/lib/Iterator/Flex/Role/Wrap/Self.pm ↑ Summary blib/lib/Iterator/Flex/Method.pm »
1 package Iterator::Flex::Role::Exhaustion::Throw;
2  
3 # ABSTRACT: signal exhaustion by setting exhausted flag and throwing;
4  
5 17 ▶use v5.28;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 17 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 17 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 17 our $VERSION = '0.33';
10  
11 17 ▶use Ref::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 17 ▶use Iterator::Flex::Utils qw( :default REG_GENERAL REG_GP_EXHAUSTION );
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 17 ▶use Role::Tiny;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 17 ▶use experimental 'signatures';
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 17 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29 ▶sub signal_exhaustion ( $self, @ ) {
Subroutine signal_exhaustion: called CC=2 SCAR=7.0
Pod documented
30 93 $self->set_exhausted;
31  
32 93 my $exception = $REGISTRY{ refaddr $self }[REG_GENERAL][REG_GP_EXHAUSTION][1];
33  
34 93 ▶ $exception->() if Ref::Util::is_coderef( $exception );
Branch: 1 branch
BranchTrueFalseTotal
if Ref::Util::XS::is_coderef($exception) 0 93 93
35  
36 93 require Iterator::Flex::Failure;
37 93 Iterator::Flex::Failure::Exhausted->throw;
38 }
39  
40  
41 17 1;
42  
43 #
44 # This file is part of Iterator-Flex
45 #
46 # This software is Copyright (c) 2018 by Smithsonian Astrophysical Observatory.
47 #
48 # This is free software, licensed under:
49 #
50 # The GNU General Public License, Version 3, June 2007
51 #
52  
53 __END__
« blib/lib/Iterator/Flex/Role/Wrap/Self.pm ↑ Summary blib/lib/Iterator/Flex/Method.pm »