1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-22 21:42:53 +02:00

Add init method to DrawableFactoryInterface::class

This commit is contained in:
Oliver Vogel
2024-06-09 11:44:49 +02:00
parent d3a044e883
commit 36ca199d1b
7 changed files with 68 additions and 0 deletions

View File

@@ -28,6 +28,16 @@ class BezierFactory implements DrawableFactoryInterface
}
}
/**
* {@inheritdoc}
*
* @see DrawableFactoryInterface::init()
*/
public static function init(null|callable|DrawableInterface $init = null): self
{
return new self($init);
}
/**
* {@inheritdoc}
*

View File

@@ -33,6 +33,16 @@ class CircleFactory implements DrawableFactoryInterface
}
}
/**
* {@inheritdoc}
*
* @see DrawableFactoryInterface::init()
*/
public static function init(null|callable|DrawableInterface $init = null): self
{
return new self(init: $init);
}
/**
* {@inheritdoc}
*

View File

@@ -33,6 +33,16 @@ class EllipseFactory implements DrawableFactoryInterface
}
}
/**
* {@inheritdoc}
*
* @see DrawableFactoryInterface::init()
*/
public static function init(null|callable|DrawableInterface $init = null): self
{
return new self(init: $init);
}
/**
* {@inheritdoc}
*

View File

@@ -28,6 +28,16 @@ class LineFactory implements DrawableFactoryInterface
}
}
/**
* {@inheritdoc}
*
* @see DrawableFactoryInterface::init()
*/
public static function init(null|callable|DrawableInterface $init = null): self
{
return new self($init);
}
/**
* {@inheritdoc}
*

View File

@@ -28,6 +28,16 @@ class PolygonFactory implements DrawableFactoryInterface
}
}
/**
* {@inheritdoc}
*
* @see DrawableFactoryInterface::init()
*/
public static function init(null|callable|DrawableInterface $init = null): self
{
return new self($init);
}
/**
* {@inheritdoc}
*

View File

@@ -33,6 +33,16 @@ class RectangleFactory implements DrawableFactoryInterface
}
}
/**
* {@inheritdoc}
*
* @see DrawableFactoryInterface::init()
*/
public static function init(null|callable|DrawableInterface $init = null): self
{
return new self(init: $init);
}
/**
* {@inheritdoc}
*

View File

@@ -6,6 +6,14 @@ namespace Intervention\Image\Interfaces;
interface DrawableFactoryInterface
{
/**
* Create a new factory instance statically
*
* @param null|callable|DrawableInterface $init
* @return DrawableFactoryInterface
*/
public static function init(null|callable|DrawableInterface $init = null): self;
/**
* Create the end product of the factory
*