diff --git a/Imagick.stub.php b/Imagick.stub.php index 5f72c18f..9d27488d 100755 --- a/Imagick.stub.php +++ b/Imagick.stub.php @@ -12,7 +12,7 @@ public function compareImageLayers(int $metric): Imagick {} public function pingImageBlob(string $image): bool {} - public function pingImageFile(resource $filehandle, ?string $filename=null): bool {} + public function pingImageFile(resource $filehandle, ?string $filename = null): bool {} public function transposeImage(): bool {} @@ -195,9 +195,9 @@ public function getImageProfiles(string $pattern = "*", bool $include_values = t // DISTORTION_* public function distortImage(int $distortion, array $arguments, bool $bestfit): bool {} - public function writeImageFile(resource $filehandle, ?string $format=null): bool {} + public function writeImageFile(resource $filehandle, ?string $format = null): bool {} - public function writeImagesFile(resource $filehandle, ?string $format=null): bool {} + public function writeImagesFile(resource $filehandle, ?string $format = null): bool {} public function resetImagePage(string $page): bool {} @@ -435,7 +435,7 @@ public function smushImages(bool $stack, int $offset): Imagick {} // PHP_ME(imagick, __construct, imagick_construct_args, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) // TODO int|float? :spocks_eyebrow.gif: - public function __construct(string|array|int|float|null $files=null) {} + public function __construct(string|array|int|float|null $files = null) {} public function __toString(): string {} @@ -456,13 +456,13 @@ public function readImage(string $filename): bool {} public function readImages(array $filenames): bool {} - public function readImageBlob(string $image, ?string $filename=null): bool {} + public function readImageBlob(string $image, ?string $filename = null): bool {} public function setImageFormat(string $format): bool {} public function scaleImage(int $columns, int $rows, bool $bestfit = false, bool $legacy = false): bool {} - public function writeImage(?string $filename=null): bool {} + public function writeImage(?string $filename = null): bool {} public function writeImages(string $filename, bool $adjoin): bool {} @@ -710,7 +710,7 @@ public static function queryFormats(string $pattern = "*"): array {} public static function queryFonts(string $pattern = "*"): array {} /* TODO $multiline == null, means we should autodetect */ - public function queryFontMetrics(ImagickDraw $settings, string $text, ?bool $multiline=null): array {} + public function queryFontMetrics(ImagickDraw $settings, string $text, ?bool $multiline = null): array {} public function steganoImage(Imagick $watermark, int $offset): Imagick {} @@ -1127,7 +1127,7 @@ public function newImage( int $columns, int $rows, ImagickPixel|string $background_color, - string $format=null + string $format = null ): bool {} // TODO - canvas? description @@ -1139,7 +1139,7 @@ public function getCompressionQuality(): int {} public static function getCopyright(): string {} - public static function getConfigureOptions(string $pattern="*"): string {} + public static function getConfigureOptions(string $pattern = "*"): string {} #if MagickLibVersion > 0x660 @@ -1266,10 +1266,10 @@ public function statisticImage( #endif #if MagickLibVersion >= 0x652 - public function subimageMatch(Imagick $image, ?array &$offset=null, ?float &$similarity=null, float $threshold = 0.0, int metric=0): Imagick {} + public function subimageMatch(Imagick $image, ?array &$offset = null, ?float &$similarity = null, float $threshold = 0.0, int $metric = 0): Imagick {} /** @alias Imagick::subimageMatch */ - public function similarityimage(imagick $image, ?array &$offset=null, ?float &$similarity=null, float $threshold = 0.0, int metric=0): Imagick {} + public function similarityimage(imagick $image, ?array &$offset = null, ?float &$similarity = null, float $threshold = 0.0, int $metric = 0): Imagick {} #endif public static function setRegistry(string $key, string $value): bool {} diff --git a/Imagick_arginfo.h b/Imagick_arginfo.h index a5768b84..21edba14 100644 --- a/Imagick_arginfo.h +++ b/Imagick_arginfo.h @@ -62,12 +62,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_pingImageFile, 0, 0, 1) ZEND_ARG_INFO(0, filehandle) #endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, filename, IS_STRING, 1, "null") -#else - ZEND_ARG_INFO(0, filename) -#endif + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, filename, IS_STRING, 1, "null") ZEND_END_ARG_INFO() #endif @@ -827,12 +822,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_writeImageFile, 0, 0, 1) ZEND_ARG_INFO(0, filehandle) #endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, format, IS_STRING, 1, "null") -#else - ZEND_ARG_INFO(0, format) -#endif + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, format, IS_STRING, 1, "null") ZEND_END_ARG_INFO() #endif @@ -1679,13 +1669,7 @@ ZEND_END_ARG_INFO() #endif ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick___construct, 0, 0, 0) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_MASK(0, files, MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_NULL, "null") -#else - ZEND_ARG_INFO(0, files) -#endif - + ZEND_ARG_TYPE_MASK(0, files, MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_NULL, "null") ZEND_END_ARG_INFO() @@ -1805,12 +1789,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_readImageBlob, 0, 0, 1) #else ZEND_ARG_INFO(0, image) #endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, filename, IS_STRING, 1, "null") -#else - ZEND_ARG_INFO(0, filename) -#endif + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, filename, IS_STRING, 1, "null") ZEND_END_ARG_INFO() @@ -1858,12 +1837,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_writeImage, 0, 0, ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_writeImage, 0, 0, 0) #endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, filename, IS_STRING, 1, "null") -#else - ZEND_ARG_INFO(0, filename) -#endif + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, filename, IS_STRING, 1, "null") ZEND_END_ARG_INFO() @@ -1906,12 +1880,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_blurImage, 0, 0, 2) #else ZEND_ARG_INFO(0, sigma) #endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") -#else - ZEND_ARG_INFO(0, channel) -#endif + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") ZEND_END_ARG_INFO() @@ -2913,27 +2882,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageUnits, 0, 0, 1) #endif ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_sharpenImage, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_sharpenImage, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, radius, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, radius) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, sigma, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, sigma) -#endif - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") -ZEND_END_ARG_INFO() +#define arginfo_class_Imagick_sharpenImage arginfo_class_Imagick_blurImage #define arginfo_class_Imagick_shaveImage arginfo_class_Imagick_sampleImage @@ -3042,12 +2991,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_queryFontMetrics, 0, 0, 2) #else ZEND_ARG_INFO(0, text) #endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, multiline, _IS_BOOL, 1, "null") -#else - ZEND_ARG_INFO(0, multiline) -#endif + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, multiline, _IS_BOOL, 1, "null") ZEND_END_ARG_INFO() @@ -3540,7 +3484,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_gammaImage, 0, 0, 1) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") ZEND_END_ARG_INFO() -#define arginfo_class_Imagick_gaussianBlurImage arginfo_class_Imagick_sharpenImage +#define arginfo_class_Imagick_gaussianBlurImage arginfo_class_Imagick_blurImage #if MagickLibVersion < 0x700 && !defined(MAGICKCORE_EXCLUDE_DEPRECATED) @@ -4468,12 +4412,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_newImage, 0, 0, 3) ZEND_ARG_INFO(0, rows) #endif ZEND_ARG_OBJ_TYPE_MASK(0, background_color, ImagickPixel, MAY_BE_STRING, NULL) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, format, IS_STRING, 0, "null") -#else - ZEND_ARG_INFO(0, format) -#endif + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, format, IS_STRING, 0, "null") ZEND_END_ARG_INFO() @@ -4516,12 +4455,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getConfigureOption ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getConfigureOptions, 0, 0, 0) #endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 0, "*") -#else - ZEND_ARG_INFO(0, pattern) -#endif + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 0, "\"*\"") ZEND_END_ARG_INFO() #if MagickLibVersion > 0x660 @@ -4835,35 +4769,27 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_subimageMatch, 0, 0, 1) #endif ZEND_ARG_OBJ_INFO(0, image, Imagick, 0) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(1, offset, IS_ARRAY, 1, "null") -#else - ZEND_ARG_INFO(1, offset) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(1, similarity, IS_DOUBLE, 1, "0.0") -#else - ZEND_ARG_INFO(1, similarity) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(1, offset, IS_ARRAY, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(1, similarity, IS_DOUBLE, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, threshold, IS_DOUBLE, 0, "0.0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, metric, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() #endif -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, threshold, IS_DOUBLE, 0, "0.0") -#else - ZEND_ARG_INFO(1, threshold) -#endif +#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x652 #if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, metric, IS_LONG, 0, "0") +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_similarityimage, 0, 1, Imagick, 0) #else - ZEND_ARG_INFO(1, metric) -#endif -ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_similarityimage, 0, 0, 1) #endif -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x652 -#define arginfo_class_Imagick_similarityimage arginfo_class_Imagick_subimageMatch + ZEND_ARG_OBJ_INFO(0, image, imagick, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(1, offset, IS_ARRAY, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(1, similarity, IS_DOUBLE, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, threshold, IS_DOUBLE, 0, "0.0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, metric, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() #endif #if MagickLibVersion > 0x628 @@ -6485,4 +6411,4 @@ static const zend_function_entry class_Imagick_methods[] = { ZEND_ME(Imagick, setImageMask, arginfo_class_Imagick_setImageMask, ZEND_ACC_PUBLIC) #endif ZEND_FE_END -}; +}; \ No newline at end of file