summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-10-31 14:31:57 +0100
committerRemi Collet <remi@remirepo.net>2017-10-31 14:31:57 +0100
commit55d5049d933ae890b888c9344037e825469f39ce (patch)
tree83ab0f0f88a961dfbb6c76d7b310c5b6cb4e09b7
parent17dca360f08cad3beb7a73685272fdcf995d6bba (diff)
fix FTBFS from Koschei, add upstream patch for PHP 7.2
-rw-r--r--ecab701e7de49f160d83be6a42d6c5aa9a8df76b.patch26
-rw-r--r--php-di.spec10
2 files changed, 34 insertions, 2 deletions
diff --git a/ecab701e7de49f160d83be6a42d6c5aa9a8df76b.patch b/ecab701e7de49f160d83be6a42d6c5aa9a8df76b.patch
new file mode 100644
index 0000000..ea6649d
--- /dev/null
+++ b/ecab701e7de49f160d83be6a42d6c5aa9a8df76b.patch
@@ -0,0 +1,26 @@
+For PHP 7.2, adapted for version 5.4.3 from
+
+From ecab701e7de49f160d83be6a42d6c5aa9a8df76b Mon Sep 17 00:00:00 2001
+From: Matthieu Napoli <matthieu@mnapoli.fr>
+Date: Sun, 4 Jun 2017 17:11:16 +0200
+Subject: [PATCH] Fix the build on PHP 7.2
+
+---
+ src/Container.php | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/Container.php b/src/Container.php
+index d7e87585..b445aa89 100644
+--- a/src/DI/Container.php
++++ b/src/DI/Container.php
+@@ -211,6 +211,10 @@ public function has($name)
+ */
+ public function injectOn($instance)
+ {
++ if (!$instance) {
++ return $instance;
++ }
++
+ $objectDefinition = $this->definitionSource->getDefinition(get_class($instance));
+ if (! $objectDefinition instanceof ObjectDefinition) {
+ return $instance;
diff --git a/php-di.spec b/php-di.spec
index 5186a02..03d4af7 100644
--- a/php-di.spec
+++ b/php-di.spec
@@ -52,7 +52,7 @@
Name: %{composer_project}
Version: %{github_version}
-Release: 1%{?github_release}%{?dist}
+Release: 3%{?github_release}%{?dist}
Summary: The dependency injection container for humans
Group: Development/Libraries
@@ -64,6 +64,8 @@ URL: http://php-di.org/
Source0: %{name}-%{github_version}-%{github_commit}.tar.gz
Source1: %{name}-get-source.sh
+Patch0: https://github.com/PHP-DI/PHP-DI/commit/ecab701e7de49f160d83be6a42d6c5aa9a8df76b.patch
+
BuildArch: noarch
# Tests
%if %{with_tests}
@@ -138,6 +140,7 @@ Autoloader: %{phpdir}/DI/autoload.php
%prep
%setup -qn %{github_name}-%{github_commit}
+%patch0 -p1
: Remove executable bit
: https://github.com/PHP-DI/PHP-DI/pull/392
@@ -207,7 +210,7 @@ sed -e '/@test/d' \
: Upstream tests
RETURN_CODE=0
-for PHP_EXEC in php php70 php71; do
+for PHP_EXEC in php php70 php71 php72; do
if [ "php" == "$PHP_EXEC" ] || which $PHP_EXEC; then
for PHPUNIT in phpunit; do
PHPUNIT=$(which $PHPUNIT) || :
@@ -233,6 +236,9 @@ exit $RETURN_CODE
%changelog
+* Tue Oct 31 2017 Remi Collet <remi@remirepo.net> - 5.4.3-2
+- fix FTBFS from Koschei, add upstream patch for PHP 7.2
+
* Fri Apr 14 2017 Shawn Iwinski <shawn@iwin.ski> - 5.4.3-1
- Update to 5.4.3 (RHBZ #1442382)