1 | <?php namespace Arcanedev\LaravelImpersonator\Exceptions; |
||
11 | class ImpersonationException extends \Exception |
||
12 | { |
||
13 | /* ----------------------------------------------------------------- |
||
14 | | Main Methods |
||
15 | | ----------------------------------------------------------------- |
||
16 | */ |
||
17 | |||
18 | /** |
||
19 | * Make a new exception. |
||
20 | * |
||
21 | * @param string $message |
||
22 | * |
||
23 | * @return static |
||
24 | */ |
||
25 | 6 | public static function make(string $message): self |
|
29 | |||
30 | /** |
||
31 | * Make an exception when the impersonater and impersonated are same person. |
||
32 | * |
||
33 | * @return static |
||
34 | */ |
||
35 | public static function selfImpersonation(): self |
||
39 | |||
40 | /** |
||
41 | * Make an exception when the impersonater cannot (or not allowed) impersonate. |
||
42 | * |
||
43 | * @param \Arcanedev\LaravelImpersonator\Contracts\Impersonatable $impersonater |
||
44 | * |
||
45 | * @return static |
||
46 | */ |
||
47 | 2 | public static function cannotImpersonate(Impersonatable $impersonater): self |
|
56 | |||
57 | /** |
||
58 | * Make an exception when the impersonated cannot be impersonated. |
||
59 | * |
||
60 | * @param \Arcanedev\LaravelImpersonator\Contracts\Impersonatable $impersonated |
||
61 | * |
||
62 | * @return static |
||
63 | */ |
||
64 | 2 | public static function cannotBeImpersonated(Impersonatable $impersonated) |
|
73 | |||
74 | /** |
||
75 | * Make an exception when the impersonator and the impersonated are the same person. |
||
76 | * |
||
77 | * @return static |
||
78 | */ |
||
79 | 2 | public static function impersonaterAndImpersonatedAreSame() |
|
85 | } |
||
86 |