ParserException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 24
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A notXml() 0 4 1
A xmlrpcExtensionLibxmlParsehugeNotSupported() 0 6 1
1
<?php
2
3
namespace Fxmlrpc\Serialization\Exception;
4
5
use Fxmlrpc\Serialization\Exception;
6
7
/**
8
 * @author Márk Sági-Kazár <[email protected]>
9
 */
10
class ParserException extends \RuntimeException implements Exception
11
{
12
    /**
13
     * Named constructor for invalid XML values.
14
     *
15
     * @param string $string
16
     *
17
     * @return static
18
     */
19 2
    public static function notXml($string)
20
    {
21 2
        return new static(sprintf('Invalid XML. Expected XML, string given: "%s"', $string));
22
    }
23
24
    /**
25
     * @return static
26
     */
27 1
    public static function xmlrpcExtensionLibxmlParsehugeNotSupported()
28
    {
29 1
        return new static(
30
            'Parsing huge XML responses using libxml’s LIBXML_PARSEHUGE flag is not supported in ext/xmlrpc'
31 1
        );
32
    }
33
}
34