Parser   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 81.82%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 27
ccs 9
cts 11
cp 0.8182
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setXMLString() 0 4 1
A getXMLString() 0 4 1
A parse() 0 9 1
1
<?php
2
3
namespace Dalen\OWLPacketInterceptor\Parser;
4
5
/**
6
 * Description of Parser
7
 *
8
 * @author danieleorler
9
 */
10
class Parser
11
{
12
    private $xmlString = '';
13
    
14 2
    public function setXMLString($string)
15
    {
16 2
        $this->xmlString = $string;
17 2
    }
18
    
19
    public function getXMLString()
20
    {
21
        return $this->xmlString;
22
    }
23
24
    /*
25
     * returns an implementation of IPacket
26
     */
27 2
    public function parse()
28
    {
29 2
        $parserResolver = new ParserResolver();
30 2
        $parserResolver->setXMLElement(new \SimpleXMLElement($this->xmlString));
31
        
32 2
        $parser = $parserResolver->getParser();
33
        
34 2
        return $parser->parse();
35 1
    }
36
}
37