| 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 | 2 | 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 |
|
| 53 | |||
| 54 | /** |
||
| 55 | * Make an exception when the impersonated cannot be impersonated. |
||
| 56 | * |
||
| 57 | * @param \Arcanedev\LaravelImpersonator\Contracts\Impersonatable $impersonated |
||
| 58 | * |
||
| 59 | * @return static |
||
| 60 | */ |
||
| 61 | 2 | public static function cannotBeImpersonated(Impersonatable $impersonated) |
|
| 67 | } |
||
| 68 |