CasException   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 35
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getCasErrorCode() 0 4 1
A getCasMsg() 0 5 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: chenyihong
5
 * Date: 16/8/1
6
 * Time: 18:05
7
 */
8
9
namespace Leo108\CAS\Exceptions\CAS;
10
11
class CasException extends \Exception
12
{
13
    const INVALID_REQUEST = 'INVALID_REQUEST';
14
    const INVALID_TICKET = 'INVALID_TICKET';
15
    const INVALID_SERVICE = 'INVALID_SERVICE';
16
    const INTERNAL_ERROR = 'INTERNAL_ERROR';
17
    const UNAUTHORIZED_SERVICE_PROXY = 'UNAUTHORIZED_SERVICE_PROXY';
18
19
    protected $casErrorCode;
20
21
    /**
22
     * CasException constructor.
23
     * @param string $casErrorCode
24
     * @param string $msg
25
     */
26 12
    public function __construct($casErrorCode, $msg = '')
27
    {
28 12
        $this->casErrorCode = $casErrorCode;
29 12
        $this->message      = $msg;
30 12
    }
31
32
    /**
33
     * @return string
34
     */
35 8
    public function getCasErrorCode()
36
    {
37 8
        return $this->casErrorCode;
38
    }
39
40 3
    public function getCasMsg()
41
    {
42
        //todo translate error msg
43 3
        return $this->casErrorCode;
44
    }
45
}
46