Auth/Base.pm untested

filter: Statementstmt 0.0% 0 / 18 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 38 CC 5 SCAR 24.8
CC
5
Cov
0%
error
20.0
new
6.0
_init
2.0
CRAP 12.0
1 # WWW::Auth::Base
2 #
3 # Copyright (c) 2002 Jonathan A. Waxman <jowaxman@law.upenn.edu>
4 # All rights reserved.
5 #
6 # This program is free software; you can redistribute it and/or
7 # modify it under the same terms as Perl itself.
8  
9  
10 package WWW::Auth::Base;
11  
12  
13 use strict;
14  
15  
16 sub new {
17 my $proto = shift;
18 my %params = @_;
19  
20 my $class = ref ($proto) || $proto;
21 my $self = {};
22 bless ($self, $class);
23  
24 return $self->_init (%params) ? $self : $proto->error ($self->error);
25 }
26  
27 sub _init {
28 my $self = shift;
29 my %params = @_;
30  
31 return 1;
32 }
33  
34 sub error {
35 my $self = shift;
36 my $error = shift;
37  
38 # If an error given, set it in the object or package.
39 # Otherwise, return the error from the object or package.
40 if (defined $error) {
41 ref ($self) ? $self->{_error} = $error : $self::_error = $error;
42 return undef;
43 } else {
44 return ref ($self) ? $self->{_error} : $self::_error;
45 }
46 }
47  
48  
49 1;