ReflectionDocBlock icon indicating copy to clipboard operation
ReflectionDocBlock copied to clipboard

MethodTag::getArguments

Open armetiz opened this issue 10 years ago • 6 comments

This function return an array of array, there is no defined order of this structure.

I guess it could be useful to add a correct interpretation of this information : [[type] [parameter]<, ...>]

There is 3 informations :

  • name
  • type
  • default value

armetiz avatar Jan 13 '14 19:01 armetiz

Could return instances of FunctionReflector\ArgumentReflector just like a normal method.

cebe avatar Jan 13 '14 20:01 cebe

It would be awesome if we could access the various information of a tag! Any implementation available?

johannesschobel avatar Aug 11 '16 13:08 johannesschobel

It looks to me like nearly everything this library provides is string-based, rather than reflectors... @jaapio @mvriel , does that sound right to you? If so, then we probably don't want to bend things into the latter, unless we went whole hog and made everything return reflectors.

Thoughts, anyone?

ashnazg avatar Aug 23 '18 18:08 ashnazg

The mentioned reflection classes are part of phpdocumentor/reflection. I can imagine that we could create a param like class to support typed arguments. But before going that way I want to have a good benchmark setup avaliable. So we can measure the impact of changes like this.

I'm sure that we will get the same request for callables. And other complex docblock tags. Main concern is the memory usage in applications like phpdocumentor.

jaapio avatar Aug 23 '18 18:08 jaapio

Right, but Reflection depends on ReflectionDocBlock, not the other way around. If the whole paradigm in ReflectionDocBlock is "return strings for all the info you ask for", I'd say it should stay that way in this library. Maybe the Reflection library itself could be the level of providing higher level classes wrapped around these strings.

ashnazg avatar Aug 23 '18 18:08 ashnazg

I started an effort to get this thing done #304

jaapio avatar Sep 27 '21 20:09 jaapio