xp-framework/rfc — Issue #11: Parameter annotations
Author: thekid
Created: 2011-10-17 08:03:22+00:00
State: open

Originally motivated from (XP Framework's pull request #33)[https://github.com/xp-framework/xp-framework/pull/33/files]:

@mikey179 wrote:
> How would it look like if only the last parameter should be named? Something like this?
>
> #[@inject(named=[null, null, 'myapp.config.path'])]
> __construct(Processor $proc, Request $req, $configPath)
>
> As there probably will be no parameter annotations in XP it might make sense to treat named as part of the @inject annotation, it just didn't make sense in where it comes from. One might want to move back once parameter annotations become possible, however, I'm undecided on this. What's your take on this, @thekid and @kiesel?

@thekid answered:
> As we're not adding this before 5.9 we might as well add parameter annotations, too:)
> __construct(Processor $proc, Request $req, /*[@inject(named = 'Myapp.config.path')]*/ $configPath)
>
> Not sure what kind of a performance impact these would have.