| 1 | package OX::Application::Role::RouterConfig; | ||||||||||||||||||||||||||||||||||||||||||||||
| 2 | 2 | ▶ | BEGIN { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 2 | $OX::Application::Role::RouterConfig::AUTHORITY = 'cpan:STEVAN'; | |||||||||||||||||||||||||||||||||||||||||||||
| 4 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 2 | $OX::Application::Role::RouterConfig::VERSION = '0.14'; | |||||||||||||||||||||||||||||||||||||||||||||
| 6 | 2 | ▶ | use Moose::Role; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 2 | ▶ | use namespace::autoclean; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 8 | # ABSTRACT: adds some common shortcuts to route declarations from OX::Application::Role::RouteBuilder | ||||||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 2 | with 'OX::Application::Role::RouteBuilder'; | |||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 4 | ▶ | around parse_route => sub { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=5 SCAR=16.3
| |||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 4 | my $orig = shift; | |||||||||||||||||||||||||||||||||||||||||||||
| 15 | 4 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||
| 16 | 4 | my ($path, $route) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 4 | ▶ | if (ref($route) eq 'HASH' | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition66%4/6
ref $route eq "HASH" and exists $route->{"controller"} and exists $route->{"action"}
ref $route eq "HASH" and exists $route->{"controller"}
MC/DC33%1/3
ref $route eq "HASH" and exists $route->{"controller"} and exists $route->{"action"}
ref $route eq "HASH"
exists $route->{"controller"}
exists $route->{"action"}
Truth table50%2/4
A and B and C
A= ref $route eq "HASH"B= exists $route->{"controller"}C= exists $route->{"action"}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 19 | && exists($route->{controller}) | ||||||||||||||||||||||||||||||||||||||||||||||
| 20 | && exists($route->{action})) { | ||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 2 | my $controller = delete $route->{controller}; | |||||||||||||||||||||||||||||||||||||||||||||
| 22 | 2 | my $action = delete $route->{action}; | |||||||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 2 | $route = { | |||||||||||||||||||||||||||||||||||||||||||||
| 25 | class => 'OX::RouteBuilder::ControllerAction', | ||||||||||||||||||||||||||||||||||||||||||||||
| 26 | route_spec => { | ||||||||||||||||||||||||||||||||||||||||||||||
| 27 | controller => $controller, | ||||||||||||||||||||||||||||||||||||||||||||||
| 28 | action => $action, | ||||||||||||||||||||||||||||||||||||||||||||||
| 29 | }, | ||||||||||||||||||||||||||||||||||||||||||||||
| 30 | params => $route, | ||||||||||||||||||||||||||||||||||||||||||||||
| 31 | }; | ||||||||||||||||||||||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 33 | elsif (ref($route) eq 'CODE') { | ||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 2 | $route = { | |||||||||||||||||||||||||||||||||||||||||||||
| 35 | class => 'OX::RouteBuilder::Code', | ||||||||||||||||||||||||||||||||||||||||||||||
| 36 | route_spec => $route, | ||||||||||||||||||||||||||||||||||||||||||||||
| 37 | params => {}, | ||||||||||||||||||||||||||||||||||||||||||||||
| 38 | }; | ||||||||||||||||||||||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 4 | return $self->$orig($path, $route); | |||||||||||||||||||||||||||||||||||||||||||||
| 42 | 2 | }; | |||||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 2 | 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||||||||
| 46 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||