Passed
Pull Request — master (#174)
by
unknown
05:42
created

SignerException::digestComparisonFailed()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
crap 1
1
<?php
2
namespace NFePHP\Common\Exception;
3
4
/**
5
 * @category   NFePHP
6
 * @package    NFePHP\Common\Exception
7
 * @copyright  Copyright (c) 2008-2014
8
 * @license    http://www.gnu.org/licenses/lesser.html LGPL v3
9
 * @author     Roberto L. Machado <linux.rlm at gmail dot com>
10
 * @link       http://github.com/nfephp-org/sped-common for the canonical source repository
11
 */
12
13
class SignerException extends \RuntimeException implements ExceptionInterface
14
{
15
    public static function isNotXml()
16
    {
17
        return new static('The content not is a valid XML.');
18
    }
19
    
20 1
    public static function digestComparisonFailed()
21
    {
22 1
        return new static('The XML content does not match the Digest Value. '
23 1
           . 'Probably modified after it was signed');
24
    }
25
    
26 1
    public static function signatureComparisonFailed()
27
    {
28 1
        return new static('The XML SIGNATURE does not match. '
29 1
           . 'Probably modified after it was signed.');
30
    }
31
    
32
    
33 1
    public static function tagNotFound($tagname)
34
    {
35 1
        return new static("The specified tag &lt;$tagname&gt; was not found in xml.");
36
    }
37
}
38