| 1 | package Mojo::Cache::Role::Strict; | ||||||||||||||||||||||||||||
| 2 | 3 | ▶ | use Mojo::Base -role; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 3 | ▶ | use Carp (); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 3 | with 'Mojo::Cache::Role::Exists'; | |||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 3 | our $VERSION = '0.04'; | |||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 3 | has [qw(strict_get strict_set)] => 1; | |||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | before get => sub { | ||||||||||||||||||||||||||||
| 12 | 13 | ▶ | Carp::confess qq{unknown key '$_[1]'} if $_[0]->strict_get and not $_[0]->exists($_[1]); | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.0
Branch: 1 branch
Condition100%3/3
$_[0]->strict_get and not $_[0]->exists($_[1])
MC/DC100%2/2
$_[0]->strict_get and not $_[0]->exists($_[1])
$_[0]->strict_get
not $_[0]->exists($_[1])
Truth table100%3/3
A and not(B)
A= $_[0]->strict_getB= not $_[0]->exists($_[1])
| |||||||||||||||||||||||||||||
| 13 | 3 | }; | |||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | before set => sub { | ||||||||||||||||||||||||||||
| 16 | 6 | ▶ | Carp::confess 'cannot set in strict_set mode' if $_[0]->strict_set; | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 17 | 3 | }; | |||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | 3 | 1; | |||||||||||||||||||||||||||
| 20 | __END__ | ||||||||||||||||||||||||||||