File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ private function generateSignature(\ReflectionClass $class)
140
140
141
141
foreach ($ class ->getProperties (\ReflectionProperty::IS_PUBLIC | \ReflectionProperty::IS_PROTECTED ) as $ p ) {
142
142
yield $ p ->getDocComment ().$ p ;
143
- yield print_r (isset ($ defaults [$ p ->name ]) ? $ defaults [$ p ->name ] : null , true );
143
+ yield print_r (isset ($ defaults [$ p ->name ]) && ! \is_object ( $ defaults [ $ p -> name ]) ? $ defaults [$ p ->name ] : null , true );
144
144
}
145
145
}
146
146
Original file line number Diff line number Diff line change @@ -170,6 +170,15 @@ public function testServiceSubscriber()
170
170
$ res = new ReflectionClassResource (new \ReflectionClass (TestServiceSubscriber::class));
171
171
$ this ->assertTrue ($ res ->isFresh (0 ));
172
172
}
173
+
174
+ public function testIgnoresObjectsInSignature ()
175
+ {
176
+ $ res = new ReflectionClassResource (new \ReflectionClass (TestServiceWithStaticProperty::class));
177
+ $ this ->assertTrue ($ res ->isFresh (0 ));
178
+
179
+ TestServiceWithStaticProperty::$ initializedObject = new TestServiceWithStaticProperty ();
180
+ $ this ->assertTrue ($ res ->isFresh (0 ));
181
+ }
173
182
}
174
183
175
184
interface DummyInterface
@@ -195,3 +204,8 @@ public static function getSubscribedServices()
195
204
return self ::$ subscribedServices ;
196
205
}
197
206
}
207
+
208
+ class TestServiceWithStaticProperty
209
+ {
210
+ public static $ initializedObject ;
211
+ }
You can’t perform that action at this time.
0 commit comments