ParserException::notXml()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 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