Skip to content

Commit 7d3ea94

Browse files
committed
Last tweaks and tests
1 parent b141f9f commit 7d3ea94

File tree

2 files changed

+31
-6
lines changed

2 files changed

+31
-6
lines changed

.editorconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
end_of_line = lf
7+
indent_size = 4
8+
indent_style = space
9+
insert_final_newline = true
10+
max_line_length = 120
11+
trim_trailing_whitespace = true
12+
13+
[*.md]
14+
max_line_length = 0
15+
trim_trailing_whitespace = false
16+
17+
[*.{json,yml,yaml,js,sh,m4,ac}]
18+
indent_size = 2
19+
20+
[COMMIT_EDITMSG]
21+
max_line_length = 0

src/AzureBlobStorageAdapter.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
use League\MimeTypeDetection\FinfoMimeTypeDetector;
3333
use League\MimeTypeDetection\MimeTypeDetector;
3434

35-
class AzureBlobStorageAdapter implements FilesystemAdapter, ChecksumProvider, TemporaryUrlGenerator
35+
final class AzureBlobStorageAdapter implements FilesystemAdapter, ChecksumProvider, TemporaryUrlGenerator
3636
{
3737
public const ON_VISIBILITY_THROW_ERROR = 'throw';
3838
public const ON_VISIBILITY_IGNORE = 'ignore';
@@ -56,7 +56,7 @@ public function fileExists(string $path): bool
5656
return $this->containerClient
5757
->getBlobClient($this->prefixer->prefixPath($path))
5858
->exists();
59-
} catch(\Throwable $e) {
59+
} catch (\Throwable $e) {
6060
throw UnableToCheckExistence::forLocation($path, $e);
6161
}
6262
}
@@ -66,7 +66,12 @@ public function directoryExists(string $path): bool
6666
try {
6767
$options = new GetBlobsOptions(pageSize: 1);
6868

69-
foreach($this->containerClient->getBlobs($this->prefixer->prefixDirectoryPath($path), $options) as $ignored) {
69+
foreach (
70+
$this->containerClient->getBlobs(
71+
$this->prefixer->prefixDirectoryPath($path),
72+
$options
73+
) as $ignored
74+
) {
7075
return true;
7176
};
7277

@@ -129,7 +134,7 @@ public function readStream(string $path)
129134

130135
$resource = $result->content->detach();
131136

132-
if($resource === null) {
137+
if ($resource === null) {
133138
throw new \Exception("Should not happen");
134139
}
135140

@@ -285,8 +290,7 @@ public function temporaryUrl(string $path, \DateTimeInterface $expiresAt, Config
285290
->getBlobClient($this->prefixer->prefixPath($path))
286291
->generateSasUri($sasBuilder);
287292

288-
return (string) $sas;
289-
293+
return (string)$sas;
290294
}
291295

292296
public function checksum(string $path, Config $config): string

0 commit comments

Comments
 (0)