[Config] Fix for signatures of typed properties
This commit is contained in:
parent
0825ea71ef
commit
bad2a2c87a
@ -140,7 +140,7 @@ class ReflectionClassResource implements SelfCheckingResourceInterface, \Seriali
|
|||||||
|
|
||||||
foreach ($class->getProperties(\ReflectionProperty::IS_PUBLIC | \ReflectionProperty::IS_PROTECTED) as $p) {
|
foreach ($class->getProperties(\ReflectionProperty::IS_PUBLIC | \ReflectionProperty::IS_PROTECTED) as $p) {
|
||||||
yield $p->getDocComment().$p;
|
yield $p->getDocComment().$p;
|
||||||
yield print_r($defaults[$p->name], true);
|
yield print_r($defaults[$p->name] ?? null, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,6 +137,14 @@ EOPHP;
|
|||||||
yield [1, 13, 'protected function prot($a = [123]) {}'];
|
yield [1, 13, 'protected function prot($a = [123]) {}'];
|
||||||
yield [0, 14, '/** priv docblock */'];
|
yield [0, 14, '/** priv docblock */'];
|
||||||
yield [0, 15, ''];
|
yield [0, 15, ''];
|
||||||
|
|
||||||
|
if (\PHP_VERSION_ID >= 70400) {
|
||||||
|
// PHP7.4 typed properties without default value are
|
||||||
|
// undefined, make sure this doesn't throw an error
|
||||||
|
yield [1, 5, 'public array $pub;'];
|
||||||
|
yield [0, 7, 'protected int $prot;'];
|
||||||
|
yield [0, 9, 'private string $priv;'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testEventSubscriber()
|
public function testEventSubscriber()
|
||||||
|
Reference in New Issue
Block a user