blib/lib/WWW/JSON/Role/Authentication/OAuth2.pm

filter: Statementstmt 69.2% 9 / 13 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 2 / 4 Podpod n/a totaltotal 57.8% 11 / 19 SCAR 8.1
CC
2
Cov
60%
_validate_OAuth2
6.0
_auth_OAuth2
2.0
BEGIN
1.0
CRAP 2.3
« blib/lib/WWW/JSON/Role/Authentication/Header.pm ↑ Summary _build/lib/MyBuilder.pm »
1 package WWW::JSON::Role::Authentication::OAuth2;
2 8 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 8 ▶use Safe::Isa;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 8 requires 'authentication';
5 8 requires 'ua';
6  
7 sub _validate_OAuth2 {
8 0 ▶ my ( $self, $auth ) = @_;
Subroutine _validate_OAuth2: not called CC=2 SCAR=17.9
9 0 ▶ die "Must pass a Net::OAuth2::AccessToken object when using "
Branch: 1 branch
BranchTrueFalseTotal
unless $auth->$WWW::JSON::Role::Authentication::OAuth2::_isa("Net::OAuth2::AccessToken") 0 0 0
10 . __PACKAGE__
11 . " authentication."
12 unless $auth->$_isa('Net::OAuth2::AccessToken');
13 }
14  
15 sub _auth_OAuth2 {
16 0 ▶ my ( $self, $auth, $req ) = @_;
Subroutine _auth_OAuth2: not called CC=1 SCAR=6.9
17 0 $req->header( Authorization => 'Bearer ' . $auth->access_token );
18 }
19  
20 8 1;
« blib/lib/WWW/JSON/Role/Authentication/Header.pm ↑ Summary _build/lib/MyBuilder.pm »