mirror of
https://github.com/Intervention/image.git
synced 2025-08-12 00:43:59 +02:00
Move method from trait to AbstractImage
This commit is contained in:
@@ -17,16 +17,23 @@ use Intervention\Image\Interfaces\ModifierInterface;
|
|||||||
use Intervention\Image\Interfaces\SizeInterface;
|
use Intervention\Image\Interfaces\SizeInterface;
|
||||||
use Intervention\Image\Traits\CanHandleInput;
|
use Intervention\Image\Traits\CanHandleInput;
|
||||||
use Intervention\Image\Traits\CanResolveDriverClass;
|
use Intervention\Image\Traits\CanResolveDriverClass;
|
||||||
use Intervention\Image\Traits\CanRunCallback;
|
|
||||||
|
|
||||||
abstract class AbstractImage implements ImageInterface
|
abstract class AbstractImage implements ImageInterface
|
||||||
{
|
{
|
||||||
use CanResolveDriverClass;
|
use CanResolveDriverClass;
|
||||||
use CanHandleInput;
|
use CanHandleInput;
|
||||||
use CanRunCallback;
|
|
||||||
|
|
||||||
protected Collection $exif;
|
protected Collection $exif;
|
||||||
|
|
||||||
|
protected function runCallback(?callable $callback, object $object): object
|
||||||
|
{
|
||||||
|
if (is_callable($callback)) {
|
||||||
|
$callback($object);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $object;
|
||||||
|
}
|
||||||
|
|
||||||
public function mapFrames(callable $callback): ImageInterface
|
public function mapFrames(callable $callback): ImageInterface
|
||||||
{
|
{
|
||||||
foreach ($this as $frame) {
|
foreach ($this as $frame) {
|
||||||
|
@@ -1,15 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Intervention\Image\Traits;
|
|
||||||
|
|
||||||
trait CanRunCallback
|
|
||||||
{
|
|
||||||
protected function runCallback(?callable $callback, object $object): object
|
|
||||||
{
|
|
||||||
if (is_callable($callback)) {
|
|
||||||
$callback($object);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $object;
|
|
||||||
}
|
|
||||||
}
|
|
Reference in New Issue
Block a user