« lib/Reaction/InterfaceModel/Action/User/ChangePassword.pm
↑ Summary
lib/Reaction/UI/Widget/Image.pm »
| 1 | package Reaction::UI::Controller; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 4 | ▶ | use Moose; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 4 | ▶ | use Scalar::Util 'weaken'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 4 | ▶ | use namespace::clean -except => [ qw(meta) ]; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 4 | ▶ | BEGIN { extends 'Catalyst::Controller'; } | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 4 | has context => (is => 'ro', isa => 'Object', weak_ref => 1); | |||||||||||||||||||||||||||
| 10 | 4 | with( | |||||||||||||||||||||||||||
| 11 | 'Catalyst::Component::InstancePerContext', | ||||||||||||||||||||||||||||
| 12 | 'Reaction::UI::Controller::Role::RedirectTo' | ||||||||||||||||||||||||||||
| 13 | ); | ||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 7 | ▶ | sub build_per_context_instance { | ||||||||||||||||||||||||||
|
Subroutine
build_per_context_instance: called CC=3 SCAR=11.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 16 | 7 | my ($self, $c, @args) = @_; | |||||||||||||||||||||||||||
| 17 | 7 | ▶ | my $class = ref($self) || $self; | ||||||||||||||||||||||||||
|
Condition33%1/3
ref $self || $self
MC/DC0%0/2
ref $self || $self
ref $self
$self
Truth table33%1/3
A || B
A= ref $selfB= $self
| |||||||||||||||||||||||||||||
| 18 | 7 | ▶ | my $newself = $class->new($self->_application, {%{$self || {}}, context => $c, @args}); | ||||||||||||||||||||||||||
|
Condition50%1/2
$self || {}
MC/DC0%0/1
$self || {}
$self
Truth table50%1/2
A
A= $self
| |||||||||||||||||||||||||||||
| 19 | 7 | return $newself; | |||||||||||||||||||||||||||
| 20 | } | ||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | 8 | ▶ | sub push_viewport { | ||||||||||||||||||||||||||
|
Subroutine
push_viewport: called CC=7 SCAR=28.5
Pod
documented
| |||||||||||||||||||||||||||||
| 23 | 8 | my $self = shift; | |||||||||||||||||||||||||||
| 24 | 8 | my $c = $self->context; | |||||||||||||||||||||||||||
| 25 | 8 | my $focus_stack = $c->stash->{focus_stack}; | |||||||||||||||||||||||||||
| 26 | 8 | my ($class, @proto_args) = @_; | |||||||||||||||||||||||||||
| 27 | 8 | my %args; | |||||||||||||||||||||||||||
| 28 | 8 | ▶ | if (my $vp_attr = $c->stack->[-1]->attributes->{ViewPort}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 29 | 0 | ▶ | if (ref($vp_attr) eq 'ARRAY') { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 30 | 0 | $vp_attr = $vp_attr->[0]; | |||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | 0 | ▶ | if (ref($vp_attr) eq 'HASH') { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 33 | 0 | ▶ | $class = $vp_attr->{class} if defined $vp_attr->{class}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 34 | 0 | %args = %{ $self->merge_config_hashes($vp_attr, {@proto_args}) }; | |||||||||||||||||||||||||||
| 35 | } else { | ||||||||||||||||||||||||||||
| 36 | 0 | $class = $vp_attr; | |||||||||||||||||||||||||||
| 37 | 0 | %args = @proto_args; | |||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||
| 39 | } else { | ||||||||||||||||||||||||||||
| 40 | 8 | %args = @proto_args; | |||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | 8 | $args{ctx} = $c; | |||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | 8 | ▶ | if (exists $args{next_action} && !ref($args{next_action})) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
exists $args{"next_action"} and not ref $args{"next_action"}
MC/DC0%0/2
exists $args{"next_action"} and not ref $args{"next_action"}
exists $args{"next_action"}
not ref $args{"next_action"}
Truth table33%1/3
A and not(B)
A= exists $args{"next_action"}B= not ref $args{"next_action"}
| |||||||||||||||||||||||||||||
| 46 | 0 | $args{next_action} = [ $self, 'redirect_to', $args{next_action} ]; | |||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||
| 48 | 8 | $focus_stack->push_viewport($class, %args); | |||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | 0 | ▶ | sub pop_viewport { | ||||||||||||||||||||||||||
|
Subroutine
pop_viewport: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 52 | 0 | return shift->context->stash->{focus_stack}->pop_viewport; | |||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | 0 | ▶ | sub pop_viewports_to { | ||||||||||||||||||||||||||
|
Subroutine
pop_viewports_to: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 56 | 0 | my ($self, $vp) = @_; | |||||||||||||||||||||||||||
| 57 | 0 | return $self->context->stash->{focus_stack}->pop_viewports_to($vp); | |||||||||||||||||||||||||||
| 58 | } | ||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||
| 60 | 3 | ▶ | sub make_context_closure { | ||||||||||||||||||||||||||
|
Subroutine
make_context_closure: called CC=1 SCAR=0.1
Pod
documented
| |||||||||||||||||||||||||||||
| 61 | 3 | my($self, $closure) = @_; | |||||||||||||||||||||||||||
| 62 | 3 | my $ctx = $self->context; | |||||||||||||||||||||||||||
| 63 | 3 | weaken($ctx); | |||||||||||||||||||||||||||
| 64 | 0 | ▶ | return sub { $closure->($ctx, @_) }; | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||||||||||||||||||||
| 65 | } | ||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||
| 67 | 4 | 1; | |||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||
| 69 | __END__; | ||||||||||||||||||||||||||||