Passed
Push — master ( ededa8...e7b389 )
by 世昌
02:14
created

NoTemplateFoundException::getTemplateType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
namespace suda\application\exception;
3
4
use RuntimeException;
5
6
/**
7
 * 模板找不到
8
 */
9
class NoTemplateFoundException extends RuntimeException
10
{
11
    const T_SOURCE = 1;
12
    const T_DEST = 2;
13
    /**
14
     * @var string
15
     */
16
    protected $name;
17
18
    /**
19
     * @var int
20
     */
21
    protected $type;
22
23
    public function __construct(string $message, int $code, string $name, int $type = 0)
24
    {
25
        $this->name = $name;
26
        $this->type = $type;
27
        parent::__construct($message, $code);
28
    }
29
30
    /**
31
     * @return string
32
     */
33
    public function getTemplateName(): string
34
    {
35
        return $this->name;
36
    }
37
38
    /**
39
     * @return int
40
     */
41
    public function getTemplateType(): int
42
    {
43
        return $this->type;
44
    }
45
}
46