Skip to content

Commit

Permalink
Prepend '\' to namespaced types
Browse files Browse the repository at this point in the history
  • Loading branch information
DerManoMann committed Oct 21, 2021
1 parent e3900c0 commit 466320c
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/Analysers/ReflectionAnalyser.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,6 @@ protected function analyzeFqdn(string $fqdn, Analysis $analysis, array $details)
if ($parentClass = $rc->getParentClass()) {
$definition['extends'] = $normaliseClass($parentClass->getName());
}
// if ($interfaceNames = $rc->getInterfaceNames()) {
// $definition[$contextType == 'class' ? 'implements' : 'extends'] = array_map($normaliseClass, $interfaceNames);
// }
// if ($traitNames = $rc->getTraitNames()) {
// $definition['traits'] = array_map($normaliseClass, $traitNames);
// }
$definition[$contextType == 'class' ? 'implements' : 'extends'] = array_map($normaliseClass, $details['interfaces']);
$definition['traits'] = array_map($normaliseClass, $details['traits']);

Expand Down Expand Up @@ -151,6 +145,10 @@ protected function analyzeFqdn(string $fqdn, Analysis $analysis, array $details)
$ctx->nullable = $type->allowsNull();
if ($type instanceof \ReflectionNamedType) {
$ctx->type = $type->getName();
if (false !== strpos($ctx->type, '\\')) {
// AugmentProperties expects this...
$ctx->type = '\\' . ltrim($ctx->type, '\\');
}
}
}
foreach ($this->annotationFactories as $annotationFactory) {
Expand Down

0 comments on commit 466320c

Please sign in to comment.