From 06bec1483a3c6b2836e8f5df86bb2ff8c32bf22f Mon Sep 17 00:00:00 2001 From: algo13 Date: Mon, 26 Dec 2016 16:57:18 +0900 Subject: [PATCH] Fixed E_NOTICE: Undefined property in UnexpectedUseOfThis.php --- src/Analyzer/Pass/Statement/UnexpectedUseOfThis.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Analyzer/Pass/Statement/UnexpectedUseOfThis.php b/src/Analyzer/Pass/Statement/UnexpectedUseOfThis.php index 77c08b17..c877b4ba 100644 --- a/src/Analyzer/Pass/Statement/UnexpectedUseOfThis.php +++ b/src/Analyzer/Pass/Statement/UnexpectedUseOfThis.php @@ -183,7 +183,9 @@ private function inspectUnset(Stmt\Unset_ $unsetStmt, Context $context) $result = false; foreach ($unsetStmt->vars as $var) { - if ($var->name === 'this') { + if (($var instanceof Node\Expr\Variable) + && ($var->name === 'this') + ) { $result = true; $context->notice(