blob: ea6649d074adfc20a27c572266a8b59c2202b5d5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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;
|