Skip to content

Commit 28508a8

Browse files
committed
fix for PHP 8.1.0beta1
1 parent 93b1994 commit 28508a8

6 files changed

+31
-16
lines changed

Diff for: Imagick.stub.php

+8-4
Original file line numberDiff line numberDiff line change
@@ -1223,11 +1223,15 @@ public function key(): int {}
12231223
//# endif
12241224
//#endif
12251225

1226-
/** @alias Imagick::nextImage */
1227-
public function next(): bool {}
1226+
/** @alias Imagick::nextImage
1227+
* @tentative-return-type
1228+
*/
1229+
public function next(): void {}
12281230

1229-
/** @alias Imagick::setFirstIterator */
1230-
public function rewind(): bool {}
1231+
/** @alias Imagick::setFirstIterator
1232+
* @tentative-return-type
1233+
*/
1234+
public function rewind(): void {}
12311235

12321236
public function valid(): bool {}
12331237

Diff for: ImagickPixelIterator.stub.php

+9-5
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,15 @@ public function getPreviousIteratorRow(): array {}
3030
/** @alias ImagickPixelIterator::getIteratorRow */
3131
public function key(): int {}
3232

33-
/** @alias ImagickPixelIterator::getNextIteratorRow */
34-
public function next(): array {}
33+
/** @alias ImagickPixelIterator::getNextIteratorRow
34+
* @tentative-return-type
35+
*/
36+
public function next(): void {}
3537

36-
/** @alias ImagickPixelIterator::resetIterator */
37-
public function rewind(): bool {}
38+
/** @alias ImagickPixelIterator::resetIterator
39+
* @tentative-return-type
40+
*/
41+
public function rewind(): void {}
3842

3943
/** @alias ImagickPixelIterator::getCurrentIteratorRow */
4044
public function current(): array {}
@@ -59,4 +63,4 @@ public function setIteratorRow(int $row): bool {}
5963
public function syncIterator(): bool {}
6064

6165
public function valid(): bool {}
62-
}
66+
}

Diff for: ImagickPixelIterator_arginfo.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,10 @@ ZEND_END_ARG_INFO()
8585

8686
#define arginfo_class_ImagickPixelIterator_key arginfo_class_ImagickPixelIterator_getIteratorRow
8787

88-
#define arginfo_class_ImagickPixelIterator_next arginfo_class_ImagickPixelIterator_getCurrentIteratorRow
88+
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixelIterator_next, 0, 0, IS_VOID, 0)
89+
ZEND_END_ARG_INFO()
8990

90-
#define arginfo_class_ImagickPixelIterator_rewind arginfo_class_ImagickPixelIterator_clear
91+
#define arginfo_class_ImagickPixelIterator_rewind arginfo_class_ImagickPixelIterator_next
9192

9293
#define arginfo_class_ImagickPixelIterator_current arginfo_class_ImagickPixelIterator_getCurrentIteratorRow
9394

Diff for: Imagick_arginfo.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -4786,11 +4786,12 @@ ZEND_END_ARG_INFO()
47864786
#endif
47874787

47884788
#if MagickLibVersion > 0x628
4789-
#define arginfo_class_Imagick_next arginfo_class_Imagick_optimizeImageLayers
4789+
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_next, 0, 0, IS_VOID, 0)
4790+
ZEND_END_ARG_INFO()
47904791
#endif
47914792

47924793
#if MagickLibVersion > 0x628
4793-
#define arginfo_class_Imagick_rewind arginfo_class_Imagick_optimizeImageLayers
4794+
#define arginfo_class_Imagick_rewind arginfo_class_Imagick_next
47944795
#endif
47954796

47964797
#if MagickLibVersion > 0x628

Diff for: regen_arginfo.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
VER=0$(php-config --vernum 2>/dev/null)
44

5-
if [ $VER -lt 70100 ]; then
5+
if [ $VER -lt 80100 ]; then
66

7-
echo "You need php >= 7.1 to run this script"
7+
echo "You need php >= 8.1 to run this script"
88

99
elif [ ! -f build/gen_stub.php ]; then
1010

Diff for: shim_php7_to_php8.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11

22

3+
#if PHP_VERSION_ID < 80100
4+
#define ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, type, allow_null) \
5+
ZEND_BEGIN_ARG_INFO_EX(name, return_reference, required_num_args, allow_null)
6+
#endif
7+
38
#if PHP_VERSION_ID < 80000
49
// Allow the generated stubs to work on previous versions of PHP
510

@@ -11,4 +16,4 @@
1116

1217
#define MAY_BE_STRING ""
1318

14-
#endif
19+
#endif

0 commit comments

Comments
 (0)