{"action":"created","issue":{"url":"https://api.github.com/repos/ezsystems/BehatBundle/issues/44","labels_url":"https://api.github.com/repos/ezsystems/BehatBundle/issues/44/labels{/name}","comments_url":"https://api.github.com/repos/ezsystems/BehatBundle/issues/44/comments","events_url":"https://api.github.com/repos/ezsystems/BehatBundle/issues/44/events","html_url":"https://github.com/ezsystems/BehatBundle/pull/44","id":128180875,"number":44,"title":"POC: Using Behat Extension to inject the required services","user":{"login":"miguelcleverti","id":8983122,"avatar_url":"https://avatars.githubusercontent.com/u/8983122?v=3","gravatar_id":"","url":"https://api.github.com/users/miguelcleverti","html_url":"https://github.com/miguelcleverti","followers_url":"https://api.github.com/users/miguelcleverti/followers","following_url":"https://api.github.com/users/miguelcleverti/following{/other_user}","gists_url":"https://api.github.com/users/miguelcleverti/gists{/gist_id}","starred_url":"https://api.github.com/users/miguelcleverti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miguelcleverti/subscriptions","organizations_url":"https://api.github.com/users/miguelcleverti/orgs","repos_url":"https://api.github.com/users/miguelcleverti/repos","events_url":"https://api.github.com/users/miguelcleverti/events{/privacy}","received_events_url":"https://api.github.com/users/miguelcleverti/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2016-01-22T15:35:45Z","updated_at":"2016-01-26T13:48:12Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ezsystems/BehatBundle/pulls/44","html_url":"https://github.com/ezsystems/BehatBundle/pull/44","diff_url":"https://github.com/ezsystems/BehatBundle/pull/44.diff","patch_url":"https://github.com/ezsystems/BehatBundle/pull/44.patch"},"body":"The purpose of this POC is to implement a simple and clean way to inject the services required by each of the Contexts without the need for unnecessary dependencies.\r\nThis is an alternative to polluting  behat.yml/behat_suites.yml with service declarations for all the contexts, which greatly helps with the readability of the file.\r\n \r\nWith BehatExtension ContextInitializer we can hook logic immediately after the instantiation of each Context, and with the help of Reflection and Annotations we are able to declare inside the Context class the services required."},"comment":{"url":"https://api.github.com/repos/ezsystems/BehatBundle/issues/comments/175022288","html_url":"https://github.com/ezsystems/BehatBundle/pull/44#issuecomment-175022288","issue_url":"https://api.github.com/repos/ezsystems/BehatBundle/issues/44","id":175022288,"user":{"login":"bdunogier","id":235928,"avatar_url":"https://avatars.githubusercontent.com/u/235928?v=3","gravatar_id":"","url":"https://api.github.com/users/bdunogier","html_url":"https://github.com/bdunogier","followers_url":"https://api.github.com/users/bdunogier/followers","following_url":"https://api.github.com/users/bdunogier/following{/other_user}","gists_url":"https://api.github.com/users/bdunogier/gists{/gist_id}","starred_url":"https://api.github.com/users/bdunogier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdunogier/subscriptions","organizations_url":"https://api.github.com/users/bdunogier/orgs","repos_url":"https://api.github.com/users/bdunogier/repos","events_url":"https://api.github.com/users/bdunogier/events{/privacy}","received_events_url":"https://api.github.com/users/bdunogier/received_events","type":"User","site_admin":false},"created_at":"2016-01-26T13:48:12Z","updated_at":"2016-01-26T13:48:12Z","body":"> The key difference would be constructor arguments vs \"any method\". while the 1st seems cleaner, the later could allow a bit more flexibility (for instance, having different methods on base/child contexts):\r\n\r\nSounds awfully complicated."}}