| 1 | package DJabberd::Plugin::PrivateStorage::InMemoryOnly; | ||||||||||||
| 2 | 3 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 3 | 3 | ▶ | use base 'DJabberd::Plugin::PrivateStorage'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 3 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | |||||||||||||
| 6 | =head2 load_privatestorage($self, $user, $element) | ||||||||||||
| 7 | |||||||||||||
| 8 | Load the element $element for $user from memory. | ||||||||||||
| 9 | |||||||||||||
| 10 | =cut | ||||||||||||
| 11 | |||||||||||||
| 12 | |||||||||||||
| 13 | 0 | ▶ | sub load_privatestorage { | ||||||||||
|
Subroutine
load_privatestorage: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||
| 14 | 0 | my ($self, $user, $element) = @_; | |||||||||||
| 15 | 0 | ▶ | $self->{private_storage} ||= {}; | ||||||||||
|
Condition0%0/2
$self->{"private_storage"} ||= {}
MC/DC0%0/1
$self->{"private_storage"} ||= {}
$self->{"private_storage"}
Truth table0%0/2
A
A= $self->{"private_storage"}
| |||||||||||||
| 16 | 0 | ▶ | if (exists $self->{private_storage}{$user}) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 17 | 0 | ▶ | if (exists $self->{private_storage}{$user}{$element}) | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 18 | { | ||||||||||||
| 19 | 0 | return $self->{private_storage}{$user}{$element}->as_xml(); | |||||||||||
| 20 | } | ||||||||||||
| 21 | } | ||||||||||||
| 22 | 0 | return undef; | |||||||||||
| 23 | } | ||||||||||||
| 24 | |||||||||||||
| 25 | =head2 store_privatestorage($self, $user, $element, $content) | ||||||||||||
| 26 | |||||||||||||
| 27 | Store $content for $element and $user in memory. | ||||||||||||
| 28 | |||||||||||||
| 29 | =cut | ||||||||||||
| 30 | |||||||||||||
| 31 | 0 | ▶ | sub store_privatestorage { | ||||||||||
|
Subroutine
store_privatestorage: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||
| 32 | 0 | my ($self, $user, $element, $content) = @_; | |||||||||||
| 33 | 0 | ▶ | $self->{private_storage} ||= {}; | ||||||||||
|
Condition0%0/2
$self->{"private_storage"} ||= {}
MC/DC0%0/1
$self->{"private_storage"} ||= {}
$self->{"private_storage"}
Truth table0%0/2
A
A= $self->{"private_storage"}
| |||||||||||||
| 34 | 0 | $self->{private_storage}{$user}{$element} = $content; | |||||||||||
| 35 | } | ||||||||||||
| 36 | 3 | 1; | |||||||||||
| 37 | |||||||||||||
| 38 | __END__ | ||||||||||||