lib/WebService/Braintree/TransactionLineItemGateway.pm

filter: Statementstmt 76.6% 23 / 30 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 87.5% 7 / 8 Podpod 0.0% 0 / 1 totaltotal 65.2% 30 / 46 CC 4 SCAR 20.7
CC
4
Cov
64%
find_all
20.0
BEGIN
1.0
BEGIN
1.0
CRAP 7.9
« lib/WebService/Braintree/TransactionGateway.pm ↑ Summary lib/WebService/Braintree/PaymentMethodGateway.pm »
1 # vim: sw=4 ts=4 ft=perl
2  
3 package # hide from pause
4 WebService::Braintree::TransactionLineItemGateway;
5  
6 22 ▶use 5.010_001;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 22 ▶use strictures 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 22 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 22 with 'WebService::Braintree::Role::MakeRequest';
11  
12 22 ▶use Carp qw(confess);
Subroutine BEGIN: called CC=1 SCAR=0.0
13 22 ▶use Scalar::Util qw(blessed);
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 22 ▶use WebService::Braintree::Util qw(validate_id);
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 22 ▶use WebService::Braintree::_::TransactionLineItem;
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 0 ▶sub find_all {
Subroutine find_all: not called CC=4 SCAR=30.0
Pod undocumented
20 0 my ($self, $id) = @_;
21 0 ▶ confess "NotFoundError" unless validate_id($id);
Branch: 1 branch
BranchTrueFalseTotal
unless validate_id($id) 0 0 0
22 0 my $response = $self->_make_raw_request(
23 "/transactions/${id}/line_items", 'get', undef,
24 );
25 0 ▶ return $response if blessed($response);
Branch: 1 branch
BranchTrueFalseTotal
if builtin::blessed($response) 0 0 0
26 return (
27 map {
28 0 WebService::Braintree::_::TransactionLineItem->new($_);
29 0 ▶ } @{$response->{line_items} // []}
Condition0%0/2
$response->{"line_items"} // []
l!l
00
MC/DC0%0/1
$response->{"line_items"} // []
$response->{"line_items"}
Truth table0%0/2
A
A= $response->{"line_items"}
Aresult
11
00
30 );
31 }
32  
33 22 __PACKAGE__->meta->make_immutable;
34  
35 22 1;
36 __END__
« lib/WebService/Braintree/TransactionGateway.pm ↑ Summary lib/WebService/Braintree/PaymentMethodGateway.pm »