summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2019-08-22 14:09:48 +0200
committerRemi Collet <remi@remirepo.net>2019-08-22 14:09:48 +0200
commitb6a05d21ed47f1bf0d064c7dfe5eef44e726944e (patch)
tree846d74e37d8c9771ffbb5d4e87fb4a70d4cdc655
parentf92748cef1cf182981963ee28276f8df44cc96dd (diff)
add patch for PHP 7.4 (test suite) from
https://github.com/php-decimal/ext-decimal/pull/25
-rw-r--r--25.patch29
-rw-r--r--php-pecl-decimal.spec13
2 files changed, 41 insertions, 1 deletions
diff --git a/25.patch b/25.patch
new file mode 100644
index 0000000..bd6e25e
--- /dev/null
+++ b/25.patch
@@ -0,0 +1,29 @@
+From fd15500d437d41ab0351ca0c706bfbf049599241 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Thu, 22 Aug 2019 14:04:10 +0200
+Subject: [PATCH] fix test for PHP 7.4
+
+---
+ tests/reflection.phpt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tests/reflection.phpt b/tests/reflection.phpt
+index ac0e9c0..a9c3613 100644
+--- a/tests/reflection.phpt
++++ b/tests/reflection.phpt
+@@ -32,13 +32,13 @@ function print_method_summary(ReflectionClass $class, string $method)
+ printf("%s\n", $method->getName());
+ printf("Number of parameters: %d\n", $method->getNumberOfParameters());
+ printf("Number of required parameters: %d\n", $method->getNumberOfRequiredParameters());
+- printf("Return type: %s\n", $method->hasReturnType() ? $method->getReturnType() : "void");
++ printf("Return type: %s\n", $method->hasReturnType() ? (PHP_VERSION_ID >= 70100 ? $method->getReturnType()->getName() : (string) $method->getReturnType()) : "void");
+ printf("Allows return null? %s\n", $method->hasReturnType() ? ($method->getReturnType()->allowsNull() ? "yes" : "no") : "no");
+ printf("Returns reference? %s\n", $method->returnsReference() ? "yes" : "no");
+ printf("Parameters:\n");
+ foreach ($method->getParameters() as $parameter) {
+ printf("Name: %s\n", $parameter->getName());
+- printf("Type: %s\n", ((string) $parameter->getType()) ?: "mixed");
++ printf("Type: %s\n", ($parameter->hasType() ? (PHP_VERSION_ID >= 70100 ? $parameter->getType()->getName() : (string) $parameter->getType()) : "mixed"));
+ printf("Reference? %s\n", $parameter->isPassedByReference() ? "yes" : "no");
+ printf("Allows null? %s\n", $parameter->allowsNull() ? "yes" : "no");
+ printf("Optional? %s\n", $parameter->isOptional() ? "yes" : "no");
diff --git a/php-pecl-decimal.spec b/php-pecl-decimal.spec
index 3e0239c..0e48b06 100644
--- a/php-pecl-decimal.spec
+++ b/php-pecl-decimal.spec
@@ -29,6 +29,8 @@ License: MIT
URL: http://pecl.php.net/package/%{pecl_name}
Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
+Patch0: https://patch-diff.githubusercontent.com/raw/php-decimal/ext-decimal/pull/25.patch
+
BuildRequires: %{?dtsprefix}gcc
BuildRequires: %{?scl_prefix}php-devel > 7
BuildRequires: %{?scl_prefix}php-pear
@@ -59,9 +61,13 @@ Obsoletes: php72u-pecl-%{pecl_name} <= %{version}
Obsoletes: php72w-pecl-%{pecl_name} <= %{version}
%endif
%if "%{php_version}" > "7.3"
-Obsoletes: php73u-pecl-%{pecl_name} <= %{version}
+Obsoletes: php73-pecl-%{pecl_name} <= %{version}
Obsoletes: php73w-pecl-%{pecl_name} <= %{version}
%endif
+%if "%{php_version}" > "7.4"
+Obsoletes: php74-pecl-%{pecl_name} <= %{version}
+Obsoletes: php74w-pecl-%{pecl_name} <= %{version}
+%endif
%endif
%if 0%{?fedora} < 20 && 0%{?rhel} < 7
@@ -88,6 +94,7 @@ sed -e 's/role="test"/role="src"/' \
mv %{pecl_name}-%{version} NTS
cd NTS
+%patch0 -p1 -b .pr25
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_DECIMAL_VERSION/{s/.* "//;s/".*$//;p}' php_decimal.h)
@@ -225,6 +232,10 @@ REPORT_EXIT_STATUS=1 \
%changelog
+* Thu Aug 22 2019 Remi Collet <remi@remirepo.net> - 1.3.0-2
+- add patch for PHP 7.4 (test suite) from
+ https://github.com/php-decimal/ext-decimal/pull/25
+
* Tue Feb 12 2019 Remi Collet <remi@remirepo.net> - 1.3.0-1
- update to 1.3.0