{"comment":{"created_at":"2011-10-17T17:31:10Z","body":"I guess you already parse the method signature for reflection purposes? So why not simply use the existing mechanism and add some syntactical sugar to annotations:\r\n\r\n    #[@inject]\r\n    #[@named{configPath}('Myapp.config.path')]\r\n    __construct(Processor $proc, Request $req, $configPath)\r\n\r\nIn this example the `@named` would only mark the `$configPath` parameter. This way the method signature parsing does not have to be changed, only the injection parsing would have to be extended. Just some thoughts, don't know whether this is feasible. Main drawback is that the annotation is not directly at the parameter which it annotates.","updated_at":"2011-10-17T17:31:10Z","url":"https://api.github.com/repos/xp-framework/rfc/issues/comments/2431947","id":2431947,"user":{"gravatar_id":"1ed4a4bca0e8e1b3d6a9ae9a14a9e1cc","avatar_url":"https://secure.gravatar.com/avatar/1ed4a4bca0e8e1b3d6a9ae9a14a9e1cc?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/mikey179","id":190475,"login":"mikey179"}},"action":"created","issue":{"number":218,"created_at":"2011-10-17T16:11:20Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"Scope of Change\r\n==\r\nAnnotations on method parameters will be allowed.\r\n\r\n\r\nRationale\r\n==\r\nOriginally motivated by Originally motivated from [XP Framework's pull request #33](https://github.com/xp-framework/xp-framework/pull/33/files).\r\n\r\n\r\n@mikey179 wrote:\r\n\r\n> How would it look like if only the last parameter should be named? Something like this?\r\n> ```\r\n> #[@inject(named=[null, null, 'myapp.config.path'])]\r\n> __construct(Processor $proc, Request $req, $configPath)\r\n> ```\r\n>  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 is. What's your take on this, @thekid and @kiesel?\r\n\r\n@thekid answered:\r\n\r\n> As we're not adding this before 5.9 we might as well add parameter annotations, too:)\r\n> ```\r\n> __construct(Processor $proc, Request $req, /*[@inject(named = 'Myapp.config.path')]*/ $configPath)\r\n> ```\r\n> \r\n> Not sure what kind of a performance impact these would have.\r\n\r\nFunctionality\r\n==\r\n\r\n*TODO*\r\n\r\nSecurity considerations\r\n==\r\nn/a\r\n\r\n\r\nSpeed impact\r\n==\r\nSlower as method signatures need to be parsed, too.\r\n\r\n\r\nDependencies\r\n==\r\nn/a\r\n\r\n\r\nRelated documents\r\n==\r\nxp-framework/xp-framework#33\r\n","comments":1,"title":"Parameter annotations","updated_at":"2011-10-17T17:31:11Z","url":"https://api.github.com/repos/xp-framework/rfc/issues/218","id":1930473,"assignee":null,"milestone":null,"closed_at":null,"user":{"gravatar_id":"26f07e3b262e9a80436f368cb11bd0c2","avatar_url":"https://secure.gravatar.com/avatar/26f07e3b262e9a80436f368cb11bd0c2?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/thekid","id":696742,"login":"thekid"},"html_url":"https://github.com/xp-framework/rfc/issues/218","labels":[{"name":"framework","url":"https://api.github.com/repos/xp-framework/rfc/labels/framework","color":"118f5b"},{"name":"language","url":"https://api.github.com/repos/xp-framework/rfc/labels/language","color":"893ea2"}],"state":"open"},"legacy":{"issue_id":1930473,"comment_id":2431947}}