mirror of
https://github.com/Intervention/image.git
synced 2025-08-22 05:22:50 +02:00
Add DriverInterface::version() and make method non-static
This commit is contained in:
@@ -156,7 +156,7 @@ class Driver extends AbstractDriver
|
||||
/**
|
||||
* Return version of GD library
|
||||
*/
|
||||
public static function version(): string
|
||||
public function version(): string
|
||||
{
|
||||
return gd_info()['GD Version'];
|
||||
}
|
||||
|
@@ -160,7 +160,7 @@ class Driver extends AbstractDriver
|
||||
*
|
||||
* @throws DriverException
|
||||
*/
|
||||
public static function version(): string
|
||||
public function version(): string
|
||||
{
|
||||
$pattern = '/^ImageMagick (?P<version>(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)' .
|
||||
'(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?' .
|
||||
|
@@ -89,4 +89,11 @@ interface DriverInterface
|
||||
* underlying PHP extension was built with support for the format.
|
||||
*/
|
||||
public function supports(string|Format|FileExtension|MediaType $identifier): bool;
|
||||
|
||||
/**
|
||||
* Return the version number of the image driver currently in use.
|
||||
*
|
||||
* @throws DriverException
|
||||
*/
|
||||
public function version(): string;
|
||||
}
|
||||
|
Reference in New Issue
Block a user