summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--composer.json4
-rw-r--r--php-doctrine-common-php8.patch52
-rw-r--r--php-doctrine-common.spec41
4 files changed, 89 insertions, 10 deletions
diff --git a/.gitignore b/.gitignore
index 1ab5c4f..01f0400 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,7 @@
+clog
package-*.xml
*.tgz
+*.tar.bz2
*.tar.gz
*.tar.xz
*.tar.xz.asc
diff --git a/composer.json b/composer.json
index ea158a2..92aa5ec 100644
--- a/composer.json
+++ b/composer.json
@@ -18,7 +18,7 @@
{"name": "Marco Pivetta", "email": "ocramius@gmail.com"}
],
"require": {
- "php": "^7.1",
+ "php": "^7.1 || ^8.0",
"doctrine/inflector": "^1.0",
"doctrine/cache": "^1.0",
"doctrine/collections": "^1.0",
@@ -26,7 +26,7 @@
"doctrine/annotations": "^1.0",
"doctrine/event-manager": "^1.0",
"doctrine/reflection": "^1.0",
- "doctrine/persistence": "^1.1"
+ "doctrine/persistence": "^1.3.3"
},
"require-dev": {
"phpstan/phpstan": "^0.11",
diff --git a/php-doctrine-common-php8.patch b/php-doctrine-common-php8.patch
new file mode 100644
index 0000000..32e1ff1
--- /dev/null
+++ b/php-doctrine-common-php8.patch
@@ -0,0 +1,52 @@
+diff -up ./tests/Doctrine/Tests/Common/Proxy/MagicIssetClassWithInteger.php.php8 ./tests/Doctrine/Tests/Common/Proxy/MagicIssetClassWithInteger.php
+--- ./tests/Doctrine/Tests/Common/Proxy/MagicIssetClassWithInteger.php.php8 2021-03-31 10:54:57.668187413 +0200
++++ ./tests/Doctrine/Tests/Common/Proxy/MagicIssetClassWithInteger.php 2021-03-31 10:55:02.218170669 +0200
+@@ -24,16 +24,16 @@ class MagicIssetClassWithInteger
+ * @return int
+ * @throws \BadMethodCallException
+ */
+- public function __isset(string $name): int
++ public function __isset(string $name): bool
+ {
+ if ('test' === $name) {
+- return 1;
++ return true;
+ }
+
+ if ('publicField' === $name || 'id' === $name) {
+ throw new \BadMethodCallException('Should never be called for "publicField" or "id"');
+ }
+
+- return 0;
++ return false;
+ }
+ }
+diff -up ./tests/Doctrine/Tests/Common/Proxy/NullableNonOptionalHintClass.php.php8 ./tests/Doctrine/Tests/Common/Proxy/NullableNonOptionalHintClass.php
+diff -up ./tests/Doctrine/Tests/Common/Proxy/ProxyGeneratorTest.php.php8 ./tests/Doctrine/Tests/Common/Proxy/ProxyGeneratorTest.php
+--- ./tests/Doctrine/Tests/Common/Proxy/ProxyGeneratorTest.php.php8 2021-03-31 10:54:38.446258154 +0200
++++ ./tests/Doctrine/Tests/Common/Proxy/ProxyGeneratorTest.php 2021-03-31 10:55:06.625154451 +0200
+@@ -54,7 +54,7 @@ class ProxyGeneratorTest extends \PHPUni
+ $params = $method->getParameters();
+
+ self::assertEquals(1, count($params));
+- self::assertEquals('stdClass', $params[0]->getClass()->getName());
++ self::assertEquals('stdClass', @$params[0]->getClass()->getName());
+ }
+
+ public function testProxyRespectsMethodsWhichReturnValuesByReference()
+@@ -240,6 +240,7 @@ class ProxyGeneratorTest extends \PHPUni
+
+ /**
+ * @group #751
++ * @requires PHP < 8
+ */
+ public function testClassWithNullableOptionalNonLastParameterOnProxiedMethods()
+ {
+@@ -265,6 +266,7 @@ class ProxyGeneratorTest extends \PHPUni
+
+ /**
+ * @group #751
++ * @requires PHP < 8
+ */
+ public function testClassWithPhp71NullableOptionalNonLastParameterOnProxiedMethods()
+ {
diff --git a/php-doctrine-common.spec b/php-doctrine-common.spec
index a8032f8..347e48d 100644
--- a/php-doctrine-common.spec
+++ b/php-doctrine-common.spec
@@ -2,7 +2,7 @@
#
# Fedora spec file for php-doctrine-common
#
-# Copyright (c) 2013-2019 Shawn Iwinski <shawn.iwinski@gmail.com>
+# Copyright (c) 2013-2021 Shawn Iwinski <shawn.iwinski@gmail.com>
#
# License: MIT
# http://opensource.org/licenses/MIT
@@ -12,13 +12,13 @@
%global github_owner doctrine
%global github_name common
-%global github_version 2.11.0
-%global github_commit b8ca1dcf6b0dc8a2af7a09baac8d0c48345df4ff
+%global github_version 2.13.3
+%global github_commit f3812c026e557892c34ef37f6ab808a6b567da7f
%global composer_vendor doctrine
%global composer_project common
-# "php": "~7.1"
+# "php": "^7.1 || ^8.0"
%global php_min_ver 7.1
# "doctrine/annotations": "^1.0"
# NOTE: Min version not 1.0 because autoloader required
@@ -46,8 +46,8 @@
# "doctrine/reflection": "^1.0"
%global doctrine_refl_min_ver 1.0
%global doctrine_refl_max_ver 2
-# "doctrine/persistence": "^1.1"
-%global doctrine_pers_min_ver 1.1
+# "doctrine/persistence": "^1.3.3"
+%global doctrine_pers_min_ver 1.3.3
%global doctrine_pers_max_ver 2
# Build using "--without tests" to disable tests
@@ -58,7 +58,7 @@
Name: php-%{composer_vendor}-%{composer_project}
Epoch: 1
Version: %{github_version}
-Release: 1%{?dist}
+Release: 4%{?dist}
Summary: Common library for Doctrine projects
License: MIT
@@ -69,6 +69,9 @@ URL: https://github.com/%{github_owner}/%{github_name}
Source0: %{name}-%{github_version}-%{github_commit}.tar.gz
Source1: %{name}-get-source.sh
+# Minimal fix for PHP 8
+Patch0: %{name}-php8.patch
+
BuildArch: noarch
# Library version value check
BuildRequires: php-cli
@@ -172,6 +175,9 @@ Autoloader: %{phpdir}/Doctrine/Common/autoload.php
%prep
%setup -qn %{github_name}-%{github_commit}
+%patch0 -p1 -b .php8
+
+sed -e 's/2.12.0-DEV/%{version}/' -i lib/Doctrine/Common/Version.php
%build
@@ -221,7 +227,7 @@ sed "s#require.*autoload.*#require_once '%{buildroot}%{phpdir}/Doctrine/Common/a
: Upstream tests
RETURN_CODE=0
-for PHP_EXEC in "" php71 php72 php73 php74; do
+for PHP_EXEC in "" php73 php74 php80; do
if [ -z "$PHP_EXEC" ] || which $PHP_EXEC; then
$PHP_EXEC %{_bindir}/phpunit7 --verbose || RETURN_CODE=1
fi
@@ -245,6 +251,25 @@ exit $RETURN_CODE
%changelog
+* Wed Mar 31 2021 Remi Collet <remi@remirepo.net> - 2.13.3-4
+- add minimal patch to fix test suite for PHP 8
+
+* Mon Jun 8 2020 Remi Collet <remi@remirepo.net> - 2.13.3-1
+- update to 2.13.3
+
+* Tue Jun 2 2020 Remi Collet <remi@remirepo.net> - 2.13.2-1
+- update to 2.13.2
+
+* Tue May 26 2020 Remi Collet <remi@remirepo.net> - 2.13.1-1
+- update to 2.13.1
+
+* Fri May 15 2020 Remi Collet <remi@remirepo.net> - 2.13.0-1
+- update to 2.13.0
+- raise dependency on doctrine/persistence 1.3.3
+
+* Mon Jan 13 2020 Remi Collet <remi@remirepo.net> - 2.12.0-1
+- update to 2.12.0
+
* Tue Sep 10 2019 Remi Collet <remi@remirepo.net> - 2.11.0-1
- update to 2.11.0
- switch to phpunit7