mirror of
https://github.com/Intervention/image.git
synced 2025-09-01 09:52:59 +02:00
Add DriverInterface::__construct()
This commit is contained in:
@@ -27,3 +27,4 @@
|
|||||||
- Signature of ImageInterface::place() changed `offset_x` is no `x` and `offset_y` is now `y`
|
- Signature of ImageInterface::place() changed `offset_x` is no `x` and `offset_y` is now `y`
|
||||||
- EncodedImageInterface::toDataUri() now returns `DataUriInterface` instead of `string´
|
- EncodedImageInterface::toDataUri() now returns `DataUriInterface` instead of `string´
|
||||||
- ProfileInterface requires implementation of `::fromPath()`
|
- ProfileInterface requires implementation of `::fromPath()`
|
||||||
|
- DriverInterface requires implementation of `__construct()`
|
||||||
|
@@ -23,18 +23,11 @@ use ReflectionClass;
|
|||||||
|
|
||||||
abstract class AbstractDriver implements DriverInterface
|
abstract class AbstractDriver implements DriverInterface
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Driver options
|
|
||||||
*/
|
|
||||||
protected Config $config;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws DriverException
|
* @throws DriverException
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct(protected Config $config = new Config())
|
||||||
{
|
{
|
||||||
$this->config = new Config();
|
|
||||||
$this->checkHealth();
|
$this->checkHealth();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -15,6 +15,11 @@ use Intervention\Image\MediaType;
|
|||||||
|
|
||||||
interface DriverInterface
|
interface DriverInterface
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Create new driver instance with configuration
|
||||||
|
*/
|
||||||
|
public function __construct(Config $config);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return drivers unique id
|
* Return drivers unique id
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user