| 1 | package DJabberd::Delivery; | ||||||||||
| 2 | 20 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 20 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 20 | ▶ | use base 'DJabberd::Plugin'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 20 | ▶ | use Scalar::Util; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 0 | ▶ | sub finalize { | ||||||||
|
Subroutine
finalize: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 9 | 0 | my ($self) = @_; | |||||||||
| 10 | 0 | $self->{vhost} = undef; | |||||||||
| 11 | 0 | $self->SUPER::finalize(); | |||||||||
| 12 | } | ||||||||||
| 13 | |||||||||||
| 14 | 85 | ▶ | sub register { | ||||||||
|
Subroutine
register: called CC=1 SCAR=0.2
Pod
undocumented
| |||||||||||
| 15 | 85 | my ($self, $vhost) = @_; | |||||||||
| 16 | 85 | $self->set_vhost($vhost); | |||||||||
| 17 | 0 | ▶ | $vhost->register_hook("deliver", sub { $self->deliver(@_) }); | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||
| 18 | } | ||||||||||
| 19 | |||||||||||
| 20 | 0 | ▶ | sub vhost { | ||||||||
|
Subroutine
vhost: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 21 | 0 | return $_[0]->{vhost}; | |||||||||
| 22 | } | ||||||||||
| 23 | |||||||||||
| 24 | 85 | ▶ | sub set_vhost { | ||||||||
|
Subroutine
set_vhost: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||
| 25 | 85 | my ($self, $vhost) = @_; | |||||||||
| 26 | 85 | ▶ | Carp::croak("Not a vhost: '$vhost'") unless UNIVERSAL::isa($vhost, "DJabberd::VHost"); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 27 | 85 | $self->{vhost} = $vhost; | |||||||||
| 28 | 85 | Scalar::Util::weaken($self->{vhost}); | |||||||||
| 29 | } | ||||||||||
| 30 | |||||||||||
| 31 | 20 | 1; | |||||||||