summaryrefslogtreecommitdiffstats
path: root/apigen-upstream.patch
blob: 1ce36fa3bbe3c1b7fe0f3b740045f27e3ffa5bbd (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
Adapted for 4.1.1 from:


From e943361d3d2aff9fed9f68865f259f6da64106c0 Mon Sep 17 00:00:00 2001
From: jadb <jadbitar@mac.com>
Date: Sun, 4 Oct 2015 10:50:24 -0400
Subject: [PATCH] Fix #631 - Add condition for expected type

---
 src/Generator/Resolvers/ElementResolver.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff -up ./src/Generator/Resolvers/ElementResolver.php.orig ./src/Generator/Resolvers/ElementResolver.php
--- ./src/Generator/Resolvers/ElementResolver.php.orig	2015-11-05 12:48:47.582855729 +0100
+++ ./src/Generator/Resolvers/ElementResolver.php	2015-11-05 12:51:25.721529497 +0100
@@ -151,7 +151,8 @@ class ElementResolver
 			}
 		}
 
-		if (($pos = strpos($definition, '::')) || ($pos = strpos($definition, '->'))) {
+		if (($reflectionElement instanceof ClassReflectionInterface)
+			&& ($pos = strpos($definition, '::') || $pos = strpos($definition, '->'))) {
 			$reflectionElement = $this->resolveContextForClassProperty($definition, $reflectionElement, $pos);
 			$definition = substr($definition, $pos + 2);