mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 14:34:04 +00:00
fix: add explicit nullable type declarations for UserImpersonation parameters (#1324)
This commit is contained in:
parent
19bc316cf6
commit
3f9935784d
1 changed files with 3 additions and 3 deletions
|
|
@ -18,7 +18,7 @@ class UserImpersonation implements Feature
|
||||||
|
|
||||||
public function bootstrap(Tenancy $tenancy): void
|
public function bootstrap(Tenancy $tenancy): void
|
||||||
{
|
{
|
||||||
$tenancy->macro('impersonate', function (Tenant $tenant, string $userId, string $redirectUrl, string $authGuard = null): ImpersonationToken {
|
$tenancy->macro('impersonate', function (Tenant $tenant, string $userId, string $redirectUrl, ?string $authGuard = null): ImpersonationToken {
|
||||||
return ImpersonationToken::create([
|
return ImpersonationToken::create([
|
||||||
'tenant_id' => $tenant->getTenantKey(),
|
'tenant_id' => $tenant->getTenantKey(),
|
||||||
'user_id' => $userId,
|
'user_id' => $userId,
|
||||||
|
|
@ -32,10 +32,10 @@ class UserImpersonation implements Feature
|
||||||
* Impersonate a user and get an HTTP redirect response.
|
* Impersonate a user and get an HTTP redirect response.
|
||||||
*
|
*
|
||||||
* @param string|ImpersonationToken $token
|
* @param string|ImpersonationToken $token
|
||||||
* @param int $ttl
|
* @param int|null $ttl
|
||||||
* @return RedirectResponse
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
public static function makeResponse($token, int $ttl = null): RedirectResponse
|
public static function makeResponse($token, ?int $ttl = null): RedirectResponse
|
||||||
{
|
{
|
||||||
$token = $token instanceof ImpersonationToken ? $token : ImpersonationToken::findOrFail($token);
|
$token = $token instanceof ImpersonationToken ? $token : ImpersonationToken::findOrFail($token);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue