Is there a way to list all private member of an instance with Zend\Server\Reflection
?
The documentation for this class is very light I can't get any way to do that.
Is there a way to list all private member of an instance with Zend\Server\Reflection
?
The documentation for this class is very light I can't get any way to do that.
This class is using php ReflectionClass
internally. You can do like this:
$reflection = \Zend\Server\Reflection::reflectClass($className);
$properties = $reflection->getProperties();
$propertyNames = array();
foreach($properties as $property){
if($property->isPrivate()){
$propertyNames[] = $property->getName();
}
}
var_dump($propertyNames);
I tested in ZF2 version 2.5.1 and there it works...