{"action":"created","comment":{"url":"https://api.github.com/repos/spira/spira/pulls/comments/34226316","id":34226316,"diff_hunk":"@@ -1,69 +1,66 @@\n <?php namespace App\\Http\\Controllers;\n \n-use App;\n+use App\\Http\\Transformers\\CollectionTransformerInterface;\n+use App\\Http\\Transformers\\ItemTransformerInterface;\n+use App\\Repositories\\BaseRepository;\n+use App\\Services\\Validator;\n+use Illuminate\\Database\\Eloquent\\ModelNotFoundException;\n use Laravel\\Lumen\\Routing\\Controller;\n-use Symfony\\Component\\HttpKernel\\Exception\\HttpExceptionInterface;\n+use Symfony\\Component\\HttpFoundation\\Response;\n use Illuminate\\Http\\Request;\n-use Illuminate\\Database\\Eloquent\\Model;\n-use Illuminate\\Database\\Eloquent\\Collection;\n \n abstract class BaseController extends Controller\n {\n-    public static $model;\n-\n     /**\n      * Model Repository.\n      *\n-     * @var App\\Repositories\\BaseRepository\n+     * @var BaseRepository\n      */\n     protected $repository;\n \n     /**\n      * Validation service.\n      *\n-     * @var App\\Services\\Validation\\TestValidator\n+     * @var Validator\n      */\n     protected $validator;\n \n-    /**\n-     * Transformer to use for responses.\n-     *\n-     * @var string\n-     */\n-    protected $transformer = 'App\\Http\\Transformers\\BaseTransformer';\n \n     /**\n      * Get all entities.\n      *\n+     * @param CollectionTransformerInterface $transformer\n      * @return Response\n      */\n-    public function getAll()\n+    public function getAll(CollectionTransformerInterface $transformer)\n     {\n-        return $this->collection($this->repository->all());\n+        return response($transformer->transformCollection($this->repository->all()));","path":"api/app/Http/Controllers/BaseController.php","position":53,"original_position":53,"commit_id":"9671f94ccc5a9935b1660a8959905d102a932d16","original_commit_id":"9671f94ccc5a9935b1660a8959905d102a932d16","user":{"login":"Redjik","id":1131017,"avatar_url":"https://avatars.githubusercontent.com/u/1131017?v=3","gravatar_id":"","url":"https://api.github.com/users/Redjik","html_url":"https://github.com/Redjik","followers_url":"https://api.github.com/users/Redjik/followers","following_url":"https://api.github.com/users/Redjik/following{/other_user}","gists_url":"https://api.github.com/users/Redjik/gists{/gist_id}","starred_url":"https://api.github.com/users/Redjik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Redjik/subscriptions","organizations_url":"https://api.github.com/users/Redjik/orgs","repos_url":"https://api.github.com/users/Redjik/repos","events_url":"https://api.github.com/users/Redjik/events{/privacy}","received_events_url":"https://api.github.com/users/Redjik/received_events","type":"User","site_admin":false},"body":"We should discuss transformers in general.\r\nGot some thoughts.","created_at":"2015-07-09T06:16:17Z","updated_at":"2015-07-09T06:16:17Z","html_url":"https://github.com/spira/spira/pull/76#discussion_r34226316","pull_request_url":"https://api.github.com/repos/spira/spira/pulls/76","_links":{"self":{"href":"https://api.github.com/repos/spira/spira/pulls/comments/34226316"},"html":{"href":"https://github.com/spira/spira/pull/76#discussion_r34226316"},"pull_request":{"href":"https://api.github.com/repos/spira/spira/pulls/76"}}},"pull_request":{"url":"https://api.github.com/repos/spira/spira/pulls/76","id":39546283,"html_url":"https://github.com/spira/spira/pull/76","diff_url":"https://github.com/spira/spira/pull/76.diff","patch_url":"https://github.com/spira/spira/pull/76.patch","issue_url":"https://api.github.com/repos/spira/spira/issues/76","number":76,"state":"open","locked":false,"title":"Feature/architecture","user":{"login":"Redjik","id":1131017,"avatar_url":"https://avatars.githubusercontent.com/u/1131017?v=3","gravatar_id":"","url":"https://api.github.com/users/Redjik","html_url":"https://github.com/Redjik","followers_url":"https://api.github.com/users/Redjik/followers","following_url":"https://api.github.com/users/Redjik/following{/other_user}","gists_url":"https://api.github.com/users/Redjik/gists{/gist_id}","starred_url":"https://api.github.com/users/Redjik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Redjik/subscriptions","organizations_url":"https://api.github.com/users/Redjik/orgs","repos_url":"https://api.github.com/users/Redjik/repos","events_url":"https://api.github.com/users/Redjik/events{/privacy}","received_events_url":"https://api.github.com/users/Redjik/received_events","type":"User","site_admin":false},"body":"basic refactoring of\r\n* controllers\r\n* transformers\r\n* respositories\r\n* models","created_at":"2015-07-09T03:59:39Z","updated_at":"2015-07-09T06:16:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d8a2fde397097f1512ee53130045e6a7cc3fd70e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/spira/spira/pulls/76/commits","review_comments_url":"https://api.github.com/repos/spira/spira/pulls/76/comments","review_comment_url":"https://api.github.com/repos/spira/spira/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spira/spira/issues/76/comments","statuses_url":"https://api.github.com/repos/spira/spira/statuses/9671f94ccc5a9935b1660a8959905d102a932d16","head":{"label":"spira:feature/architecture","ref":"feature/architecture","sha":"9671f94ccc5a9935b1660a8959905d102a932d16","user":{"login":"spira","id":12660367,"avatar_url":"https://avatars.githubusercontent.com/u/12660367?v=3","gravatar_id":"","url":"https://api.github.com/users/spira","html_url":"https://github.com/spira","followers_url":"https://api.github.com/users/spira/followers","following_url":"https://api.github.com/users/spira/following{/other_user}","gists_url":"https://api.github.com/users/spira/gists{/gist_id}","starred_url":"https://api.github.com/users/spira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spira/subscriptions","organizations_url":"https://api.github.com/users/spira/orgs","repos_url":"https://api.github.com/users/spira/repos","events_url":"https://api.github.com/users/spira/events{/privacy}","received_events_url":"https://api.github.com/users/spira/received_events","type":"Organization","site_admin":false},"repo":{"id":35469223,"name":"spira","full_name":"spira/spira","owner":{"login":"spira","id":12660367,"avatar_url":"https://avatars.githubusercontent.com/u/12660367?v=3","gravatar_id":"","url":"https://api.github.com/users/spira","html_url":"https://github.com/spira","followers_url":"https://api.github.com/users/spira/followers","following_url":"https://api.github.com/users/spira/following{/other_user}","gists_url":"https://api.github.com/users/spira/gists{/gist_id}","starred_url":"https://api.github.com/users/spira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spira/subscriptions","organizations_url":"https://api.github.com/users/spira/orgs","repos_url":"https://api.github.com/users/spira/repos","events_url":"https://api.github.com/users/spira/events{/privacy}","received_events_url":"https://api.github.com/users/spira/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spira/spira","description":"Lumen + AngularJS with Docker project seed","fork":false,"url":"https://api.github.com/repos/spira/spira","forks_url":"https://api.github.com/repos/spira/spira/forks","keys_url":"https://api.github.com/repos/spira/spira/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spira/spira/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spira/spira/teams","hooks_url":"https://api.github.com/repos/spira/spira/hooks","issue_events_url":"https://api.github.com/repos/spira/spira/issues/events{/number}","events_url":"https://api.github.com/repos/spira/spira/events","assignees_url":"https://api.github.com/repos/spira/spira/assignees{/user}","branches_url":"https://api.github.com/repos/spira/spira/branches{/branch}","tags_url":"https://api.github.com/repos/spira/spira/tags","blobs_url":"https://api.github.com/repos/spira/spira/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spira/spira/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spira/spira/git/refs{/sha}","trees_url":"https://api.github.com/repos/spira/spira/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spira/spira/statuses/{sha}","languages_url":"https://api.github.com/repos/spira/spira/languages","stargazers_url":"https://api.github.com/repos/spira/spira/stargazers","contributors_url":"https://api.github.com/repos/spira/spira/contributors","subscribers_url":"https://api.github.com/repos/spira/spira/subscribers","subscription_url":"https://api.github.com/repos/spira/spira/subscription","commits_url":"https://api.github.com/repos/spira/spira/commits{/sha}","git_commits_url":"https://api.github.com/repos/spira/spira/git/commits{/sha}","comments_url":"https://api.github.com/repos/spira/spira/comments{/number}","issue_comment_url":"https://api.github.com/repos/spira/spira/issues/comments{/number}","contents_url":"https://api.github.com/repos/spira/spira/contents/{+path}","compare_url":"https://api.github.com/repos/spira/spira/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spira/spira/merges","archive_url":"https://api.github.com/repos/spira/spira/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spira/spira/downloads","issues_url":"https://api.github.com/repos/spira/spira/issues{/number}","pulls_url":"https://api.github.com/repos/spira/spira/pulls{/number}","milestones_url":"https://api.github.com/repos/spira/spira/milestones{/number}","notifications_url":"https://api.github.com/repos/spira/spira/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spira/spira/labels{/name}","releases_url":"https://api.github.com/repos/spira/spira/releases{/id}","created_at":"2015-05-12T05:44:10Z","updated_at":"2015-07-03T14:23:58Z","pushed_at":"2015-07-09T04:24:41Z","git_url":"git://github.com/spira/spira.git","ssh_url":"git@github.com:spira/spira.git","clone_url":"https://github.com/spira/spira.git","svn_url":"https://github.com/spira/spira","homepage":"http://spira.github.io","size":1600,"stargazers_count":7,"watchers_count":7,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":6,"forks":4,"open_issues":6,"watchers":7,"default_branch":"master"}},"base":{"label":"spira:master","ref":"master","sha":"22e980fa12083658e4eae6bf3a872037ca292d98","user":{"login":"spira","id":12660367,"avatar_url":"https://avatars.githubusercontent.com/u/12660367?v=3","gravatar_id":"","url":"https://api.github.com/users/spira","html_url":"https://github.com/spira","followers_url":"https://api.github.com/users/spira/followers","following_url":"https://api.github.com/users/spira/following{/other_user}","gists_url":"https://api.github.com/users/spira/gists{/gist_id}","starred_url":"https://api.github.com/users/spira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spira/subscriptions","organizations_url":"https://api.github.com/users/spira/orgs","repos_url":"https://api.github.com/users/spira/repos","events_url":"https://api.github.com/users/spira/events{/privacy}","received_events_url":"https://api.github.com/users/spira/received_events","type":"Organization","site_admin":false},"repo":{"id":35469223,"name":"spira","full_name":"spira/spira","owner":{"login":"spira","id":12660367,"avatar_url":"https://avatars.githubusercontent.com/u/12660367?v=3","gravatar_id":"","url":"https://api.github.com/users/spira","html_url":"https://github.com/spira","followers_url":"https://api.github.com/users/spira/followers","following_url":"https://api.github.com/users/spira/following{/other_user}","gists_url":"https://api.github.com/users/spira/gists{/gist_id}","starred_url":"https://api.github.com/users/spira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spira/subscriptions","organizations_url":"https://api.github.com/users/spira/orgs","repos_url":"https://api.github.com/users/spira/repos","events_url":"https://api.github.com/users/spira/events{/privacy}","received_events_url":"https://api.github.com/users/spira/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spira/spira","description":"Lumen + AngularJS with Docker project seed","fork":false,"url":"https://api.github.com/repos/spira/spira","forks_url":"https://api.github.com/repos/spira/spira/forks","keys_url":"https://api.github.com/repos/spira/spira/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spira/spira/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spira/spira/teams","hooks_url":"https://api.github.com/repos/spira/spira/hooks","issue_events_url":"https://api.github.com/repos/spira/spira/issues/events{/number}","events_url":"https://api.github.com/repos/spira/spira/events","assignees_url":"https://api.github.com/repos/spira/spira/assignees{/user}","branches_url":"https://api.github.com/repos/spira/spira/branches{/branch}","tags_url":"https://api.github.com/repos/spira/spira/tags","blobs_url":"https://api.github.com/repos/spira/spira/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spira/spira/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spira/spira/git/refs{/sha}","trees_url":"https://api.github.com/repos/spira/spira/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spira/spira/statuses/{sha}","languages_url":"https://api.github.com/repos/spira/spira/languages","stargazers_url":"https://api.github.com/repos/spira/spira/stargazers","contributors_url":"https://api.github.com/repos/spira/spira/contributors","subscribers_url":"https://api.github.com/repos/spira/spira/subscribers","subscription_url":"https://api.github.com/repos/spira/spira/subscription","commits_url":"https://api.github.com/repos/spira/spira/commits{/sha}","git_commits_url":"https://api.github.com/repos/spira/spira/git/commits{/sha}","comments_url":"https://api.github.com/repos/spira/spira/comments{/number}","issue_comment_url":"https://api.github.com/repos/spira/spira/issues/comments{/number}","contents_url":"https://api.github.com/repos/spira/spira/contents/{+path}","compare_url":"https://api.github.com/repos/spira/spira/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spira/spira/merges","archive_url":"https://api.github.com/repos/spira/spira/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spira/spira/downloads","issues_url":"https://api.github.com/repos/spira/spira/issues{/number}","pulls_url":"https://api.github.com/repos/spira/spira/pulls{/number}","milestones_url":"https://api.github.com/repos/spira/spira/milestones{/number}","notifications_url":"https://api.github.com/repos/spira/spira/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spira/spira/labels{/name}","releases_url":"https://api.github.com/repos/spira/spira/releases{/id}","created_at":"2015-05-12T05:44:10Z","updated_at":"2015-07-03T14:23:58Z","pushed_at":"2015-07-09T04:24:41Z","git_url":"git://github.com/spira/spira.git","ssh_url":"git@github.com:spira/spira.git","clone_url":"https://github.com/spira/spira.git","svn_url":"https://github.com/spira/spira","homepage":"http://spira.github.io","size":1600,"stargazers_count":7,"watchers_count":7,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":6,"forks":4,"open_issues":6,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spira/spira/pulls/76"},"html":{"href":"https://github.com/spira/spira/pull/76"},"issue":{"href":"https://api.github.com/repos/spira/spira/issues/76"},"comments":{"href":"https://api.github.com/repos/spira/spira/issues/76/comments"},"review_comments":{"href":"https://api.github.com/repos/spira/spira/pulls/76/comments"},"review_comment":{"href":"https://api.github.com/repos/spira/spira/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spira/spira/pulls/76/commits"},"statuses":{"href":"https://api.github.com/repos/spira/spira/statuses/9671f94ccc5a9935b1660a8959905d102a932d16"}}}}