| 1 | 4 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | 4 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | package YAML::PP::Schema::Failsafe; | ||||||||||
| 4 | |||||||||||
| 5 | 4 | our $VERSION = 'v0.43.0'; # VERSION | |||||||||
| 6 | |||||||||||
| 7 | 3 | ▶ | sub register { | ||||||||
|
Subroutine
register: called CC=1 SCAR=1.2
Pod
documented
| |||||||||||
| 8 | 3 | my ($self, %args) = @_; | |||||||||
| 9 | 3 | my $schema = $args{schema}; | |||||||||
| 10 | |||||||||||
| 11 | $schema->add_resolver( | ||||||||||
| 12 | tag => 'tag:yaml.org,2002:str', | ||||||||||
| 13 | 3 | ▶ | match => [ all => sub { $_[1]->{value} } ], | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 14 | ); | ||||||||||
| 15 | $schema->add_sequence_resolver( | ||||||||||
| 16 | tag => 'tag:yaml.org,2002:seq', | ||||||||||
| 17 | 0 | ▶ | on_data => sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 18 | 0 | my ($constructor, $ref, $list) = @_; | |||||||||
| 19 | 0 | push @$$ref, @$list; | |||||||||
| 20 | }, | ||||||||||
| 21 | 3 | ); | |||||||||
| 22 | $schema->add_mapping_resolver( | ||||||||||
| 23 | tag => 'tag:yaml.org,2002:map', | ||||||||||
| 24 | 0 | ▶ | on_data => sub { | ||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||
| 25 | 0 | my ($constructor, $ref, $list) = @_; | |||||||||
| 26 | 0 | ▶ | for (my $i = 0; $i < @$list; $i += 2) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 27 | 0 | $$ref->{ $list->[ $i ] } = $list->[ $i + 1 ]; | |||||||||
| 28 | } | ||||||||||
| 29 | }, | ||||||||||
| 30 | 3 | ); | |||||||||
| 31 | |||||||||||
| 32 | 3 | return; | |||||||||
| 33 | } | ||||||||||
| 34 | |||||||||||
| 35 | 4 | 1; | |||||||||
| 36 | |||||||||||
| 37 | __END__ | ||||||||||