| 1 | package XML::Elemental::Document; | ||||||||||
| 2 | 3 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 3 | ▶ | use base qw( XML::Elemental::Node ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 3 | ▶ | use Scalar::Util qw(weaken); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 2 | ▶ | sub root_element { $_[0]->{contents} } | ||||||||
|
Subroutine
root_element: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 8 | |||||||||||
| 9 | 5 | ▶ | sub contents { | ||||||||
|
Subroutine
contents: called CC=4 SCAR=14.2
Pod
documented
| |||||||||||
| 10 | 5 | ▶ | if (@_ > 1) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 11 | 1 | ▶ | $_[0]->{contents} = ref $_[1] eq 'ARRAY' ? $_[1]->[0] : $_[1]; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 12 | 1 | weaken($_[0]->{contents}->{parent} = $_[0]); | |||||||||
| 13 | } | ||||||||||
| 14 | 5 | ▶ | return $_[0]->{contents} ? [$_[0]->{contents}] : []; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 15 | } | ||||||||||
| 16 | |||||||||||
| 17 | 0 | ▶ | sub attributes { } # deprecated. documents never have attributes. | ||||||||
|
Subroutine
attributes: not called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 18 | |||||||||||
| 19 | 4 | ▶ | sub DESTROY { | ||||||||
|
Subroutine
DESTROY: called CC=2 SCAR=6.9
| |||||||||||
| 20 | 4 | ▶ | $_[0]->{contents}->DESTROY if $_[0]->{contents}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 21 | } # starts circular reference teardown | ||||||||||
| 22 | |||||||||||
| 23 | 3 | 1; | |||||||||
| 24 | |||||||||||
| 25 | __END__ | ||||||||||