DelegateException::getOriginException()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
1
<?php
0 ignored issues
show
Coding Style introduced by
Header blocks must be separated by a single blank line
Loading history...
2
namespace WebStream\Exception;
3
4
/**
5
 * ApplicationException
6
 * @author Ryuichi TANAKA.
7
 * @since 2014/05/05
8
 * @version 0.4
9
 */
10
class DelegateException extends ApplicationException
11
{
12
    /**
13
     * @var bool ハンドリング可否
14
     */
15
    private $isHandled;
16
17
    /**
18
     * @var \Exception 例外オブジェクト
19
     */
20
    private $originException;
21
22
    /**
23
     * constructor
24
     * @param \Exception $originException 例外オブジェクト
25
     */
26 4
    public function __construct(\Exception $originException)
27
    {
28 4
        parent::__construct($originException->getMessage(), 500, $originException);
29 4
        $this->originException = $originException;
30 4
        $this->isHandled = false;
31
    }
32
33
    /**
34
     * オリジナルの例外を返却する
35
     * @return \Exception 例外オブジェクト
36
     */
37
    public function getOriginException()
38
    {
39
        return $this->originException;
40
    }
41
42
    /**
43
     * ハンドリング可否を返却する
44
     * @return bool ハンドリング可否
45
     */
46
    public function isHandled()
47
    {
48
        return $this->isHandled;
49
    }
50
51
    /**
52
     * ハンドリングを許可する
53
     */
54 4
    public function enableHandled()
55
    {
56 4
        $this->isHandled = true;
57
    }
58
}
59