blib/lib/Mojolicious/Plugin/ServerType.pm

filter: Statementstmt 100% 14 / 14 Branchbran n/a Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 91.3% 21 / 23 CC 2 SCAR 2.9
CC
2
Cov
94%
register
2.0
BEGIN
1.0
__ANON__
1.0
CRAP 1.3
↑ Summary
1 package Mojolicious::Plugin::ServerType;
2  
3 2 ▶use Mojo::Base 'Mojolicious::Plugin';
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 2 our $VERSION = "0.02";
6  
7 1 ▶sub register {
Subroutine register: called CC=2 SCAR=6.9
Pod documented
8 1 my ($self, $app, $conf) = (@_);
9 1 ▶ $conf ||= {};
Condition50%1/2
$conf ||= {}
l!l
10
MC/DC0%0/1
$conf ||= {}
$conf
Truth table50%1/2
A
A= $conf
Aresult
11
00
10  
11 $app->helper(
12 1 ▶ server_type => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
13 1 return undef;
14 }
15 1 );
16  
17 3 ▶ $app->hook( before_server_start => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
18 3 my ( $server, $app ) = @_;
19  
20 3 my $serverType = ref $server;
21  
22 $app->helper(
23 2 ▶ server_type => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
24 2 return $serverType;
25 }
26 3 );
27 1 });
28 }
29  
30  
31 2 1;
32 __END__
↑ Summary