AdobeCampaignXmlLoader::loadXml()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 7
c 0
b 0
f 0
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace LaFourchette\AdobeCampaignClientBundle\Util;
4
5
class AdobeCampaignXmlLoader
6
{
7
    /**
8
     * Create a \SimpleXMLElement from a AdobeCampaign response
9
     *
10
     * @param string $xml
11
     *
12
     * @return \SimpleXMLElement
13
     */
14 2
    public static function loadXml($xml)
15
    {
16
        //Clean xml
17 2
        $xml = str_ireplace(array('SOAP-ENV:', 'SOAP:'), '', str_replace('xmlns=', 'ns=', $xml));
18
19 2
        return simplexml_load_string($xml);
20
    }
21
}
22