| 1 | package Petal::Utils::Date; | ||||||||||||
| 2 | |||||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 2 | ▶ | use warnings::register; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | |||||||||||||
| 6 | 2 | ▶ | use Carp; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | 2 | ▶ | use Date::Format; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 8 | |||||||||||||
| 9 | 2 | ▶ | use base qw( Petal::Utils::Base ); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 10 | |||||||||||||
| 11 | 2 | ▶ | use constant name => 'date'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 12 | 2 | ▶ | use constant aliases => qw(); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 13 | |||||||||||||
| 14 | 2 | our $VERSION = ((require Petal::Utils), $Petal::Utils::VERSION)[1]; | |||||||||||
| 15 | 2 | our $REVISION = (split(/ /, ' $Revision: 1.2 $ '))[2]; | |||||||||||
| 16 | |||||||||||||
| 17 | 1 | ▶ | sub process { | ||||||||||
|
Subroutine
process: called CC=3 SCAR=11.2
Pod
undocumented
| |||||||||||||
| 18 | 1 | my $self = shift; | |||||||||||
| 19 | 1 | my $hash = shift; | |||||||||||
| 20 | 1 | ▶ | my $args = shift || confess( "'date' expects a variable (got nothing)" ); | ||||||||||
|
Condition50%1/2
shift() || confess(q['date' expects a variable (got nothing)])
MC/DC0%0/1
shift() || confess(q['date' expects a variable (got nothing)])
shift()
Truth table50%1/2
A
A= shift()
| |||||||||||||
| 21 | 1 | my $result = $hash->fetch( $args ); | |||||||||||
| 22 | 1 | ▶ | return unless length($result); # do nothing if $args evaluates to nothing | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 23 | 1 | return time2str('%b %e %Y %T', $result); | |||||||||||
| 24 | } | ||||||||||||
| 25 | |||||||||||||
| 26 | 2 | 1; | |||||||||||