Skip to content

Commit

Permalink
Merge pull request #1480 from aleho/master
Browse files Browse the repository at this point in the history
Use explicit nullables types
  • Loading branch information
garak authored Nov 29, 2024
2 parents 7925bea + 4fad8e4 commit 5bbfcb1
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Exception/MissingPackageException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

final class MissingPackageException extends \RuntimeException implements VichUploaderExceptionInterface
{
public function __construct(string $message = '', \Throwable $previous = null)
public function __construct(string $message = '', ?\Throwable $previous = null)
{
parent::__construct($message, 0, $previous);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Form/Type/VichFileType.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function __construct(
protected readonly StorageInterface $storage,
protected readonly UploadHandler $handler,
protected readonly PropertyMappingFactory $factory,
PropertyAccessorInterface $propertyAccessor = null
?PropertyAccessorInterface $propertyAccessor = null
) {
$this->propertyAccessor = $propertyAccessor ?: PropertyAccess::createPropertyAccessor();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Form/Type/VichImageType.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function __construct(
StorageInterface $storage,
UploadHandler $handler,
PropertyMappingFactory $factory,
PropertyAccessorInterface $propertyAccessor = null,
?PropertyAccessorInterface $propertyAccessor = null,
private readonly ?CacheManager $cacheManager = null
) {
parent::__construct($storage, $handler, $factory, $propertyAccessor);
Expand Down
2 changes: 1 addition & 1 deletion src/Handler/DownloadHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ final class DownloadHandler extends AbstractHandler
* @throws NoFileFoundException
* @throws \InvalidArgumentException
*/
public function downloadObject(object|array $object, string $field, ?string $className = null, string|bool $fileName = null, bool $forceDownload = true): StreamedResponse
public function downloadObject(object|array $object, string $field, ?string $className = null, string|bool|null $fileName = null, bool $forceDownload = true): StreamedResponse
{
$mapping = $this->getMapping($object, $field, $className);
$stream = $this->storage->resolveStream($object, $field, $className);
Expand Down
2 changes: 1 addition & 1 deletion src/Metadata/CacheWarmer.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function __construct(private readonly string $dir, private readonly Metad
{
}

public function warmUp(string $cacheDir, string $buildDir = null): array
public function warmUp(string $cacheDir, ?string $buildDir = null): array
{
if (empty($this->dir)) {
return [];
Expand Down
2 changes: 1 addition & 1 deletion src/Metadata/Driver/AbstractYamlDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ protected function loadMappingFile(string $file)
return YmlParser::parse(\file_get_contents($file));
}

protected function guessClassName(string $file, array $config, \ReflectionClass $class = null): string
protected function guessClassName(string $file, array $config, ?\ReflectionClass $class = null): string
{
if (null === $class) {
return \current(\array_keys($config));
Expand Down
2 changes: 1 addition & 1 deletion src/Metadata/Driver/XmlDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected function getExtension(): string
return 'xml';
}

protected function guessClassName(string $file, \SimpleXMLElement $elem, \ReflectionClass $class = null): string
protected function guessClassName(string $file, \SimpleXMLElement $elem, ?\ReflectionClass $class = null): string
{
if (null === $class) {
return (string) $elem->attributes()->class;
Expand Down

0 comments on commit 5bbfcb1

Please sign in to comment.