Skip to content

Commit a291469

Browse files
committed
rename for clarity
1 parent d18b37a commit a291469

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/Form/Fields/Formatters/UploadFormatter.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ public function fromFront(SharpFormField $field, string $attribute, $value): ?ar
6565
);
6666
}
6767

68-
if ($size = $this->getImageSize($uploadedFieldRelativePath, $formatted['mime_type'])) {
69-
$formatted['width'] = $size['width'];
70-
$formatted['height'] = $size['height'];
68+
if ($dimensions = $this->getImageDimensions($uploadedFieldRelativePath, $formatted['mime_type'])) {
69+
$formatted['width'] = $dimensions['width'];
70+
$formatted['height'] = $dimensions['height'];
7171
}
7272
});
7373
}
@@ -115,7 +115,7 @@ protected function normalizeFromFront(?array $value, ?array $formatted = null):
115115
])->whereNotNull()->toArray();
116116
}
117117

118-
protected function getImageSize(string $filePath, string $mimeType): ?array
118+
protected function getImageDimensions(string $tmpFilePath, string $mimeType): ?array
119119
{
120120
// image size only available if tmp is stored locally
121121
if (! Storage::disk(sharp()->config()->get('uploads.tmp_disk')) instanceof LocalFilesystemAdapter) {
@@ -126,7 +126,7 @@ protected function getImageSize(string $filePath, string $mimeType): ?array
126126
return null;
127127
}
128128

129-
$realPath = Storage::disk(sharp()->config()->get('uploads.tmp_disk'))->path($filePath);
129+
$realPath = Storage::disk(sharp()->config()->get('uploads.tmp_disk'))->path($tmpFilePath);
130130

131131
if ($size = @getimagesize($realPath)) {
132132
return [

0 commit comments

Comments
 (0)