Completed
Push — master ( 59d827...fe270b )
by leo
05:52
created

CasException::getCasMsg()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 5
ccs 2
cts 2
cp 1
crap 1
rs 9.4285
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
18
    protected $casErrorCode;
19
20
    /**
21
     * CasException constructor.
22
     * @param string $casErrorCode
23
     * @param string $msg
24
     */
25 4
    public function __construct($casErrorCode, $msg = '')
26
    {
27 4
        $this->casErrorCode = $casErrorCode;
28 4
        $this->message      = $msg;
29 4
    }
30
31
    /**
32
     * @return string
33
     */
34 2
    public function getCasErrorCode()
35
    {
36 2
        return $this->casErrorCode;
37
    }
38
39 2
    public function getCasMsg()
40
    {
41
        //todo translate error msg
42 2
        return $this->casErrorCode;
43
    }
44
}
45