File Coverage

blib/lib/SQL/Statement/Function/ByName/MONTH.pm
Criterion Covered Total %
statement 11 11 100.0
branch 2 2 100.0
condition n/a
subroutine 4 4 100.0
pod 0 1 0.0
total 17 18 94.4


line stmt bran cond sub pod time code
1             package SQL::Statement::Function::ByName::MONTH;
2              
3 1     1   3001 use 5.010001;
  1         4  
4 1     1   5 use strict;
  1         6  
  1         21  
5 1     1   5 use warnings;
  1         3  
  1         175  
6              
7             our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
8             our $DATE = '2022-12-12'; # DATE
9             our $DIST = 'SQL-Statement-Functions-Date'; # DIST
10             our $VERSION = '0.050'; # VERSION
11              
12             sub SQL_FUNCTION_MONTH {
13 4     4 0 18 my $param = $_[2];
14              
15 4 100       26 $param =~ /^\d{4}-(\d{2})-/ or return undef; ## no critic: TestingAndDebugging::ProhibitExplicitReturnUndef
16 3         26 $1+0;
17             }
18              
19             1;
20             # ABSTRACT: Return the month part of a date/datetime expression
21              
22             __END__