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

ClassNotFoundException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 71.43%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
dl 0
loc 20
ccs 5
cts 7
cp 0.7143
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getClass() 0 3 1
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