private function getPluginNamesByTypeViaReflection($type, ReflectionClass $r, AbstractPluginManager $pluginManager)
{
if ($type === 'aliases') {
$type = $r->hasProperty('resolvedAliases') ? 'resolvedAliases' : $type;
}
if (!$r->hasProperty($type)) {
return [];
}
$rProp = $r->getProperty($type);
$rProp->setAccessible(true);
switch ($type) {
case 'resolvedAliases':
// fall-through
// fall-through
case 'aliases':
return array_filter(array_values($rProp->getValue($pluginManager)), [$this, 'filterPluginName']);
case 'invokableClasses':
// fall-through
// fall-through
case 'factories':
// fall-through
// fall-through
default:
return array_filter(array_keys($rProp->getValue($pluginManager)), [$this, 'filterPluginName']);
}
}