Completed
Pull Request — master (#22)
by
unknown
01:38
created

CasException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 4
rs 10
1
<?php
2
3
namespace SimpleSAML\Module\casserver\Cas;
4
5
/**
6
 * CasException correspond to different cas error codes
7
 * @package SimpleSAML\Module\casserver\Cas
8
 */
9
class CasException extends \Exception
10
{
11
    // For list of cas codes see https://apereo.github.io/cas/5.2.x/protocol/CAS-Protocol-Specification.html#253-error-codes
12
    const INVALID_TICKET = 'INVALID_TICKET';
13
    const INVALID_SERVICE = 'INVALID_SERVICE';
14
15
    private $casCode;
16
17
    /**
18
     * CasException constructor.
19
     * @param string $casCode
20
     * @param string $message
21
     */
22
    public function __construct($casCode, $message)
23
    {
24
        parent::__construct($message);
25
        $this->casCode = $casCode;
26
    }
27
28
    /**
29
     * @return string
30
     */
31
    public function getCasCode()
32
    {
33
        return $this->casCode;
34
    }
35
}
36