1 | <?php |
||
16 | class ImpersonationException extends Exception |
||
17 | { |
||
18 | /* ----------------------------------------------------------------- |
||
19 | | Main Methods |
||
20 | | ----------------------------------------------------------------- |
||
21 | */ |
||
22 | |||
23 | /** |
||
24 | * Make a new exception. |
||
25 | * |
||
26 | * @param string $message |
||
27 | * |
||
28 | * @return static |
||
29 | */ |
||
30 | 18 | public static function make(string $message): self |
|
34 | |||
35 | /** |
||
36 | * Make an exception when the impersonater and impersonated are same person. |
||
37 | * |
||
38 | * @return static |
||
39 | */ |
||
40 | 6 | public static function selfImpersonation(): self |
|
44 | |||
45 | /** |
||
46 | * Make an exception when the impersonater cannot (or not allowed) impersonate. |
||
47 | * |
||
48 | * @param \Arcanedev\LaravelImpersonator\Contracts\Impersonatable $impersonater |
||
49 | * |
||
50 | * @return static |
||
51 | */ |
||
52 | 6 | public static function cannotImpersonate(Impersonatable $impersonater): self |
|
61 | |||
62 | /** |
||
63 | * Make an exception when the impersonated cannot be impersonated. |
||
64 | * |
||
65 | * @param \Arcanedev\LaravelImpersonator\Contracts\Impersonatable $impersonated |
||
66 | * |
||
67 | * @return static |
||
68 | */ |
||
69 | 6 | public static function cannotBeImpersonated(Impersonatable $impersonated): self |
|
78 | |||
79 | /** |
||
80 | * Make an exception when the impersonator and the impersonated are the same person. |
||
81 | * |
||
82 | * @return static |
||
83 | */ |
||
84 | public static function impersonaterAndImpersonatedAreSame(): self |
||
90 | } |
||
91 |