{"action":"created","comment":{"url":"https://api.github.com/repos/wheniwork/loop/pulls/comments/35986271","id":35986271,"diff_hunk":"@@ -2,14 +2,81 @@\n \n define('APP_PATH', realpath(__DIR__ . '/..') . DIRECTORY_SEPARATOR);\n \n+use josegonzalez\\Dotenv\\Loader as EnvLoader;\n+use Facebook\\Facebook;\n+use \\Github\\Client as GithubClient;\n+use TwitterAPIExchange;\n+use \\HieuLe\\WordpressXmlrpcClient\\WordpressClient;\n+\n require APP_PATH . 'vendor/autoload.php';\n \n+$services = 'Wheniwork\\Feedback\\Service';\n+\n+// Initialize Injector\n $injector = new Auryn\\Injector;\n $injector->define('Predis\\Client', []);\n+$injector->define(EnvLoader::class, [':filepaths' => __DIR__ . '/../.env']);\n+$injector->prepare(EnvLoader::class, function(EnvLoader $loader) {\n+    $loader->parse()->putenv(true);\n+});\n+$injector->delegate(\"$services\\AppStoreService\", function() {\n+    return new Wheniwork\\Feedback\\Service\\AppStoreService(\n+        getenv('WIW_IOS_APP_ID')\n+    );\n+});\n+$injector->delegate(\"$services\\BlogService\", function() {\n+    $client = new WordpressClient(\n+        \"http://wheniwork.com/blog/xmlrpc.php\",\n+        getenv('WP_USER'),\n+        getenv('WP_PASSWORD')\n+    );\n+    return new Wheniwork\\Feedback\\Service\\BlogService($client);\n+});\n+$injector->delegate(\"$services\\FacebookService\", function() {\n+    $fb = new Facebook([\n+        'app_id' => getenv('FB_APP_ID'),\n+        'app_secret' => getenv('FB_APP_SECRET'),\n+        'default_graph_version' => 'v2.4'\n+    ]);\n+    $service = new Wheniwork\\Feedback\\Service\\FacebookService($fb, getenv('FB_PAGE_ID'));\n+    $service->authenticate(","path":"web/index.php","position":41,"original_position":41,"commit_id":"cef2a106b5efd232372149d750252715af566e19","original_commit_id":"cef2a106b5efd232372149d750252715af566e19","user":{"login":"shadowhand","id":38203,"avatar_url":"https://avatars.githubusercontent.com/u/38203?v=3","gravatar_id":"","url":"https://api.github.com/users/shadowhand","html_url":"https://github.com/shadowhand","followers_url":"https://api.github.com/users/shadowhand/followers","following_url":"https://api.github.com/users/shadowhand/following{/other_user}","gists_url":"https://api.github.com/users/shadowhand/gists{/gist_id}","starred_url":"https://api.github.com/users/shadowhand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shadowhand/subscriptions","organizations_url":"https://api.github.com/users/shadowhand/orgs","repos_url":"https://api.github.com/users/shadowhand/repos","events_url":"https://api.github.com/users/shadowhand/events{/privacy}","received_events_url":"https://api.github.com/users/shadowhand/received_events","type":"User","site_admin":false},"body":"Yes, authenticating with twitter as part of the service delegation.","created_at":"2015-07-31T15:49:17Z","updated_at":"2015-07-31T15:49:17Z","html_url":"https://github.com/wheniwork/loop/pull/5#discussion_r35986271","pull_request_url":"https://api.github.com/repos/wheniwork/loop/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/wheniwork/loop/pulls/comments/35986271"},"html":{"href":"https://github.com/wheniwork/loop/pull/5#discussion_r35986271"},"pull_request":{"href":"https://api.github.com/repos/wheniwork/loop/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/wheniwork/loop/pulls/5","id":41276278,"html_url":"https://github.com/wheniwork/loop/pull/5","diff_url":"https://github.com/wheniwork/loop/pull/5.diff","patch_url":"https://github.com/wheniwork/loop/pull/5.patch","issue_url":"https://api.github.com/repos/wheniwork/loop/issues/5","number":5,"state":"open","locked":false,"title":"Make services non-static","user":{"login":"bvisness","id":4707402,"avatar_url":"https://avatars.githubusercontent.com/u/4707402?v=3","gravatar_id":"","url":"https://api.github.com/users/bvisness","html_url":"https://github.com/bvisness","followers_url":"https://api.github.com/users/bvisness/followers","following_url":"https://api.github.com/users/bvisness/following{/other_user}","gists_url":"https://api.github.com/users/bvisness/gists{/gist_id}","starred_url":"https://api.github.com/users/bvisness/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bvisness/subscriptions","organizations_url":"https://api.github.com/users/bvisness/orgs","repos_url":"https://api.github.com/users/bvisness/repos","events_url":"https://api.github.com/users/bvisness/events{/privacy}","received_events_url":"https://api.github.com/users/bvisness/received_events","type":"User","site_admin":false},"body":"This one is huge. All services have been refactored to not use static, and all dependencies for those services are now handled through the injector. All GET domains now require their specific service in their\r\nconstructor, which is what allows the injector to work its magic in the first place.\r\n\r\nEach endpoint has been tested...somewhat thoroughly. More thorough testing will happen when other refactoring tasks are complete.\r\n\r\nI really recommend just looking at the code from scratch for this one. The diff is insane. Sorry it's not easier to follow, but refactoring this touches most of the files in the project.\r\n\r\nHopefully resolves #2!","created_at":"2015-07-30T20:09:06Z","updated_at":"2015-07-31T15:49:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2ca284a1ee90ec273ef5f3fc24c1e2541277a80d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wheniwork/loop/pulls/5/commits","review_comments_url":"https://api.github.com/repos/wheniwork/loop/pulls/5/comments","review_comment_url":"https://api.github.com/repos/wheniwork/loop/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wheniwork/loop/issues/5/comments","statuses_url":"https://api.github.com/repos/wheniwork/loop/statuses/cef2a106b5efd232372149d750252715af566e19","head":{"label":"wheniwork:feature/remove-static","ref":"feature/remove-static","sha":"cef2a106b5efd232372149d750252715af566e19","user":{"login":"wheniwork","id":1588384,"avatar_url":"https://avatars.githubusercontent.com/u/1588384?v=3","gravatar_id":"","url":"https://api.github.com/users/wheniwork","html_url":"https://github.com/wheniwork","followers_url":"https://api.github.com/users/wheniwork/followers","following_url":"https://api.github.com/users/wheniwork/following{/other_user}","gists_url":"https://api.github.com/users/wheniwork/gists{/gist_id}","starred_url":"https://api.github.com/users/wheniwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wheniwork/subscriptions","organizations_url":"https://api.github.com/users/wheniwork/orgs","repos_url":"https://api.github.com/users/wheniwork/repos","events_url":"https://api.github.com/users/wheniwork/events{/privacy}","received_events_url":"https://api.github.com/users/wheniwork/received_events","type":"Organization","site_admin":false},"repo":{"id":38779343,"name":"loop","full_name":"wheniwork/loop","owner":{"login":"wheniwork","id":1588384,"avatar_url":"https://avatars.githubusercontent.com/u/1588384?v=3","gravatar_id":"","url":"https://api.github.com/users/wheniwork","html_url":"https://github.com/wheniwork","followers_url":"https://api.github.com/users/wheniwork/followers","following_url":"https://api.github.com/users/wheniwork/following{/other_user}","gists_url":"https://api.github.com/users/wheniwork/gists{/gist_id}","starred_url":"https://api.github.com/users/wheniwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wheniwork/subscriptions","organizations_url":"https://api.github.com/users/wheniwork/orgs","repos_url":"https://api.github.com/users/wheniwork/repos","events_url":"https://api.github.com/users/wheniwork/events{/privacy}","received_events_url":"https://api.github.com/users/wheniwork/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wheniwork/loop","description":"","fork":false,"url":"https://api.github.com/repos/wheniwork/loop","forks_url":"https://api.github.com/repos/wheniwork/loop/forks","keys_url":"https://api.github.com/repos/wheniwork/loop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wheniwork/loop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wheniwork/loop/teams","hooks_url":"https://api.github.com/repos/wheniwork/loop/hooks","issue_events_url":"https://api.github.com/repos/wheniwork/loop/issues/events{/number}","events_url":"https://api.github.com/repos/wheniwork/loop/events","assignees_url":"https://api.github.com/repos/wheniwork/loop/assignees{/user}","branches_url":"https://api.github.com/repos/wheniwork/loop/branches{/branch}","tags_url":"https://api.github.com/repos/wheniwork/loop/tags","blobs_url":"https://api.github.com/repos/wheniwork/loop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wheniwork/loop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wheniwork/loop/git/refs{/sha}","trees_url":"https://api.github.com/repos/wheniwork/loop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wheniwork/loop/statuses/{sha}","languages_url":"https://api.github.com/repos/wheniwork/loop/languages","stargazers_url":"https://api.github.com/repos/wheniwork/loop/stargazers","contributors_url":"https://api.github.com/repos/wheniwork/loop/contributors","subscribers_url":"https://api.github.com/repos/wheniwork/loop/subscribers","subscription_url":"https://api.github.com/repos/wheniwork/loop/subscription","commits_url":"https://api.github.com/repos/wheniwork/loop/commits{/sha}","git_commits_url":"https://api.github.com/repos/wheniwork/loop/git/commits{/sha}","comments_url":"https://api.github.com/repos/wheniwork/loop/comments{/number}","issue_comment_url":"https://api.github.com/repos/wheniwork/loop/issues/comments{/number}","contents_url":"https://api.github.com/repos/wheniwork/loop/contents/{+path}","compare_url":"https://api.github.com/repos/wheniwork/loop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wheniwork/loop/merges","archive_url":"https://api.github.com/repos/wheniwork/loop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wheniwork/loop/downloads","issues_url":"https://api.github.com/repos/wheniwork/loop/issues{/number}","pulls_url":"https://api.github.com/repos/wheniwork/loop/pulls{/number}","milestones_url":"https://api.github.com/repos/wheniwork/loop/milestones{/number}","notifications_url":"https://api.github.com/repos/wheniwork/loop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wheniwork/loop/labels{/name}","releases_url":"https://api.github.com/repos/wheniwork/loop/releases{/id}","created_at":"2015-07-08T20:52:08Z","updated_at":"2015-07-08T21:01:35Z","pushed_at":"2015-07-30T22:13:37Z","git_url":"git://github.com/wheniwork/loop.git","ssh_url":"git@github.com:wheniwork/loop.git","clone_url":"https://github.com/wheniwork/loop.git","svn_url":"https://github.com/wheniwork/loop","homepage":null,"size":224,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"base":{"label":"wheniwork:feature/refactor-domains","ref":"feature/refactor-domains","sha":"cb48bba867d74773aeff8b6eb656d156e08482ae","user":{"login":"wheniwork","id":1588384,"avatar_url":"https://avatars.githubusercontent.com/u/1588384?v=3","gravatar_id":"","url":"https://api.github.com/users/wheniwork","html_url":"https://github.com/wheniwork","followers_url":"https://api.github.com/users/wheniwork/followers","following_url":"https://api.github.com/users/wheniwork/following{/other_user}","gists_url":"https://api.github.com/users/wheniwork/gists{/gist_id}","starred_url":"https://api.github.com/users/wheniwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wheniwork/subscriptions","organizations_url":"https://api.github.com/users/wheniwork/orgs","repos_url":"https://api.github.com/users/wheniwork/repos","events_url":"https://api.github.com/users/wheniwork/events{/privacy}","received_events_url":"https://api.github.com/users/wheniwork/received_events","type":"Organization","site_admin":false},"repo":{"id":38779343,"name":"loop","full_name":"wheniwork/loop","owner":{"login":"wheniwork","id":1588384,"avatar_url":"https://avatars.githubusercontent.com/u/1588384?v=3","gravatar_id":"","url":"https://api.github.com/users/wheniwork","html_url":"https://github.com/wheniwork","followers_url":"https://api.github.com/users/wheniwork/followers","following_url":"https://api.github.com/users/wheniwork/following{/other_user}","gists_url":"https://api.github.com/users/wheniwork/gists{/gist_id}","starred_url":"https://api.github.com/users/wheniwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wheniwork/subscriptions","organizations_url":"https://api.github.com/users/wheniwork/orgs","repos_url":"https://api.github.com/users/wheniwork/repos","events_url":"https://api.github.com/users/wheniwork/events{/privacy}","received_events_url":"https://api.github.com/users/wheniwork/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wheniwork/loop","description":"","fork":false,"url":"https://api.github.com/repos/wheniwork/loop","forks_url":"https://api.github.com/repos/wheniwork/loop/forks","keys_url":"https://api.github.com/repos/wheniwork/loop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wheniwork/loop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wheniwork/loop/teams","hooks_url":"https://api.github.com/repos/wheniwork/loop/hooks","issue_events_url":"https://api.github.com/repos/wheniwork/loop/issues/events{/number}","events_url":"https://api.github.com/repos/wheniwork/loop/events","assignees_url":"https://api.github.com/repos/wheniwork/loop/assignees{/user}","branches_url":"https://api.github.com/repos/wheniwork/loop/branches{/branch}","tags_url":"https://api.github.com/repos/wheniwork/loop/tags","blobs_url":"https://api.github.com/repos/wheniwork/loop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wheniwork/loop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wheniwork/loop/git/refs{/sha}","trees_url":"https://api.github.com/repos/wheniwork/loop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wheniwork/loop/statuses/{sha}","languages_url":"https://api.github.com/repos/wheniwork/loop/languages","stargazers_url":"https://api.github.com/repos/wheniwork/loop/stargazers","contributors_url":"https://api.github.com/repos/wheniwork/loop/contributors","subscribers_url":"https://api.github.com/repos/wheniwork/loop/subscribers","subscription_url":"https://api.github.com/repos/wheniwork/loop/subscription","commits_url":"https://api.github.com/repos/wheniwork/loop/commits{/sha}","git_commits_url":"https://api.github.com/repos/wheniwork/loop/git/commits{/sha}","comments_url":"https://api.github.com/repos/wheniwork/loop/comments{/number}","issue_comment_url":"https://api.github.com/repos/wheniwork/loop/issues/comments{/number}","contents_url":"https://api.github.com/repos/wheniwork/loop/contents/{+path}","compare_url":"https://api.github.com/repos/wheniwork/loop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wheniwork/loop/merges","archive_url":"https://api.github.com/repos/wheniwork/loop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wheniwork/loop/downloads","issues_url":"https://api.github.com/repos/wheniwork/loop/issues{/number}","pulls_url":"https://api.github.com/repos/wheniwork/loop/pulls{/number}","milestones_url":"https://api.github.com/repos/wheniwork/loop/milestones{/number}","notifications_url":"https://api.github.com/repos/wheniwork/loop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wheniwork/loop/labels{/name}","releases_url":"https://api.github.com/repos/wheniwork/loop/releases{/id}","created_at":"2015-07-08T20:52:08Z","updated_at":"2015-07-08T21:01:35Z","pushed_at":"2015-07-30T22:13:37Z","git_url":"git://github.com/wheniwork/loop.git","ssh_url":"git@github.com:wheniwork/loop.git","clone_url":"https://github.com/wheniwork/loop.git","svn_url":"https://github.com/wheniwork/loop","homepage":null,"size":224,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wheniwork/loop/pulls/5"},"html":{"href":"https://github.com/wheniwork/loop/pull/5"},"issue":{"href":"https://api.github.com/repos/wheniwork/loop/issues/5"},"comments":{"href":"https://api.github.com/repos/wheniwork/loop/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/wheniwork/loop/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/wheniwork/loop/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wheniwork/loop/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/wheniwork/loop/statuses/cef2a106b5efd232372149d750252715af566e19"}}}}