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

AbstractXmlOutputParser   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 6
Bugs 2 Features 0
Metric Value
wmc 1
c 6
b 2
f 0
lcom 0
cbo 0
dl 0
loc 15
ccs 4
cts 4
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A transformXmlToArray() 0 7 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