Don't add value of (default/static) objects to the signature
This commit is contained in:
parent
67631723d2
commit
a80e56c460
|
@ -140,7 +140,7 @@ class ReflectionClassResource implements SelfCheckingResourceInterface, \Seriali
|
|||
|
||||
foreach ($class->getProperties(\ReflectionProperty::IS_PUBLIC | \ReflectionProperty::IS_PROTECTED) as $p) {
|
||||
yield $p->getDocComment().$p;
|
||||
yield print_r(isset($defaults[$p->name]) ? $defaults[$p->name] : null, true);
|
||||
yield print_r(isset($defaults[$p->name]) && !\is_object($defaults[$p->name]) ? $defaults[$p->name] : null, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -170,6 +170,15 @@ EOPHP;
|
|||
$res = new ReflectionClassResource(new \ReflectionClass(TestServiceSubscriber::class));
|
||||
$this->assertTrue($res->isFresh(0));
|
||||
}
|
||||
|
||||
public function testIgnoresObjectsInSignature()
|
||||
{
|
||||
$res = new ReflectionClassResource(new \ReflectionClass(TestServiceWithStaticProperty::class));
|
||||
$this->assertTrue($res->isFresh(0));
|
||||
|
||||
TestServiceWithStaticProperty::$initializedObject = new TestServiceWithStaticProperty();
|
||||
$this->assertTrue($res->isFresh(0));
|
||||
}
|
||||
}
|
||||
|
||||
interface DummyInterface
|
||||
|
@ -195,3 +204,8 @@ class TestServiceSubscriber implements ServiceSubscriberInterface
|
|||
return self::$subscribedServices;
|
||||
}
|
||||
}
|
||||
|
||||
class TestServiceWithStaticProperty
|
||||
{
|
||||
public static $initializedObject;
|
||||
}
|
||||
|
|
Reference in New Issue