{"action":"created","issue":{"url":"https://api.github.com/repos/ray-di/Ray.Di/issues/148","repository_url":"https://api.github.com/repos/ray-di/Ray.Di","labels_url":"https://api.github.com/repos/ray-di/Ray.Di/issues/148/labels{/name}","comments_url":"https://api.github.com/repos/ray-di/Ray.Di/issues/148/comments","events_url":"https://api.github.com/repos/ray-di/Ray.Di/issues/148/events","html_url":"https://github.com/ray-di/Ray.Di/issues/148","id":178496734,"number":148,"title":"Assisted Injection と Injection Point","user":{"login":"kilica","id":298665,"avatar_url":"https://avatars.githubusercontent.com/u/298665?v=3","gravatar_id":"","url":"https://api.github.com/users/kilica","html_url":"https://github.com/kilica","followers_url":"https://api.github.com/users/kilica/followers","following_url":"https://api.github.com/users/kilica/following{/other_user}","gists_url":"https://api.github.com/users/kilica/gists{/gist_id}","starred_url":"https://api.github.com/users/kilica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kilica/subscriptions","organizations_url":"https://api.github.com/users/kilica/orgs","repos_url":"https://api.github.com/users/kilica/repos","events_url":"https://api.github.com/users/kilica/events{/privacy}","received_events_url":"https://api.github.com/users/kilica/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-22T00:54:04Z","updated_at":"2016-09-23T01:17:46Z","closed_at":"2016-09-23T01:17:46Z","body":"Meetup のときに教えていただいた Assisted Injection / Injection Point について再度教えて下さい。\r\n\r\n以下のように、onGet() で $foo を Assisted Injection するときに、$id の値を見て $foo を生成する処理を FooProvider::get() 内で作りたいと考えています。\r\n\r\nInjection Point では、\r\n\r\n````\r\n$ip->getClass();\r\n$ip->getMethod();\r\n$ip->getParameter();\r\n$ip->getQualifiers();\r\n````\r\n\r\nのメソッドが用意されていますが、\"id\" という引数の名前は取得できるのですが、$id の値の取得の仕方が分かりませんでした。どのように取得できるか教えてください m(__)m\r\n\r\n`src/Resource/Page/Index`\r\n````\r\nclass Index extends ResourceObject\r\n{\r\n    /**\r\n     * @Assisted(\"foo\")\r\n     */\r\n    public function onGet($id, FooInterface $foo)\r\n    {\r\n        return $this;\r\n    }\r\n}\r\n````\r\n\r\n`src/Provide/FooProvider.php`\r\n````\r\nclass FooProvider implements ProviderInterface\r\n{\r\n    /**\r\n     * @var InjectionPointInterface\r\n     */\r\n    private $ip;\r\n\r\n    public function __construct(InjectionPointInterface $ip)\r\n    {\r\n        $this->ip = $ip;\r\n    }\r\n\r\n    public function get()\r\n    {\r\n        $ip = $this->ip;\r\n\r\n        // $id の値をどうにか取得して Foo を生成したい。\r\n        $foo = new Foo($id);\r\n        return $foo;\r\n    }\r\n}\r\n````"},"comment":{"url":"https://api.github.com/repos/ray-di/Ray.Di/issues/comments/249075409","html_url":"https://github.com/ray-di/Ray.Di/issues/148#issuecomment-249075409","issue_url":"https://api.github.com/repos/ray-di/Ray.Di/issues/148","id":249075409,"user":{"login":"kilica","id":298665,"avatar_url":"https://avatars.githubusercontent.com/u/298665?v=3","gravatar_id":"","url":"https://api.github.com/users/kilica","html_url":"https://github.com/kilica","followers_url":"https://api.github.com/users/kilica/followers","following_url":"https://api.github.com/users/kilica/following{/other_user}","gists_url":"https://api.github.com/users/kilica/gists{/gist_id}","starred_url":"https://api.github.com/users/kilica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kilica/subscriptions","organizations_url":"https://api.github.com/users/kilica/orgs","repos_url":"https://api.github.com/users/kilica/repos","events_url":"https://api.github.com/users/kilica/events{/privacy}","received_events_url":"https://api.github.com/users/kilica/received_events","type":"User","site_admin":false},"created_at":"2016-09-23T01:17:46Z","updated_at":"2016-09-23T01:17:46Z","body":"そっか、残念ですが、ご回答ありがとうございます ^ ^"}}
{"actor":{"display_login":"kilica"}}