Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

explicitly declare implicit nullable parameter declarations #254

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/DataCollector/PwaCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function __construct(
) {
}

public function collect(Request $request, Response $response, Throwable $exception = null): void
public function collect(Request $request, Response $response, ?Throwable $exception = null): void
{
$jsonOptions = [
AbstractObjectNormalizer::SKIP_UNINITIALIZED_VALUES => true,
Expand Down
8 changes: 4 additions & 4 deletions src/Normalizer/AssetNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function __construct(
/**
* @return array{src: string, sizes?: string, form_factor?: string, label?: string, platform?: string, format?: string}
*/
public function normalize(mixed $object, string $format = null, array $context = []): string
public function normalize(mixed $object, ?string $format = null, array $context = []): string
{
assert($object instanceof Asset);
$url = null;
Expand All @@ -36,22 +36,22 @@ public function normalize(mixed $object, string $format = null, array $context =
return $url;
}

public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed
public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed
{
assert(is_string($data));

return Asset::create($data);
}

public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool
public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool
{
return $data instanceof Asset;
}

public function supportsDenormalization(
mixed $data,
string $type,
string $format = null,
?string $format = null,
array $context = []
): bool {
return $type === Asset::class;
Expand Down
4 changes: 2 additions & 2 deletions src/Normalizer/IconNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function __construct(
/**
* @return array{src: string, sizes?: string, type?: string, purpose?: string}
*/
public function normalize(mixed $object, string $format = null, array $context = []): array
public function normalize(mixed $object, ?string $format = null, array $context = []): array
{
assert($object instanceof Icon);
$icon = $this->iconResolver->getIcon($object);
Expand All @@ -44,7 +44,7 @@ public function normalize(mixed $object, string $format = null, array $context =
return $cleanup($result);
}

public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool
public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool
{
return $data instanceof Icon;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Normalizer/ScreenshotNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function __construct(
/**
* @return array{src: string, sizes?: string, form_factor?: string, label?: string, platform?: string, format?: string}
*/
public function normalize(mixed $object, string $format = null, array $context = []): array
public function normalize(mixed $object, ?string $format = null, array $context = []): array
{
assert($object instanceof Screenshot);
$asset = null;
Expand All @@ -55,7 +55,7 @@ public function normalize(mixed $object, string $format = null, array $context =
return $cleanup($result);
}

public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool
public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool
{
return $data instanceof Screenshot;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Normalizer/ServiceWorkerNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/**
* @return array{scope?: string, src: string, use_cache?: bool}
*/
public function normalize(mixed $object, string $format = null, array $context = []): array
public function normalize(mixed $object, ?string $format = null, array $context = []): array
{
assert($object instanceof ServiceWorker);

Expand All @@ -30,7 +30,7 @@ public function normalize(mixed $object, string $format = null, array $context =
return $cleanup($result);
}

public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool
public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool
{
return $data instanceof ServiceWorker;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Normalizer/UrlNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct(
) {
}

public function normalize(mixed $object, string $format = null, array $context = []): string
public function normalize(mixed $object, ?string $format = null, array $context = []): string
{
assert($object instanceof Url);

Expand All @@ -48,7 +48,7 @@ public function normalize(mixed $object, string $format = null, array $context =
}
}

public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool
public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool
{
return $data instanceof Url;
}
Expand Down
Loading