| 1 | package Net::FreeIPA::Base; | ||||||||||||||||||||
| 2 | 6 | $Net::FreeIPA::Base::VERSION = '3.0.3'; | |||||||||||||||||||
| 3 | 6 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 6 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | |||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | =head1 NAME | ||||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | Net::FreeIPA::Base provides basic class structure for Net::FreeIPA | ||||||||||||||||||||
| 10 | |||||||||||||||||||||
| 11 | =head2 Public methods | ||||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | =over | ||||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | =item new | ||||||||||||||||||||
| 16 | |||||||||||||||||||||
| 17 | =cut | ||||||||||||||||||||
| 18 | |||||||||||||||||||||
| 19 | sub new | ||||||||||||||||||||
| 20 | 0 | ▶ | { | ||||||||||||||||||
|
Subroutine
new: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 21 | 0 | my $this = shift; | |||||||||||||||||||
| 22 | 0 | ▶ | my $class = ref($this) || $this; | ||||||||||||||||||
|
Condition0%0/3
ref $this || $this
MC/DC0%0/2
ref $this || $this
ref $this
$this
Truth table0%0/3
A || B
A= ref $thisB= $this
| |||||||||||||||||||||
| 23 | 0 | my $self = {}; # here, it gives a reference on a hash | |||||||||||||||||||
| 24 | 0 | bless $self, $class; | |||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | 0 | ▶ | return $self->_initialize(@_) ? $self : undef; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 27 | }; | ||||||||||||||||||||
| 28 | |||||||||||||||||||||
| 29 | =item error, warn, info, debug | ||||||||||||||||||||
| 30 | |||||||||||||||||||||
| 31 | Convenience methods to access the log instance that might | ||||||||||||||||||||
| 32 | be passed during initialisation and set to $self->{log}. | ||||||||||||||||||||
| 33 | |||||||||||||||||||||
| 34 | =cut | ||||||||||||||||||||
| 35 | |||||||||||||||||||||
| 36 | 6 | ▶ | no strict 'refs'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 37 | 6 | foreach my $i (qw(error warn info debug)) { | |||||||||||||||||||
| 38 | 24 | ▶ | *{$i} = sub { | ||||||||||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=15.1
| |||||||||||||||||||||
| 39 | 0 | my ($self, @args) = @_; | |||||||||||||||||||
| 40 | 0 | ▶ | if ($self->{log}) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 41 | 0 | return $self->{log}->$i(@args); | |||||||||||||||||||
| 42 | } else { | ||||||||||||||||||||
| 43 | 0 | return; | |||||||||||||||||||
| 44 | } | ||||||||||||||||||||
| 45 | } | ||||||||||||||||||||
| 46 | 24 | } | |||||||||||||||||||
| 47 | 6 | ▶ | use strict 'refs'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 48 | |||||||||||||||||||||
| 49 | =pod | ||||||||||||||||||||
| 50 | |||||||||||||||||||||
| 51 | =back | ||||||||||||||||||||
| 52 | |||||||||||||||||||||
| 53 | =cut | ||||||||||||||||||||
| 54 | |||||||||||||||||||||
| 55 | 6 | 1; | |||||||||||||||||||