| 1 | package HTML::Shakan::Declare; | ||||||||||||||||||||
| 2 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 1 | ▶ | use parent 'Exporter'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 1 | ▶ | use HTML::Shakan (); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | 1 | our @EXPORT = qw(form get); | |||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | 1 | ▶ | sub import { | ||||||||||||||||||
|
Subroutine
import: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 10 | 1 | my $class = shift; | |||||||||||||||||||
| 11 | 1 | __PACKAGE__->export_to_level(1); | |||||||||||||||||||
| 12 | 1 | HTML::Shakan::Fields->export_to_level(1); | |||||||||||||||||||
| 13 | } | ||||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | 1 | our $FORMS; | |||||||||||||||||||
| 16 | 0 | ▶ | sub form ($@) { ## no critic. | ||||||||||||||||||
|
Subroutine
form: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 17 | 0 | my ($name, @fields) = @_; | |||||||||||||||||||
| 18 | 0 | my $pkg = caller(0); | |||||||||||||||||||
| 19 | 0 | $FORMS->{$pkg}->{$name} = \@fields; | |||||||||||||||||||
| 20 | } | ||||||||||||||||||||
| 21 | |||||||||||||||||||||
| 22 | 0 | ▶ | sub get { | ||||||||||||||||||
|
Subroutine
get: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||
| 23 | 0 | my ($class, $name, %args) = @_; | |||||||||||||||||||
| 24 | 0 | ▶ | $class = ref $class || $class; | ||||||||||||||||||
|
Condition0%0/3
ref $class || $class
MC/DC0%0/2
ref $class || $class
ref $class
$class
Truth table0%0/3
A || B
A= ref $classB= $class
| |||||||||||||||||||||
| 25 | return HTML::Shakan->new( | ||||||||||||||||||||
| 26 | 0 | fields => $FORMS->{$class}->{$name}, | |||||||||||||||||||
| 27 | %args, | ||||||||||||||||||||
| 28 | ); | ||||||||||||||||||||
| 29 | } | ||||||||||||||||||||
| 30 | |||||||||||||||||||||
| 31 | 1 | 1; | |||||||||||||||||||
| 32 | __END__ | ||||||||||||||||||||