ExpectationFailedException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getReason() 0 4 1
1
<?php
2
/*
3
 * This file is part of project-quality-inspector.
4
 *
5
 * (c) Alexandre GESLIN <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace ProjectQualityInspector\Exception;
12
13
use ProjectQualityInspector\Rule\RuleInterface;
14
15
/**
16
 * Class ExpectationFailedException
17
 *
18
 * @package ProjectQualityInspector\Exception
19
 */
20
class ExpectationFailedException extends \RuntimeException
21
{
22
23
    /**
24
     * @var mixed
25
     */
26
    protected $subject;
27
28
    /**
29
     * @var string
30
     */
31
    protected $reason;
32
33
    /**
34
     * ExpectationFailedException constructor.
35
     *
36
     * @param mixed $subject
37
     * @param string $message
38
     * @param string $reason
39
     * @param int $code
40
     * @param Exception|null $previous
41
     */
42
    public function __construct($subject, $message, $reason = "", $code = 0, \Exception $previous = null)
43
    {
44
        parent::__construct($message, $code, $previous);
45
46
        $this->subject = $subject;
47
        $this->reason = $reason;
48
    }
49
50
    /**
51
     * @return string
52
     */
53
    public function getReason()
54
    {
55
        return $this->reason;
56
    }
57
}