| 1 | package Mason::Plugin::RouterSimple::Request; | ||||||||||
| 2 | 1 | ▶ | BEGIN { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 1 | $Mason::Plugin::RouterSimple::Request::VERSION = '0.07'; | |||||||||
| 4 | } | ||||||||||
| 5 | 1 | ▶ | use Mason::PluginRole; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 13 | ▶ | around 'construct_page_component' => sub { | ||||||||
|
Subroutine
__ANON__: called CC=4 SCAR=13.9
| |||||||||||
| 8 | 13 | my ( $orig, $self, $compc, $args ) = @_; | |||||||||
| 9 | |||||||||||
| 10 | 13 | ▶ | if ( $compc->router_object() ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 11 | 10 | ▶ | if ( defined( my $path_info = $self->path_info ) ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 12 | 10 | ▶ | if ( my $router_result = $compc->router_object->match($path_info) ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 13 | 8 | $args = { router_result => $router_result, %$router_result, %$args }; | |||||||||
| 14 | } | ||||||||||
| 15 | else { | ||||||||||
| 16 | 2 | $self->decline("'$path_info' did not match any routes"); | |||||||||
| 17 | } | ||||||||||
| 18 | } | ||||||||||
| 19 | } | ||||||||||
| 20 | 11 | return $self->$orig( $compc, $args ); | |||||||||
| 21 | 1 | }; | |||||||||
| 22 | |||||||||||
| 23 | 1 | 1; | |||||||||