phpDocumentor / ReflectionDocBlock

MIT License
9.35k stars 119 forks source link

Literal strings/ints causes classes not to be FQCNed #348

Closed kkmuffme closed 7 months ago

kkmuffme commented 1 year ago

Given this:

/**
 * @param 'GET'|SomeClass $arg
 */

where the context correctly contains the SomeClass FQCN (Foo\SomeClass), it will not correctly create this:

$docblock = $docBlockFactory->create($comment, $context);

Nothing is thrown/no error, but the output is identical to the input, even though it should be:

/**
 * @param 'GET'|Foo\SomeClass $arg
 */

When removing the literal string, it works correctly. The same issue also happens when using literal ints (e.g 9|SomeClass)

jaapio commented 7 months ago

I added a testcase to ensure the correct behavior. This will be solved in a next release.