mirror of
https://github.com/Intervention/image.git
synced 2025-08-30 09:10:21 +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`
|
||||
- EncodedImageInterface::toDataUri() now returns `DataUriInterface` instead of `string´
|
||||
- ProfileInterface requires implementation of `::fromPath()`
|
||||
- DriverInterface requires implementation of `__construct()`
|
||||
|
@@ -23,18 +23,11 @@ use ReflectionClass;
|
||||
|
||||
abstract class AbstractDriver implements DriverInterface
|
||||
{
|
||||
/**
|
||||
* Driver options
|
||||
*/
|
||||
protected Config $config;
|
||||
|
||||
/**
|
||||
* @throws DriverException
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
public function __construct(protected Config $config = new Config())
|
||||
{
|
||||
$this->config = new Config();
|
||||
$this->checkHealth();
|
||||
}
|
||||
|
||||
|
@@ -15,6 +15,11 @@ use Intervention\Image\MediaType;
|
||||
|
||||
interface DriverInterface
|
||||
{
|
||||
/**
|
||||
* Create new driver instance with configuration
|
||||
*/
|
||||
public function __construct(Config $config);
|
||||
|
||||
/**
|
||||
* Return drivers unique id
|
||||
*/
|
||||
|
Reference in New Issue
Block a user