From b2c42b72a0c2a58a249d035191389bd8343283dd Mon Sep 17 00:00:00 2001 From: Nikola Jovanovic <62754661+nikola-jovanovic-php@users.noreply.github.com> Date: Wed, 13 Mar 2024 13:18:36 +0100 Subject: [PATCH 1/2] fix php 8.2 deprecation (#1) --- src/Gaufrette/StreamWrapper.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Gaufrette/StreamWrapper.php b/src/Gaufrette/StreamWrapper.php index 4497af37..a343f715 100644 --- a/src/Gaufrette/StreamWrapper.php +++ b/src/Gaufrette/StreamWrapper.php @@ -14,6 +14,12 @@ class StreamWrapper private $stream; + /** + * @var ?resource + * @see https://www.php.net/manual/en/class.streamwrapper.php#streamwrapper.props.context + */ + public $context; + /** * Defines the filesystem map. * From 3700a58fe8aeadbd7194811c505136d227d656ce Mon Sep 17 00:00:00 2001 From: Nikola Jovanovic <62754661+nikola-jovanovic-php@users.noreply.github.com> Date: Wed, 15 Jan 2025 15:41:50 +0100 Subject: [PATCH 2/2] fix implicitly marking as nullable (#2) --- src/Gaufrette/Adapter/AzureBlobStorage.php | 12 ++++++------ src/Gaufrette/Exception/FileAlreadyExists.php | 2 +- src/Gaufrette/Exception/FileNotFound.php | 2 +- src/Gaufrette/Exception/UnexpectedFile.php | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Gaufrette/Adapter/AzureBlobStorage.php b/src/Gaufrette/Adapter/AzureBlobStorage.php index c153f9c0..632e86dc 100644 --- a/src/Gaufrette/Adapter/AzureBlobStorage.php +++ b/src/Gaufrette/Adapter/AzureBlobStorage.php @@ -97,12 +97,12 @@ public function setCreateContainerOptions(CreateContainerOptions $options) /** * Creates a new container. * - * @param string $containerName - * @param \MicrosoftAzure\Storage\Blob\Models\CreateContainerOptions $options + * @param string $containerName + * @param \MicrosoftAzure\Storage\Blob\Models\CreateContainerOptions|null $options * * @throws \RuntimeException if cannot create the container */ - public function createContainer($containerName, CreateContainerOptions $options = null) + public function createContainer($containerName, ?CreateContainerOptions $options = null) { $this->init(); @@ -129,12 +129,12 @@ public function createContainer($containerName, CreateContainerOptions $options /** * Deletes a container. * - * @param string $containerName - * @param BlobServiceOptions $options + * @param string $containerName + * @param BlobServiceOptions|null $options * * @throws \RuntimeException if cannot delete the container */ - public function deleteContainer($containerName, BlobServiceOptions $options = null) + public function deleteContainer($containerName, ?BlobServiceOptions $options = null) { $this->init(); diff --git a/src/Gaufrette/Exception/FileAlreadyExists.php b/src/Gaufrette/Exception/FileAlreadyExists.php index b58b5337..190cebb6 100644 --- a/src/Gaufrette/Exception/FileAlreadyExists.php +++ b/src/Gaufrette/Exception/FileAlreadyExists.php @@ -13,7 +13,7 @@ class FileAlreadyExists extends \RuntimeException implements Exception { private $key; - public function __construct($key, $code = 0, \Exception $previous = null) + public function __construct($key, $code = 0, ?\Exception $previous = null) { $this->key = $key; diff --git a/src/Gaufrette/Exception/FileNotFound.php b/src/Gaufrette/Exception/FileNotFound.php index 840ab997..b6f6b215 100644 --- a/src/Gaufrette/Exception/FileNotFound.php +++ b/src/Gaufrette/Exception/FileNotFound.php @@ -13,7 +13,7 @@ class FileNotFound extends \RuntimeException implements Exception { private $key; - public function __construct($key, $code = 0, \Exception $previous = null) + public function __construct($key, $code = 0, ?\Exception $previous = null) { $this->key = $key; diff --git a/src/Gaufrette/Exception/UnexpectedFile.php b/src/Gaufrette/Exception/UnexpectedFile.php index 38749c2f..9744e749 100644 --- a/src/Gaufrette/Exception/UnexpectedFile.php +++ b/src/Gaufrette/Exception/UnexpectedFile.php @@ -13,7 +13,7 @@ class UnexpectedFile extends \RuntimeException implements Exception { private $key; - public function __construct($key, $code = 0, \Exception $previous = null) + public function __construct($key, $code = 0, ?\Exception $previous = null) { $this->key = $key;