Skip to content

Commit e8d2f8c

Browse files
authored
Make sure $caller has a name (#13)
1 parent b9aa512 commit e8d2f8c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Visitor/Php/Symfony/FlashMessage.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ public function enterNode(Node $node)
3131

3232
$name = $node->name;
3333
$caller = $node->var;
34-
$callerName = $caller->name;
34+
// $caller might be "Node\Expr\New_"
35+
$callerName = isset($caller->name) ? $caller->name : '';
3536

3637
/*
3738
* Make sure the caller is from a variable named "this" or a function called "getFlashbag"

0 commit comments

Comments
 (0)