Completed
Pull Request — master (#63)
by
unknown
05:05
created

AbstractXmlOutputParser::transformXmlToArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 5
Bugs 2 Features 0
Metric Value
c 5
b 2
f 0
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
eloc 4
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Mhor\MediaInfo\Parser;
4
5
abstract class AbstractXmlOutputParser implements OutputParserInterface
6
{
7
    /**
8
     * @param string $xmlString
9
     *
10
     * @return array
11
     */
12 3
    protected function transformXmlToArray($xmlString)
13
    {
14 3
        $xml = simplexml_load_string($xmlString);
15 3
        $json = json_encode($xml);
16
17 3
        return json_decode($json, true);
18
    }
19
}
20