Re: ReflectionContext for imports and namespace

From: Date: Mon, 11 Dec 2017 07:51:09 +0000
Subject: Re: ReflectionContext for imports and namespace
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-101307@lists.php.net to get a copy of this message
> > Documentation tools shouldn't run the code IMO, that means they won't have > access to that feature. By "documentation tools" do you mean libraries like phpDocumentor? You are right, those need to parse anyway, they cannot use reflection API. But tools for annotation discovery may want to use native reflection instead of parsing, it is an implementation choice. > > Nikic's PHP parser already contains a tool that resolves all namespaces, you > can probably write a similar visitor for the Ast that also works for PHPdoc > blocks. > > Regards, Niklas On 11 December 2017 at 08:46, Marco Pivetta <ocramius@gmail.com> wrote: > Indeed that already exists at > > https://github.com/Roave/BetterReflection/blob/2.0.1/docs/features.md#analysing-types-from-docblocks > - relatively new lib, so it probably didn't get noticed upfront in here. Yes, parser / userland solutions exist for this purpose. (I have seen BetterReflection) I just thought since this information is already available, a library that uses reflection API should not need a userland parser to get it.

« previous php.internals (#101307) next »