SimpleXMLElementFormatter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 18
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A format() 0 10 2
1
<?php
2
3
namespace Glooby\Debug\Formatter;
4
5
use Glooby\Debug\Exception\FormatterException;
6
7
/**
8
 * @author Emil Kilhage
9
 */
10
class SimpleXMLElementFormatter implements FormatterInterface
11
{
12
    /**
13
     * @param \SimpleXMLElement $response
14
     * @return string
15
     * @throws FormatterException
16
     */
17
    public function format($response)
18
    {
19
        $response = $response->asXML();
20
21
        if (false === $response) {
22
            throw FormatterException::unableToFormatMessageException();
23
        }
24
25
        return $response;
26
    }
27
}
28