Completed
Push — master ( 17843f...6b9e14 )
by Tim
03:37 queued 01:40
created

lib/Cas/CasException.php (1 issue)

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:
12
    // https://apereo.github.io/cas/5.2.x/protocol/CAS-Protocol-Specification.html#253-error-codes
13
    public const INVALID_TICKET = 'INVALID_TICKET';
14
15
    public const INVALID_SERVICE = 'INVALID_SERVICE';
16
17
    /** @var string */
18
    private $casCode;
19
20
    /**
21
     * CasException constructor.
22
     * @param string $casCode
23
     * @param string $message
24
     * @return void
25
     */
26
    public function __construct(string $casCode, string $message): void
27
    {
28
        parent::__construct($message);
29
        $this->casCode = $casCode;
30
    }
31
32
    /**
33
     * @return string
34
     */
35
    public function getCasCode(): void
36
    {
37
        return $this->casCode;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->casCode returns the type string which is incompatible with the type-hinted return void.
Loading history...
38
    }
39
}
40