1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 12:54:05 +00:00

phpcsfixer: enable nullable_type_declaration_for_default_null_value

This commit is contained in:
Samuel Štancl 2024-04-09 20:55:49 +02:00
parent eecf6f21c8
commit 20c1b9a940
6 changed files with 10 additions and 9 deletions

View file

@ -4,6 +4,7 @@ use PhpCsFixer\Config;
use PhpCsFixer\Finder; use PhpCsFixer\Finder;
$rules = [ $rules = [
'nullable_type_declaration_for_default_null_value' => true,
'single_line_empty_body' => true, 'single_line_empty_body' => true,
'array_syntax' => ['syntax' => 'short'], 'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [ 'binary_operator_spaces' => [

View file

@ -74,12 +74,12 @@ class Install extends Command
*/ */
protected function step( protected function step(
string $name, string $name,
Closure $task = null, ?Closure $task = null,
bool $unless = false, bool $unless = false,
string $warning = null, ?string $warning = null,
string $file = null, ?string $file = null,
string $tag = null, ?string $tag = null,
array $files = null, ?array $files = null,
bool $newLineBefore = false, bool $newLineBefore = false,
bool $newLineAfter = false, bool $newLineAfter = false,
): void { ): void {

View file

@ -42,7 +42,7 @@ class TenantAssetController implements HasMiddleware
/** /**
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException * @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); $this->validatePath($path);

View file

@ -30,7 +30,7 @@ class UserImpersonation implements Feature
} }
/** Impersonate a user and get an HTTP redirect response. */ /** 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 */ /** @var ImpersonationToken $token */
$token = $token instanceof ImpersonationToken ? $token : ImpersonationToken::findOrFail($token); $token = $token instanceof ImpersonationToken ? $token : ImpersonationToken::findOrFail($token);

View file

@ -151,7 +151,7 @@ class Tenancy
/** /**
* Try to find a tenant using an ID. * 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 */ /** @var (Tenant&Model)|null $tenant */
$tenant = static::model()->with($withRelations ? static::$findWith : [])->firstWhere($column ?? static::model()->getTenantKeyName(), $id); $tenant = static::model()->with($withRelations ? static::$findWith : [])->firstWhere($column ?? static::model()->getTenantKeyName(), $id);

View file

@ -20,7 +20,7 @@ if (! function_exists('tenant')) {
* *
* @return Tenant|null|mixed * @return Tenant|null|mixed
*/ */
function tenant(string $key = null): mixed function tenant(?string $key = null): mixed
{ {
if (! app()->bound(Tenant::class)) { if (! app()->bound(Tenant::class)) {
return null; return null;