File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -98,8 +98,12 @@ public function initNew(AbstractContext $newContext)
98
98
return $ newContext ;
99
99
}
100
100
101
- public function searchForVar (string $ name ): AssignmentValue |string |null
101
+ public function searchForVar (? string $ name ): AssignmentValue |string |null
102
102
{
103
+ if ($ name === null ) {
104
+ return null ;
105
+ }
106
+
103
107
if (property_exists ($ this , 'parameters ' ) && $ this ->parameters instanceof Parameters) {
104
108
foreach ($ this ->parameters ->children as $ param ) {
105
109
if ($ param ->name === $ name ) {
@@ -117,8 +121,12 @@ public function searchForVar(string $name): AssignmentValue|string|null
117
121
return $ this ->parent ?->searchForVar($ name ) ?? null ;
118
122
}
119
123
120
- public function addPropertyToNearestClassDefinition (string $ name , $ types = [])
124
+ public function addPropertyToNearestClassDefinition (? string $ name , $ types = [])
121
125
{
126
+ if ($ name === null ) {
127
+ return ;
128
+ }
129
+
122
130
if ($ this instanceof ClassDefinition) {
123
131
$ this ->properties [] = [
124
132
'name ' => $ name ,
You can’t perform that action at this time.
0 commit comments