CasException::getCasMsg()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 5
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
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