This is either a support request or a bug request, I'm not sure yet, but it does affect whether I adopt this library.
Following on my example I shared in #13 (comment)
useRamsey\Collection\Set;
finalclass TestClass {
/** * @param Set<string> $c */publicfunction__construct(publicSet$c = newSet('string')) {
}
}If you refer to the published code at https://github.com/ramsey/collection, generics is made use of thorougly.
At each level, the library @extends/@implements appropriately with templates: Set > AbstractSet > AbstractCollection > CollectionInterface
My goal is to be able to reflect on method parameters, for example TestClass::$c->add($element). This parameter has a mixed native type, but it has @param T $element in CollectionInterface.
But when I use reflection like this, I get a MixedType:
$reflector = (newReflectorBuilder())->build();
$test = $reflector->forType(TestClass::class);
$setType = $reflector->forNamedType($test->properties()[0]->type());
foreach ($setType->methods() as$m) {
if ($m->name() === 'add') {
$m->parameters[0] === MixedTypeI would like to somehow to be able to get the T, which should be a string. Is this possible with good-php/reflection?
This is either a support request or a bug request, I'm not sure yet, but it does affect whether I adopt this library.
Following on my example I shared in #13 (comment)
If you refer to the published code at https://github.com/ramsey/collection, generics is made use of thorougly.
At each level, the library
@extends/@implementsappropriately with templates:Set > AbstractSet > AbstractCollection > CollectionInterfaceMy goal is to be able to reflect on method parameters, for example
TestClass::$c->add($element). This parameter has amixednative type, but it has@param T $elementinCollectionInterface.But when I use reflection like this, I get a
MixedType:I would like to somehow to be able to get the
T, which should be astring. Is this possible with good-php/reflection?