Skip to content

Commit 56f82a7

Browse files
committed
Fixed phpstan issues
1 parent 4c30cab commit 56f82a7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Services/InfoProviderSystem/DTOtoEntityConverter.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ public function convertPart(PartDetailDTO $dto, Part $entity = new Part()): Part
221221
$attachment = $this->convertFile($image, $image_type);
222222

223223
$attachments_grouped[$attachment->getName()][] = $attachment;
224-
if (count($attachments_grouped[$attachment->getName()] ?? []) > 1) {
224+
if (count($attachments_grouped[$attachment->getName()]) > 1) {
225225
$attachment->setName($attachment->getName() . ' (' . (count($attachments_grouped[$attachment->getName()]) + 1) . ')');
226226
}
227227

@@ -236,7 +236,7 @@ public function convertPart(PartDetailDTO $dto, Part $entity = new Part()): Part
236236
$attachment = $this->convertFile($datasheet, $datasheet_type);
237237

238238
$attachments_grouped[$attachment->getName()][] = $attachment;
239-
if (count($attachments_grouped[$attachment->getName()] ?? []) > 1) {
239+
if (count($attachments_grouped[$attachment->getName()]) > 1) {
240240
$attachment->setName($attachment->getName() . ' (' . (count($attachments_grouped[$attachment->getName()])) . ')');
241241
}
242242

@@ -357,4 +357,4 @@ private function getImageType(): AttachmentType
357357
return $tmp;
358358
}
359359

360-
}
360+
}

src/Twig/FormatExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function amountFormat($value, ?MeasurementUnit $unit, array $options = []
8282
public function formatBytes(int $bytes, int $precision = 2): string
8383
{
8484
$size = ['B','kB','MB','GB','TB','PB','EB','ZB','YB'];
85-
$factor = floor((strlen((string) $bytes) - 1) / 3);
85+
$factor = (int) floor((strlen((string) $bytes) - 1) / 3);
8686
//We use the real (10 based) SI prefix here
8787
return sprintf("%.{$precision}f", $bytes / (1000 ** $factor)) . ' ' . @$size[$factor];
8888
}

0 commit comments

Comments
 (0)