1
0
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:
Oliver Vogel
2025-08-23 08:11:32 +02:00
parent 0b33e448c0
commit 8a2e83d475
3 changed files with 7 additions and 8 deletions

View File

@@ -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()`

View File

@@ -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();
}

View File

@@ -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
*/