mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-15 11:44:04 +00:00
* Throw an exception on attempt to create impersonation token with a non-stateful guard * Test that impersonation tokens can only be created with a stateful guard * Fix code style (php-cs-fixer) * Escape backslashes in the exception's message Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com> * Make the exception only about requiring a stateful guard Co-authored-by: PHP CS Fixer <phpcsfixer@example.com> Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
15 lines
380 B
PHP
15 lines
380 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Stancl\Tenancy\Exceptions;
|
|
|
|
use Exception;
|
|
|
|
class StatefulGuardRequiredException extends Exception
|
|
{
|
|
public function __construct(string $guardName)
|
|
{
|
|
parent::__construct("Cannot use a non-stateful guard ('$guardName'). A guard implementing the Illuminate\\Contracts\\Auth\\StatefulGuard interface is required.");
|
|
}
|
|
}
|