summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2020-12-16 12:27:39 +0100
committerRemi Collet <remi@remirepo.net>2020-12-16 12:27:39 +0100
commitc33f79dc399221526c337b2fe368a59ed5fe51e7 (patch)
tree063fb5de2064e733275f0582f4c74964129f67ef
parentcc03297c50607ded5570ef07a3ff898355b159f9 (diff)
backport 1 fix for PHP 8v4.1
-rw-r--r--php-symfony4-php8.patch21
-rw-r--r--php-symfony4.spec9
2 files changed, 29 insertions, 1 deletions
diff --git a/php-symfony4-php8.patch b/php-symfony4-php8.patch
new file mode 100644
index 0000000..460a2d8
--- /dev/null
+++ b/php-symfony4-php8.patch
@@ -0,0 +1,21 @@
+Adapted for 4.1 from
+
+From a3275a7be9e91858aa1dd8429b52cdd34f726e10 Mon Sep 17 00:00:00 2001
+From: Nicolas Grekas <nicolas.grekas@gmail.com>
+Date: Mon, 7 Sep 2020 14:07:49 +0200
+Subject: [PATCH] [DI] fix ContainerBuilder on PHP8
+
+
+diff --git a/src/Symfony/Component/DependencyInjection/ContainerBuilder.php b/src/Symfony/Component/DependencyInjection/ContainerBuilder.php
+index d9115bf8bfcc..97617cb04ef2 100644
+--- a/src/Symfony/Component/DependencyInjection/ContainerBuilder.php
++++ b/src/Symfony/Component/DependencyInjection/ContainerBuilder.php
+@@ -1132,7 +1132,7 @@ class ContainerBuilder extends Container
+ } else {
+ $r = new \ReflectionClass($parameterBag->resolveValue($definition->getClass()));
+
+- $service = null === $r->getConstructor() ? $r->newInstance() : $r->newInstanceArgs($arguments);
++ $service = null === $r->getConstructor() ? $r->newInstance() : $r->newInstanceArgs(array_values($arguments));
+
+ if (!$definition->isDeprecated() && 0 < strpos($r->getDocComment(), "\n * @deprecated ")) {
+ @trigger_error(sprintf('The "%s" service relies on the deprecated "%s" class. It should either be deprecated or its implementation upgraded.', $id, $r->name), E_USER_DEPRECATED);
diff --git a/php-symfony4.spec b/php-symfony4.spec
index d83f6f4..7e132a9 100644
--- a/php-symfony4.spec
+++ b/php-symfony4.spec
@@ -107,7 +107,7 @@
Name: php-%{composer_project}4
Version: %{github_version}
-Release: 1%{?github_prerelease:.%{github_prerelease}}%{?dist}
+Release: 2%{?github_prerelease:.%{github_prerelease}}%{?dist}
Summary: Symfony PHP framework (version 4)
# MIT and CC-BY-SA:
@@ -121,6 +121,8 @@ Source1: %{name}-generate-autoloaders.php
# Use our autoloader
Patch0: %{name}-autoload.patch
+# Backports for PHP 8
+Patch1: %{name}-php8.patch
BuildArch: noarch
# Tests
@@ -1836,6 +1838,8 @@ Autoloader: %{symfony4_dir}/Component/Yaml/autoload.php
%prep
%setup -qn %{github_name}-%{github_commit}
%patch0 -p1
+%patch1 -p1
+
cp %{SOURCE1} .
sed 's#__PHPDIR__#%{phpdir}#' -i $(basename %{SOURCE1})
@@ -2810,6 +2814,9 @@ exit $RET
# ##############################################################################
%changelog
+* Wed Dec 16 2020 Remi Collet <remi@remirepo.net> - 4.1.13-2
+- backport 1 fix for PHP 8
+
* Thu May 2 2019 Remi Collet <remi@remirepo.net> - 4.1.13-1
- update to 4.1.13