Passed
Pull Request — master (#18)
by SignpostMarv
03:22
created

SchemaReader   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 21
ccs 10
cts 10
cp 1
rs 10
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A splitParts() 0 14 3
1
<?php
2
3
namespace GoetasWebservices\XML\XSDReader;
4
5
use DOMElement;
6
7
class SchemaReader extends SchemaReaderLoadAbstraction
8
{
9
    /**
10
     * @param string $typeName
11
     *
12
     * @return mixed[]
13
     */
14 135
    protected static function splitParts(DOMElement $node, $typeName)
15
    {
16 135
        $prefix = null;
17 135
        $name = $typeName;
18 135
        if (strpos($typeName, ':') !== false) {
19 135
            list($prefix, $name) = explode(':', $typeName);
20 45
        }
21
22 135
        $namespace = $node->lookupNamespaceUri($prefix ?: '');
23
24
        return array(
25 135
            $name,
26 135
            $namespace,
27 135
            $prefix,
28 45
        );
29
    }
30
}
31