mirror of
https://github.com/Intervention/image.git
synced 2025-08-23 05:52:47 +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
|
* Return version of GD library
|
||||||
*/
|
*/
|
||||||
public static function version(): string
|
public function version(): string
|
||||||
{
|
{
|
||||||
return gd_info()['GD Version'];
|
return gd_info()['GD Version'];
|
||||||
}
|
}
|
||||||
|
@@ -160,7 +160,7 @@ class Driver extends AbstractDriver
|
|||||||
*
|
*
|
||||||
* @throws DriverException
|
* @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*)' .
|
$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-]*))*))?' .
|
'(?:-((?: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.
|
* underlying PHP extension was built with support for the format.
|
||||||
*/
|
*/
|
||||||
public function supports(string|Format|FileExtension|MediaType $identifier): bool;
|
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