Skip to content

Commit e3806de

Browse files
authored
refactor: fix null checks that are always false (#10670)
1 parent 71519bf commit e3806de

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

‎system/Images/Handlers/ImageMagickHandler.php‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -318,13 +318,10 @@ public function save(?string $target = null, int $quality = 90): bool
318318
}
319319

320320
$this->ensureResource();
321-
322321
$this->resource->setImageCompressionQuality($quality);
323322

324-
if ($target !== null) {
325-
$extension = pathinfo($target, PATHINFO_EXTENSION);
326-
$this->resource->setImageFormat($extension);
327-
}
323+
$extension = pathinfo($target, PATHINFO_EXTENSION);
324+
$this->resource->setImageFormat($extension);
328325

329326
try {
330327
$result = $this->resource->writeImage($target);

‎system/Images/Image.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function copy(string $targetPath, ?string $targetName = null, int $perms
7373

7474
$targetName ??= $this->getFilename();
7575

76-
if ($targetName === null || $targetName === '') {
76+
if ($targetName === '') {
7777
throw ImageException::forInvalidFile($targetName);
7878
}
7979

0 commit comments

Comments
 (0)