{"action":"closed","number":15,"pull_request":{"url":"https://api.github.com/repos/zealfire/printable/pulls/15","id":38270567,"html_url":"https://github.com/zealfire/printable/pull/15","diff_url":"https://github.com/zealfire/printable/pull/15.diff","patch_url":"https://github.com/zealfire/printable/pull/15.patch","issue_url":"https://api.github.com/repos/zealfire/printable/issues/15","number":15,"state":"closed","locked":false,"title":"Add DI for Request object.","user":{"login":"Sutharsan","id":259953,"avatar_url":"https://avatars.githubusercontent.com/u/259953?v=3","gravatar_id":"","url":"https://api.github.com/users/Sutharsan","html_url":"https://github.com/Sutharsan","followers_url":"https://api.github.com/users/Sutharsan/followers","following_url":"https://api.github.com/users/Sutharsan/following{/other_user}","gists_url":"https://api.github.com/users/Sutharsan/gists{/gist_id}","starred_url":"https://api.github.com/users/Sutharsan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sutharsan/subscriptions","organizations_url":"https://api.github.com/users/Sutharsan/orgs","repos_url":"https://api.github.com/users/Sutharsan/repos","events_url":"https://api.github.com/users/Sutharsan/events{/privacy}","received_events_url":"https://api.github.com/users/Sutharsan/received_events","type":"User","site_admin":false},"body":"This is how I would add DI for the Request object. I leave the replacement of Drupal::routeMatch() to you.\r\nMy recipe:\r\n- Look inside the procedural function (Drupal::request()) and locate the code that does the work (static::getContainer()->get('request_stack')->getCurrentRequest()).\r\n- Use this code and the $container object to construct a loader in the create() method ($container->get('request_stack')->getCurrentRequest())\r\n- Add a parameter to __construct() to received the object (Request $request).\r\n- Add a use statement to enable autoloading of the used class (use Symfony\\Component\\HttpFoundation\\Request)\r\n- Save the object inside the object ($this->request = $request)\r\n- For better development experience, make sure the order of the parameters in __construct() and create() is the same.","created_at":"2015-06-22T20:07:03Z","updated_at":"2015-06-22T21:38:00Z","closed_at":"2015-06-22T21:38:00Z","merged_at":null,"merge_commit_sha":"d887c31ef9b31a02b0e9d819df4174e3297ec34f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/zealfire/printable/pulls/15/commits","review_comments_url":"https://api.github.com/repos/zealfire/printable/pulls/15/comments","review_comment_url":"https://api.github.com/repos/zealfire/printable/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zealfire/printable/issues/15/comments","statuses_url":"https://api.github.com/repos/zealfire/printable/statuses/1f5fd6f7c952f9a7ca94c853bd3b66d8972d818c","head":{"label":"Sutharsan:patch-15","ref":"patch-15","sha":"1f5fd6f7c952f9a7ca94c853bd3b66d8972d818c","user":{"login":"Sutharsan","id":259953,"avatar_url":"https://avatars.githubusercontent.com/u/259953?v=3","gravatar_id":"","url":"https://api.github.com/users/Sutharsan","html_url":"https://github.com/Sutharsan","followers_url":"https://api.github.com/users/Sutharsan/followers","following_url":"https://api.github.com/users/Sutharsan/following{/other_user}","gists_url":"https://api.github.com/users/Sutharsan/gists{/gist_id}","starred_url":"https://api.github.com/users/Sutharsan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sutharsan/subscriptions","organizations_url":"https://api.github.com/users/Sutharsan/orgs","repos_url":"https://api.github.com/users/Sutharsan/repos","events_url":"https://api.github.com/users/Sutharsan/events{/privacy}","received_events_url":"https://api.github.com/users/Sutharsan/received_events","type":"User","site_admin":false},"repo":{"id":37772888,"name":"printable","full_name":"Sutharsan/printable","owner":{"login":"Sutharsan","id":259953,"avatar_url":"https://avatars.githubusercontent.com/u/259953?v=3","gravatar_id":"","url":"https://api.github.com/users/Sutharsan","html_url":"https://github.com/Sutharsan","followers_url":"https://api.github.com/users/Sutharsan/followers","following_url":"https://api.github.com/users/Sutharsan/following{/other_user}","gists_url":"https://api.github.com/users/Sutharsan/gists{/gist_id}","starred_url":"https://api.github.com/users/Sutharsan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sutharsan/subscriptions","organizations_url":"https://api.github.com/users/Sutharsan/orgs","repos_url":"https://api.github.com/users/Sutharsan/repos","events_url":"https://api.github.com/users/Sutharsan/events{/privacy}","received_events_url":"https://api.github.com/users/Sutharsan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Sutharsan/printable","description":"Porting print module to Drupal 8 as part of GSoC 2015","fork":true,"url":"https://api.github.com/repos/Sutharsan/printable","forks_url":"https://api.github.com/repos/Sutharsan/printable/forks","keys_url":"https://api.github.com/repos/Sutharsan/printable/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Sutharsan/printable/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Sutharsan/printable/teams","hooks_url":"https://api.github.com/repos/Sutharsan/printable/hooks","issue_events_url":"https://api.github.com/repos/Sutharsan/printable/issues/events{/number}","events_url":"https://api.github.com/repos/Sutharsan/printable/events","assignees_url":"https://api.github.com/repos/Sutharsan/printable/assignees{/user}","branches_url":"https://api.github.com/repos/Sutharsan/printable/branches{/branch}","tags_url":"https://api.github.com/repos/Sutharsan/printable/tags","blobs_url":"https://api.github.com/repos/Sutharsan/printable/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Sutharsan/printable/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Sutharsan/printable/git/refs{/sha}","trees_url":"https://api.github.com/repos/Sutharsan/printable/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Sutharsan/printable/statuses/{sha}","languages_url":"https://api.github.com/repos/Sutharsan/printable/languages","stargazers_url":"https://api.github.com/repos/Sutharsan/printable/stargazers","contributors_url":"https://api.github.com/repos/Sutharsan/printable/contributors","subscribers_url":"https://api.github.com/repos/Sutharsan/printable/subscribers","subscription_url":"https://api.github.com/repos/Sutharsan/printable/subscription","commits_url":"https://api.github.com/repos/Sutharsan/printable/commits{/sha}","git_commits_url":"https://api.github.com/repos/Sutharsan/printable/git/commits{/sha}","comments_url":"https://api.github.com/repos/Sutharsan/printable/comments{/number}","issue_comment_url":"https://api.github.com/repos/Sutharsan/printable/issues/comments{/number}","contents_url":"https://api.github.com/repos/Sutharsan/printable/contents/{+path}","compare_url":"https://api.github.com/repos/Sutharsan/printable/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Sutharsan/printable/merges","archive_url":"https://api.github.com/repos/Sutharsan/printable/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Sutharsan/printable/downloads","issues_url":"https://api.github.com/repos/Sutharsan/printable/issues{/number}","pulls_url":"https://api.github.com/repos/Sutharsan/printable/pulls{/number}","milestones_url":"https://api.github.com/repos/Sutharsan/printable/milestones{/number}","notifications_url":"https://api.github.com/repos/Sutharsan/printable/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Sutharsan/printable/labels{/name}","releases_url":"https://api.github.com/repos/Sutharsan/printable/releases{/id}","created_at":"2015-06-20T14:36:40Z","updated_at":"2015-06-20T14:36:40Z","pushed_at":"2015-06-22T20:06:58Z","git_url":"git://github.com/Sutharsan/printable.git","ssh_url":"git@github.com:Sutharsan/printable.git","clone_url":"https://github.com/Sutharsan/printable.git","svn_url":"https://github.com/Sutharsan/printable","homepage":null,"size":296,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"zealfire:master","ref":"master","sha":"7fcd3dbe017b42a16e95c00f71295f86ae69e0ff","user":{"login":"zealfire","id":5805013,"avatar_url":"https://avatars.githubusercontent.com/u/5805013?v=3","gravatar_id":"","url":"https://api.github.com/users/zealfire","html_url":"https://github.com/zealfire","followers_url":"https://api.github.com/users/zealfire/followers","following_url":"https://api.github.com/users/zealfire/following{/other_user}","gists_url":"https://api.github.com/users/zealfire/gists{/gist_id}","starred_url":"https://api.github.com/users/zealfire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zealfire/subscriptions","organizations_url":"https://api.github.com/users/zealfire/orgs","repos_url":"https://api.github.com/users/zealfire/repos","events_url":"https://api.github.com/users/zealfire/events{/privacy}","received_events_url":"https://api.github.com/users/zealfire/received_events","type":"User","site_admin":false},"repo":{"id":36915514,"name":"printable","full_name":"zealfire/printable","owner":{"login":"zealfire","id":5805013,"avatar_url":"https://avatars.githubusercontent.com/u/5805013?v=3","gravatar_id":"","url":"https://api.github.com/users/zealfire","html_url":"https://github.com/zealfire","followers_url":"https://api.github.com/users/zealfire/followers","following_url":"https://api.github.com/users/zealfire/following{/other_user}","gists_url":"https://api.github.com/users/zealfire/gists{/gist_id}","starred_url":"https://api.github.com/users/zealfire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zealfire/subscriptions","organizations_url":"https://api.github.com/users/zealfire/orgs","repos_url":"https://api.github.com/users/zealfire/repos","events_url":"https://api.github.com/users/zealfire/events{/privacy}","received_events_url":"https://api.github.com/users/zealfire/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zealfire/printable","description":"Porting print module to Drupal 8 as part of GSoC 2015","fork":false,"url":"https://api.github.com/repos/zealfire/printable","forks_url":"https://api.github.com/repos/zealfire/printable/forks","keys_url":"https://api.github.com/repos/zealfire/printable/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zealfire/printable/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zealfire/printable/teams","hooks_url":"https://api.github.com/repos/zealfire/printable/hooks","issue_events_url":"https://api.github.com/repos/zealfire/printable/issues/events{/number}","events_url":"https://api.github.com/repos/zealfire/printable/events","assignees_url":"https://api.github.com/repos/zealfire/printable/assignees{/user}","branches_url":"https://api.github.com/repos/zealfire/printable/branches{/branch}","tags_url":"https://api.github.com/repos/zealfire/printable/tags","blobs_url":"https://api.github.com/repos/zealfire/printable/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zealfire/printable/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zealfire/printable/git/refs{/sha}","trees_url":"https://api.github.com/repos/zealfire/printable/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zealfire/printable/statuses/{sha}","languages_url":"https://api.github.com/repos/zealfire/printable/languages","stargazers_url":"https://api.github.com/repos/zealfire/printable/stargazers","contributors_url":"https://api.github.com/repos/zealfire/printable/contributors","subscribers_url":"https://api.github.com/repos/zealfire/printable/subscribers","subscription_url":"https://api.github.com/repos/zealfire/printable/subscription","commits_url":"https://api.github.com/repos/zealfire/printable/commits{/sha}","git_commits_url":"https://api.github.com/repos/zealfire/printable/git/commits{/sha}","comments_url":"https://api.github.com/repos/zealfire/printable/comments{/number}","issue_comment_url":"https://api.github.com/repos/zealfire/printable/issues/comments{/number}","contents_url":"https://api.github.com/repos/zealfire/printable/contents/{+path}","compare_url":"https://api.github.com/repos/zealfire/printable/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zealfire/printable/merges","archive_url":"https://api.github.com/repos/zealfire/printable/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zealfire/printable/downloads","issues_url":"https://api.github.com/repos/zealfire/printable/issues{/number}","pulls_url":"https://api.github.com/repos/zealfire/printable/pulls{/number}","milestones_url":"https://api.github.com/repos/zealfire/printable/milestones{/number}","notifications_url":"https://api.github.com/repos/zealfire/printable/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zealfire/printable/labels{/name}","releases_url":"https://api.github.com/repos/zealfire/printable/releases{/id}","created_at":"2015-06-05T06:16:58Z","updated_at":"2015-06-05T07:22:49Z","pushed_at":"2015-06-22T21:37:52Z","git_url":"git://github.com/zealfire/printable.git","ssh_url":"git@github.com:zealfire/printable.git","clone_url":"https://github.com/zealfire/printable.git","svn_url":"https://github.com/zealfire/printable","homepage":null,"size":296,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zealfire/printable/pulls/15"},"html":{"href":"https://github.com/zealfire/printable/pull/15"},"issue":{"href":"https://api.github.com/repos/zealfire/printable/issues/15"},"comments":{"href":"https://api.github.com/repos/zealfire/printable/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/zealfire/printable/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/zealfire/printable/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zealfire/printable/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/zealfire/printable/statuses/1f5fd6f7c952f9a7ca94c853bd3b66d8972d818c"}},"merged":false,"mergeable":false,"mergeable_state":"dirty","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":9,"deletions":3,"changed_files":1}}