{"action":"created","issue":{"url":"https://api.github.com/repos/rdlowrey/Auryn/issues/77","labels_url":"https://api.github.com/repos/rdlowrey/Auryn/issues/77/labels{/name}","comments_url":"https://api.github.com/repos/rdlowrey/Auryn/issues/77/comments","events_url":"https://api.github.com/repos/rdlowrey/Auryn/issues/77/events","html_url":"https://github.com/rdlowrey/Auryn/issues/77","id":59305233,"number":77,"title":"Implementing container-interop interface","user":{"login":"raulferras","id":1103977,"avatar_url":"https://avatars.githubusercontent.com/u/1103977?v=3","gravatar_id":"","url":"https://api.github.com/users/raulferras","html_url":"https://github.com/raulferras","followers_url":"https://api.github.com/users/raulferras/followers","following_url":"https://api.github.com/users/raulferras/following{/other_user}","gists_url":"https://api.github.com/users/raulferras/gists{/gist_id}","starred_url":"https://api.github.com/users/raulferras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raulferras/subscriptions","organizations_url":"https://api.github.com/users/raulferras/orgs","repos_url":"https://api.github.com/users/raulferras/repos","events_url":"https://api.github.com/users/raulferras/events{/privacy}","received_events_url":"https://api.github.com/users/raulferras/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-02-27T22:41:11Z","updated_at":"2015-02-28T09:57:09Z","closed_at":"2015-02-27T23:02:31Z","body":"I'm using Auryn together with XStatic as a way to get something similar to Laravel Facades.\r\nThe problem is XStatic requires an instance of a Service Container that implements this [Container Interface](https://github.com/container-interop/container-interop) already being used by other **Dependency Injector Containers**.\r\n\r\nIt only requires implementing these two methods in the *Provider* (which you already has, but with other names).\r\n\r\n```\r\npublic function get($id)\r\n{\r\n    return $this->make($id);\r\n}\r\n\r\npublic function has($id)\r\n{\r\n    return $this->isDefined($id);\r\n}\r\n```\r\n\r\nI'm currently extending Auryn\\Provider so it is not much of a hassle, just wondering if it is wort the consideration."},"comment":{"url":"https://api.github.com/repos/rdlowrey/Auryn/issues/comments/76519678","html_url":"https://github.com/rdlowrey/Auryn/issues/77#issuecomment-76519678","issue_url":"https://api.github.com/repos/rdlowrey/Auryn/issues/77","id":76519678,"user":{"login":"J7mbo","id":2657310,"avatar_url":"https://avatars.githubusercontent.com/u/2657310?v=3","gravatar_id":"","url":"https://api.github.com/users/J7mbo","html_url":"https://github.com/J7mbo","followers_url":"https://api.github.com/users/J7mbo/followers","following_url":"https://api.github.com/users/J7mbo/following{/other_user}","gists_url":"https://api.github.com/users/J7mbo/gists{/gist_id}","starred_url":"https://api.github.com/users/J7mbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/J7mbo/subscriptions","organizations_url":"https://api.github.com/users/J7mbo/orgs","repos_url":"https://api.github.com/users/J7mbo/repos","events_url":"https://api.github.com/users/J7mbo/events{/privacy}","received_events_url":"https://api.github.com/users/J7mbo/received_events","type":"User","site_admin":false},"created_at":"2015-02-28T09:57:09Z","updated_at":"2015-02-28T09:57:09Z","body":"Yep, `make` your controller then `execute` on the controller method. [This](https://github.com/J7mbo/silex-auth-skeleton/blob/master/src/App/AurynControllerResolver.php) may be useful, it's how I do it in Silex.\r\n\r\nIf there's something I need in a constructor but may only use it in one or two methods out of say 8, then I create a factory (not with Auryn, just an actual factory) and DI that instead. The factory's create method returns the newly created object but only when I call it. Factories are also useful for delaying the instantiation of an object so you can provide it runtime gathered data (ie data provided from a user's request).\r\n\r\n> On 28 Feb 2015, at 09:29, Raúl Ferràs <notifications@github.com> wrote:\r\n> \r\n> I don't quite understand how a factory method can help me in that scenario. Could you give me an example?\r\n> \r\n> On the other hand, I've re-read the documentation and saw the execute method you were referring above, wouldn't that allow me to specify per method dependencies better?\r\n> \r\n> —\r\n> Reply to this email directly or view it on GitHub.\r\n> \r\n"}}