Completed
Pull Request — master (#42)
by Andreas
04:16
created

RequestMismatchException::fromMatcherException()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Http\Mock\Exception;
4
5
use Psr\Http\Message\RequestInterface;
6
7
class RequestMismatchException extends \RuntimeException
8
{
9
    /**
10
     * @param \Exception $exception
11
     *
12
     * @return self
13
     */
14 2
    public static function fromMatcherException(\Exception $exception)
15
    {
16 2
        return new self(
17 2
            'Expected a different request to be sent.',
18 2
            0,
19 2
            $exception
20
        );
21
    }
22
23
    /**
24
     * @return self
25
     */
26 2
    public static function create()
27
    {
28 2
        return new self('Expected a different request to be sent.');
29
    }
30
}
31