mirror of
https://github.com/Intervention/image.git
synced 2025-08-23 05:52:47 +02:00
Add init method to DrawableFactoryInterface::class
This commit is contained in:
@@ -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}
|
* {@inheritdoc}
|
||||||
*
|
*
|
||||||
|
@@ -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}
|
* {@inheritdoc}
|
||||||
*
|
*
|
||||||
|
@@ -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}
|
* {@inheritdoc}
|
||||||
*
|
*
|
||||||
|
@@ -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}
|
* {@inheritdoc}
|
||||||
*
|
*
|
||||||
|
@@ -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}
|
* {@inheritdoc}
|
||||||
*
|
*
|
||||||
|
@@ -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}
|
* {@inheritdoc}
|
||||||
*
|
*
|
||||||
|
@@ -6,6 +6,14 @@ namespace Intervention\Image\Interfaces;
|
|||||||
|
|
||||||
interface DrawableFactoryInterface
|
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
|
* Create the end product of the factory
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user