mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 12:24:04 +00:00
phpcsfixer: enable nullable_type_declaration_for_default_null_value
This commit is contained in:
parent
eecf6f21c8
commit
20c1b9a940
6 changed files with 10 additions and 9 deletions
|
|
@ -4,6 +4,7 @@ use PhpCsFixer\Config;
|
|||
use PhpCsFixer\Finder;
|
||||
|
||||
$rules = [
|
||||
'nullable_type_declaration_for_default_null_value' => true,
|
||||
'single_line_empty_body' => true,
|
||||
'array_syntax' => ['syntax' => 'short'],
|
||||
'binary_operator_spaces' => [
|
||||
|
|
|
|||
|
|
@ -74,12 +74,12 @@ class Install extends Command
|
|||
*/
|
||||
protected function step(
|
||||
string $name,
|
||||
Closure $task = null,
|
||||
?Closure $task = null,
|
||||
bool $unless = false,
|
||||
string $warning = null,
|
||||
string $file = null,
|
||||
string $tag = null,
|
||||
array $files = null,
|
||||
?string $warning = null,
|
||||
?string $file = null,
|
||||
?string $tag = null,
|
||||
?array $files = null,
|
||||
bool $newLineBefore = false,
|
||||
bool $newLineAfter = false,
|
||||
): void {
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class TenantAssetController implements HasMiddleware
|
|||
/**
|
||||
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
|
||||
*/
|
||||
public function __invoke(Request $request, string $path = null): BinaryFileResponse
|
||||
public function __invoke(Request $request, ?string $path = null): BinaryFileResponse
|
||||
{
|
||||
$this->validatePath($path);
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class UserImpersonation implements Feature
|
|||
}
|
||||
|
||||
/** Impersonate a user and get an HTTP redirect response. */
|
||||
public static function makeResponse(string|ImpersonationToken $token, int $ttl = null): RedirectResponse
|
||||
public static function makeResponse(string|ImpersonationToken $token, ?int $ttl = null): RedirectResponse
|
||||
{
|
||||
/** @var ImpersonationToken $token */
|
||||
$token = $token instanceof ImpersonationToken ? $token : ImpersonationToken::findOrFail($token);
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ class Tenancy
|
|||
/**
|
||||
* Try to find a tenant using an ID.
|
||||
*/
|
||||
public static function find(int|string $id, string $column = null, bool $withRelations = false): (Tenant&Model)|null
|
||||
public static function find(int|string $id, ?string $column = null, bool $withRelations = false): (Tenant&Model)|null
|
||||
{
|
||||
/** @var (Tenant&Model)|null $tenant */
|
||||
$tenant = static::model()->with($withRelations ? static::$findWith : [])->firstWhere($column ?? static::model()->getTenantKeyName(), $id);
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ if (! function_exists('tenant')) {
|
|||
*
|
||||
* @return Tenant|null|mixed
|
||||
*/
|
||||
function tenant(string $key = null): mixed
|
||||
function tenant(?string $key = null): mixed
|
||||
{
|
||||
if (! app()->bound(Tenant::class)) {
|
||||
return null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue