Skip to content

Commit 79dfed5

Browse files
committed
Use Image::setInstance method
1 parent 0c9434f commit 79dfed5

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/Image.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function __construct(string $filename)
8888
"Image of type '{$this->getType()}' does not returned a GdImage instance"
8989
);
9090
}
91-
$this->instance = $instance;
91+
$this->setInstance($instance);
9292
}
9393

9494
public function __toString() : string
@@ -391,7 +391,7 @@ public function crop(int $width, int $height, int $marginLeft = 0, int $marginTo
391391
if ($crop === false) {
392392
throw new RuntimeException('Image could not to crop');
393393
}
394-
$this->instance = $crop;
394+
$this->setInstance($crop);
395395
return $this;
396396
}
397397

@@ -487,7 +487,7 @@ public function flatten(int $red = 255, int $green = 255, int $blue = 255) : sta
487487
if ($copied === false) {
488488
throw new RuntimeException('Image could not to flatten');
489489
}
490-
$this->instance = $image;
490+
$this->setInstance($image);
491491
return $this;
492492
}
493493

@@ -547,7 +547,7 @@ public function rotate(float $angle) : static
547547
if ($rotate === false) {
548548
throw new RuntimeException('Image could not to rotate');
549549
}
550-
$this->instance = $rotate;
550+
$this->setInstance($rotate);
551551
return $this;
552552
}
553553

@@ -591,7 +591,7 @@ public function scale(int $width, int $height = -1) : static
591591
if ($scale === false) {
592592
throw new RuntimeException('Image could not to scale');
593593
}
594-
$this->instance = $scale;
594+
$this->setInstance($scale);
595595
return $this;
596596
}
597597

0 commit comments

Comments
 (0)