{"action":"opened","issue":{"url":"https://api.github.com/repos/fesor/SymfonyDIMagic/issues/4","repository_url":"https://api.github.com/repos/fesor/SymfonyDIMagic","labels_url":"https://api.github.com/repos/fesor/SymfonyDIMagic/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/fesor/SymfonyDIMagic/issues/4/comments","events_url":"https://api.github.com/repos/fesor/SymfonyDIMagic/issues/4/events","html_url":"https://github.com/fesor/SymfonyDIMagic/issues/4","id":183557713,"number":4,"title":"Make use of annotations to register service","user":{"login":"fesor","id":172247,"avatar_url":"https://avatars.githubusercontent.com/u/172247?v=3","gravatar_id":"","url":"https://api.github.com/users/fesor","html_url":"https://github.com/fesor","followers_url":"https://api.github.com/users/fesor/followers","following_url":"https://api.github.com/users/fesor/following{/other_user}","gists_url":"https://api.github.com/users/fesor/gists{/gist_id}","starred_url":"https://api.github.com/users/fesor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fesor/subscriptions","organizations_url":"https://api.github.com/users/fesor/orgs","repos_url":"https://api.github.com/users/fesor/repos","events_url":"https://api.github.com/users/fesor/events{/privacy}","received_events_url":"https://api.github.com/users/fesor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-17T23:55:36Z","updated_at":"2016-10-17T23:55:36Z","closed_at":null,"body":"```\r\nuse Fesor\\DIMagic\\Annotation\\{Inject, Parameter};\r\n\r\nclass Bar\r\n{\r\n    /**\r\n      * @Inject({\r\n      *    \"baz\": @Parameter('foo.bar.buz')\r\n      * })\r\n      */\r\n    public function __construct(Foo $foo, string $baz)\r\n    {\r\n    }\r\n}\r\n```\r\n\r\nSo what happening here. Annotation `@Inject` tells that dependencies of class `Bar` should be injected. Since variable `baz` is scalar, we should manually provide which value should it use. In our case it will use parameter `foo.bar.buz`. All other dependencies will be autowired during container building (if it possible).\r\n\r\nTODO: think of modules and bindings."}}
{"actor":{"display_login":"fesor"}}