Completed
Pull Request — 6.0 (#1895)
by nhzex
04:53
created

ClassNotFoundException::getClass()   A

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 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
// +----------------------------------------------------------------------
3
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
4
// +----------------------------------------------------------------------
5
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
6
// +----------------------------------------------------------------------
7
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
8
// +----------------------------------------------------------------------
9
// | Author: yunwuxin <[email protected]>
10
// +----------------------------------------------------------------------
11
12
namespace think\exception;
13
14
use Psr\Container\NotFoundExceptionInterface;
15
use RuntimeException;
16
use Throwable;
17
18
/**
19
 * 类不存在异常
20
 */
21
class ClassNotFoundException extends RuntimeException implements NotFoundExceptionInterface
22
{
23
    protected $class;
24
25 3
    public function __construct(string $message, string $class = '', Throwable $previous = null)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function __construct()
Loading history...
26
    {
27 3
        $this->message = $message;
28 3
        $this->class   = $class;
29
30 3
        parent::__construct($message, 0, $previous);
31 3
    }
32
33
    /**
34
     * 获取类名
35
     * @access public
36
     * @return string
37
     */
38
    public function getClass()
39
    {
40
        return $this->class;
41
    }
42
}
43