Lite/RelyingParty/Associator.pm

filter: Statementstmt 66.6% 4 / 6 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 75.0% 6 / 8 CC 1 SCAR 1.4
CC
1
Cov
67%
BEGIN
1.3
BEGIN
1.0
CRAP 1.1
« Lite/RelyingParty/Discover/Method/Yadis.pm ↑ Summary Lite/SessionHandler/DH.pm »
1 package OpenID::Lite::RelyingParty::Associator;
2  
3 1 ▶use Any::Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 with 'OpenID::Lite::Role::ErrorHandler';
5 with 'OpenID::Lite::Role::AgentHandler';
6 with 'OpenID::Lite::Role::Associator';
7  
8 0 ▶use OpenID::Lite::SessionHandlers;
Subroutine BEGIN: called CC=1 SCAR=2.6
9 use OpenID::Lite::RelyingParty::Associator::Base;
10 use Carp ();
11  
12 sub associate {
13 my ( $self, $service ) = @_;
14  
15 my $associator = $self->create_method_for( $self->session_type );
16 my $association = $associator->associate($service)
17 or return $self->ERROR( $associator->errstr );
18 return $association;
19 }
20  
21 # factory method
22 sub create_method_for {
23 my ( $self, $type ) = @_;
24 my $session = OpenID::Lite::SessionHandlers->select_session($type);
25 Carp::croak "invalid session type" unless $session;
26 my $associator = OpenID::Lite::RelyingParty::Associator::Base->new(
27 agent => $self->agent,
28 assoc_type => $self->assoc_type,
29 session => $session,
30 );
31 return $associator;
32 }
33  
34 no Any::Moose;
35 __PACKAGE__->meta->make_immutable;
36 1;
37  
« Lite/RelyingParty/Discover/Method/Yadis.pm ↑ Summary Lite/SessionHandler/DH.pm »