| 1 | package DBIx::Class::ResultClass::HashRefInflator::UTF8; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 2 | ▶ | use utf8; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | # ABSTRACT: Get raw hashrefs from a resultset with utf-8 flag | ||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 2 | our $VERSION = '1.000001'; # VERSION | |||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 2 | ▶ | use parent qw( DBIx::Class::ResultClass::HashRefInflator ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | sub inflate_result { | ||||||||||||||||||||||||||||
| 14 | 0 | ▶ | my ( $self, @args ) = @_; | ||||||||||||||||||||||||||
|
Subroutine
inflate_result: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||
| 15 | 0 | my $res = $self->SUPER::inflate_result( @args ); | |||||||||||||||||||||||||||
| 16 | 0 | ▶ | return $res if ref($res) ne 'HASH'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | return { | ||||||||||||||||||||||||||||
| 19 | map { | ||||||||||||||||||||||||||||
| 20 | 0 | my $val = $res->{$_}; | |||||||||||||||||||||||||||
| 21 | 0 | ▶ | utf8::decode($val) if defined $val && !ref($val); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $val and not ref $val
MC/DC0%0/2
defined $val and not ref $val
defined $val
not ref $val
Truth table0%0/3
A and not(B)
A= defined $valB= not ref $val
| |||||||||||||||||||||||||||||
| 22 | 0 | ( $_ => $val ); | |||||||||||||||||||||||||||
| 23 | } keys %$res | ||||||||||||||||||||||||||||
| 24 | }; | ||||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | 2 | 1; | |||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | __END__ | ||||||||||||||||||||||||||||