From 701a428bb43998867a72ae2d99085d7c812dcf57 Mon Sep 17 00:00:00 2001 From: Matthew Daly <450801+matthewbdaly@users.noreply.github.com> Date: Sun, 15 Nov 2020 15:45:15 +0000 Subject: [PATCH] Fixed some type issues --- src/AzureBlobStorageAdapter.php | 8 +++++--- src/AzureStorageServiceProvider.php | 9 ++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/AzureBlobStorageAdapter.php b/src/AzureBlobStorageAdapter.php index c9c578a..87aa9c7 100644 --- a/src/AzureBlobStorageAdapter.php +++ b/src/AzureBlobStorageAdapter.php @@ -4,8 +4,8 @@ use Illuminate\Support\Arr; use League\Flysystem\AzureBlobStorage\AzureBlobStorageAdapter as BaseAzureBlobStorageAdapter; -use MicrosoftAzure\Storage\Blob\BlobRestProxy; use Matthewbdaly\LaravelAzureStorage\Exceptions\InvalidCustomUrl; +use MicrosoftAzure\Storage\Blob\BlobRestProxy; use MicrosoftAzure\Storage\Blob\BlobSharedAccessSignatureHelper; use MicrosoftAzure\Storage\Common\Internal\Resources; @@ -33,14 +33,14 @@ final class AzureBlobStorageAdapter extends BaseAzureBlobStorageAdapter /** * Custom url for getUrl() * - * @var string + * @var string|null */ private $url; /** * The account key to access the storage * - * @var string + * @var string|null */ private $key; @@ -71,6 +71,7 @@ public function __construct(BlobRestProxy $client, string $container, string $ke * Get the file URL by given path. * * @param string $path Path. + * * @return string */ public function getUrl(string $path) @@ -87,6 +88,7 @@ public function getUrl(string $path) * @param string $path * @param \Datetime|string $ttl * @param array $options + * * @return string */ public function getTemporaryUrl(string $path, $ttl, array $options = []) diff --git a/src/AzureStorageServiceProvider.php b/src/AzureStorageServiceProvider.php index 57bf72e..45eac00 100644 --- a/src/AzureStorageServiceProvider.php +++ b/src/AzureStorageServiceProvider.php @@ -7,9 +7,10 @@ use Illuminate\Support\Arr; use Illuminate\Support\Facades\Storage; use Illuminate\Support\ServiceProvider; -use League\Flysystem\Filesystem; +use League\Flysystem\Cached\CacheInterface; use League\Flysystem\Cached\CachedAdapter; use League\Flysystem\Cached\Storage\Memory as MemoryStore; +use League\Flysystem\Filesystem; use Matthewbdaly\LaravelAzureStorage\Exceptions\CacheAdapterNotInstalled; use MicrosoftAzure\Storage\Blob\BlobRestProxy; use MicrosoftAzure\Storage\Common\Middlewares\RetryMiddleware; @@ -94,11 +95,12 @@ public function register() * Create a cache store instance. * * @param mixed $config + * * @return \League\Flysystem\Cached\CacheInterface * * @throws \InvalidArgumentException */ - protected function createCacheStore($config) + protected function createCacheStore($config): CacheInterface { if ($config === true) { return new MemoryStore(); @@ -115,9 +117,10 @@ protected function createCacheStore($config) * Create retry middleware instance. * * @param array $config + * * @return RetryMiddleware */ - protected function createRetryMiddleware($config) + protected function createRetryMiddleware(array $config): RetryMiddleware { return RetryMiddlewareFactory::create( RetryMiddlewareFactory::GENERAL_RETRY_TYPE,