{"action":"closed","number":42,"pull_request":{"url":"https://api.github.com/repos/njbarrett/laravel-postgis/pulls/42","id":62693530,"html_url":"https://github.com/njbarrett/laravel-postgis/pull/42","diff_url":"https://github.com/njbarrett/laravel-postgis/pull/42.diff","patch_url":"https://github.com/njbarrett/laravel-postgis/pull/42.patch","issue_url":"https://api.github.com/repos/njbarrett/laravel-postgis/issues/42","number":42,"state":"closed","locked":false,"title":"Pass by reference bug","user":{"login":"OpusDevTeam","id":16790228,"avatar_url":"https://avatars.githubusercontent.com/u/16790228?v=3","gravatar_id":"","url":"https://api.github.com/users/OpusDevTeam","html_url":"https://github.com/OpusDevTeam","followers_url":"https://api.github.com/users/OpusDevTeam/followers","following_url":"https://api.github.com/users/OpusDevTeam/following{/other_user}","gists_url":"https://api.github.com/users/OpusDevTeam/gists{/gist_id}","starred_url":"https://api.github.com/users/OpusDevTeam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpusDevTeam/subscriptions","organizations_url":"https://api.github.com/users/OpusDevTeam/orgs","repos_url":"https://api.github.com/users/OpusDevTeam/repos","events_url":"https://api.github.com/users/OpusDevTeam/events{/privacy}","received_events_url":"https://api.github.com/users/OpusDevTeam/received_events","type":"User","site_admin":false},"body":"Nasty little bug here, in that ```$value``` is a referenced variable but it is then re-used again in another foreach loop further down.\r\n\r\nEasy solution is avoid the risky pass-by-reference altogether as ```$this->attributes[$key] = ...``` will suffice for updating any existing values on the model.\r\n\r\nThis [stack overflow question](http://stackoverflow.com/questions/3307409/php-pass-by-reference-in-foreach) sums up the exact problem quite nicely.","created_at":"2016-03-14T02:22:34Z","updated_at":"2016-05-14T05:21:54Z","closed_at":"2016-05-14T05:21:54Z","merged_at":"2016-05-14T05:21:54Z","merge_commit_sha":"3d63781d223699e35ce190323f3488914c199351","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/njbarrett/laravel-postgis/pulls/42/commits","review_comments_url":"https://api.github.com/repos/njbarrett/laravel-postgis/pulls/42/comments","review_comment_url":"https://api.github.com/repos/njbarrett/laravel-postgis/pulls/comments{/number}","comments_url":"https://api.github.com/repos/njbarrett/laravel-postgis/issues/42/comments","statuses_url":"https://api.github.com/repos/njbarrett/laravel-postgis/statuses/3d63781d223699e35ce190323f3488914c199351","head":{"label":"OpusDevTeam:master","ref":"master","sha":"3d63781d223699e35ce190323f3488914c199351","user":{"login":"OpusDevTeam","id":16790228,"avatar_url":"https://avatars.githubusercontent.com/u/16790228?v=3","gravatar_id":"","url":"https://api.github.com/users/OpusDevTeam","html_url":"https://github.com/OpusDevTeam","followers_url":"https://api.github.com/users/OpusDevTeam/followers","following_url":"https://api.github.com/users/OpusDevTeam/following{/other_user}","gists_url":"https://api.github.com/users/OpusDevTeam/gists{/gist_id}","starred_url":"https://api.github.com/users/OpusDevTeam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpusDevTeam/subscriptions","organizations_url":"https://api.github.com/users/OpusDevTeam/orgs","repos_url":"https://api.github.com/users/OpusDevTeam/repos","events_url":"https://api.github.com/users/OpusDevTeam/events{/privacy}","received_events_url":"https://api.github.com/users/OpusDevTeam/received_events","type":"User","site_admin":false},"repo":{"id":53819554,"name":"laravel-postgis","full_name":"OpusDevTeam/laravel-postgis","owner":{"login":"OpusDevTeam","id":16790228,"avatar_url":"https://avatars.githubusercontent.com/u/16790228?v=3","gravatar_id":"","url":"https://api.github.com/users/OpusDevTeam","html_url":"https://github.com/OpusDevTeam","followers_url":"https://api.github.com/users/OpusDevTeam/followers","following_url":"https://api.github.com/users/OpusDevTeam/following{/other_user}","gists_url":"https://api.github.com/users/OpusDevTeam/gists{/gist_id}","starred_url":"https://api.github.com/users/OpusDevTeam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpusDevTeam/subscriptions","organizations_url":"https://api.github.com/users/OpusDevTeam/orgs","repos_url":"https://api.github.com/users/OpusDevTeam/repos","events_url":"https://api.github.com/users/OpusDevTeam/events{/privacy}","received_events_url":"https://api.github.com/users/OpusDevTeam/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/OpusDevTeam/laravel-postgis","description":"Postgis extensions for laravel. Aims to make it easy to work with geometries from laravel models.","fork":true,"url":"https://api.github.com/repos/OpusDevTeam/laravel-postgis","forks_url":"https://api.github.com/repos/OpusDevTeam/laravel-postgis/forks","keys_url":"https://api.github.com/repos/OpusDevTeam/laravel-postgis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpusDevTeam/laravel-postgis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpusDevTeam/laravel-postgis/teams","hooks_url":"https://api.github.com/repos/OpusDevTeam/laravel-postgis/hooks","issue_events_url":"https://api.github.com/repos/OpusDevTeam/laravel-postgis/issues/events{/number}","events_url":"https://api.github.com/repos/OpusDevTeam/laravel-postgis/events","assignees_url":"https://api.github.com/repos/OpusDevTeam/laravel-postgis/assignees{/user}","branches_url":"https://api.github.com/repos/OpusDevTeam/laravel-postgis/branches{/branch}","tags_url":"https://api.github.com/repos/OpusDevTeam/laravel-postgis/tags","blobs_url":"https://api.github.com/repos/OpusDevTeam/laravel-postgis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpusDevTeam/laravel-postgis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpusDevTeam/laravel-postgis/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpusDevTeam/laravel-postgis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpusDevTeam/laravel-postgis/statuses/{sha}","languages_url":"https://api.github.com/repos/OpusDevTeam/laravel-postgis/languages","stargazers_url":"https://api.github.com/repos/OpusDevTeam/laravel-postgis/stargazers","contributors_url":"https://api.github.com/repos/OpusDevTeam/laravel-postgis/contributors","subscribers_url":"https://api.github.com/repos/OpusDevTeam/laravel-postgis/subscribers","subscription_url":"https://api.github.com/repos/OpusDevTeam/laravel-postgis/subscription","commits_url":"https://api.github.com/repos/OpusDevTeam/laravel-postgis/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpusDevTeam/laravel-postgis/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpusDevTeam/laravel-postgis/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpusDevTeam/laravel-postgis/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpusDevTeam/laravel-postgis/contents/{+path}","compare_url":"https://api.github.com/repos/OpusDevTeam/laravel-postgis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpusDevTeam/laravel-postgis/merges","archive_url":"https://api.github.com/repos/OpusDevTeam/laravel-postgis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpusDevTeam/laravel-postgis/downloads","issues_url":"https://api.github.com/repos/OpusDevTeam/laravel-postgis/issues{/number}","pulls_url":"https://api.github.com/repos/OpusDevTeam/laravel-postgis/pulls{/number}","milestones_url":"https://api.github.com/repos/OpusDevTeam/laravel-postgis/milestones{/number}","notifications_url":"https://api.github.com/repos/OpusDevTeam/laravel-postgis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpusDevTeam/laravel-postgis/labels{/name}","releases_url":"https://api.github.com/repos/OpusDevTeam/laravel-postgis/releases{/id}","deployments_url":"https://api.github.com/repos/OpusDevTeam/laravel-postgis/deployments","created_at":"2016-03-14T02:04:17Z","updated_at":"2016-03-14T02:04:18Z","pushed_at":"2016-05-09T05:37:41Z","git_url":"git://github.com/OpusDevTeam/laravel-postgis.git","ssh_url":"git@github.com:OpusDevTeam/laravel-postgis.git","clone_url":"https://github.com/OpusDevTeam/laravel-postgis.git","svn_url":"https://github.com/OpusDevTeam/laravel-postgis","homepage":null,"size":96,"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":"njbarrett:master","ref":"master","sha":"fe880cdaf16f5e660e15cee5c91ef44ad513a0ff","user":{"login":"njbarrett","id":241407,"avatar_url":"https://avatars.githubusercontent.com/u/241407?v=3","gravatar_id":"","url":"https://api.github.com/users/njbarrett","html_url":"https://github.com/njbarrett","followers_url":"https://api.github.com/users/njbarrett/followers","following_url":"https://api.github.com/users/njbarrett/following{/other_user}","gists_url":"https://api.github.com/users/njbarrett/gists{/gist_id}","starred_url":"https://api.github.com/users/njbarrett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/njbarrett/subscriptions","organizations_url":"https://api.github.com/users/njbarrett/orgs","repos_url":"https://api.github.com/users/njbarrett/repos","events_url":"https://api.github.com/users/njbarrett/events{/privacy}","received_events_url":"https://api.github.com/users/njbarrett/received_events","type":"User","site_admin":false},"repo":{"id":32176699,"name":"laravel-postgis","full_name":"njbarrett/laravel-postgis","owner":{"login":"njbarrett","id":241407,"avatar_url":"https://avatars.githubusercontent.com/u/241407?v=3","gravatar_id":"","url":"https://api.github.com/users/njbarrett","html_url":"https://github.com/njbarrett","followers_url":"https://api.github.com/users/njbarrett/followers","following_url":"https://api.github.com/users/njbarrett/following{/other_user}","gists_url":"https://api.github.com/users/njbarrett/gists{/gist_id}","starred_url":"https://api.github.com/users/njbarrett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/njbarrett/subscriptions","organizations_url":"https://api.github.com/users/njbarrett/orgs","repos_url":"https://api.github.com/users/njbarrett/repos","events_url":"https://api.github.com/users/njbarrett/events{/privacy}","received_events_url":"https://api.github.com/users/njbarrett/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/njbarrett/laravel-postgis","description":"Postgis extensions for laravel. Aims to make it easy to work with geometries from laravel models.","fork":false,"url":"https://api.github.com/repos/njbarrett/laravel-postgis","forks_url":"https://api.github.com/repos/njbarrett/laravel-postgis/forks","keys_url":"https://api.github.com/repos/njbarrett/laravel-postgis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/njbarrett/laravel-postgis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/njbarrett/laravel-postgis/teams","hooks_url":"https://api.github.com/repos/njbarrett/laravel-postgis/hooks","issue_events_url":"https://api.github.com/repos/njbarrett/laravel-postgis/issues/events{/number}","events_url":"https://api.github.com/repos/njbarrett/laravel-postgis/events","assignees_url":"https://api.github.com/repos/njbarrett/laravel-postgis/assignees{/user}","branches_url":"https://api.github.com/repos/njbarrett/laravel-postgis/branches{/branch}","tags_url":"https://api.github.com/repos/njbarrett/laravel-postgis/tags","blobs_url":"https://api.github.com/repos/njbarrett/laravel-postgis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/njbarrett/laravel-postgis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/njbarrett/laravel-postgis/git/refs{/sha}","trees_url":"https://api.github.com/repos/njbarrett/laravel-postgis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/njbarrett/laravel-postgis/statuses/{sha}","languages_url":"https://api.github.com/repos/njbarrett/laravel-postgis/languages","stargazers_url":"https://api.github.com/repos/njbarrett/laravel-postgis/stargazers","contributors_url":"https://api.github.com/repos/njbarrett/laravel-postgis/contributors","subscribers_url":"https://api.github.com/repos/njbarrett/laravel-postgis/subscribers","subscription_url":"https://api.github.com/repos/njbarrett/laravel-postgis/subscription","commits_url":"https://api.github.com/repos/njbarrett/laravel-postgis/commits{/sha}","git_commits_url":"https://api.github.com/repos/njbarrett/laravel-postgis/git/commits{/sha}","comments_url":"https://api.github.com/repos/njbarrett/laravel-postgis/comments{/number}","issue_comment_url":"https://api.github.com/repos/njbarrett/laravel-postgis/issues/comments{/number}","contents_url":"https://api.github.com/repos/njbarrett/laravel-postgis/contents/{+path}","compare_url":"https://api.github.com/repos/njbarrett/laravel-postgis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/njbarrett/laravel-postgis/merges","archive_url":"https://api.github.com/repos/njbarrett/laravel-postgis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/njbarrett/laravel-postgis/downloads","issues_url":"https://api.github.com/repos/njbarrett/laravel-postgis/issues{/number}","pulls_url":"https://api.github.com/repos/njbarrett/laravel-postgis/pulls{/number}","milestones_url":"https://api.github.com/repos/njbarrett/laravel-postgis/milestones{/number}","notifications_url":"https://api.github.com/repos/njbarrett/laravel-postgis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/njbarrett/laravel-postgis/labels{/name}","releases_url":"https://api.github.com/repos/njbarrett/laravel-postgis/releases{/id}","deployments_url":"https://api.github.com/repos/njbarrett/laravel-postgis/deployments","created_at":"2015-03-13T19:34:58Z","updated_at":"2016-05-13T20:40:04Z","pushed_at":"2016-05-14T05:21:54Z","git_url":"git://github.com/njbarrett/laravel-postgis.git","ssh_url":"git@github.com:njbarrett/laravel-postgis.git","clone_url":"https://github.com/njbarrett/laravel-postgis.git","svn_url":"https://github.com/njbarrett/laravel-postgis","homepage":null,"size":101,"stargazers_count":48,"watchers_count":48,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":33,"mirror_url":null,"open_issues_count":14,"forks":33,"open_issues":14,"watchers":48,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/njbarrett/laravel-postgis/pulls/42"},"html":{"href":"https://github.com/njbarrett/laravel-postgis/pull/42"},"issue":{"href":"https://api.github.com/repos/njbarrett/laravel-postgis/issues/42"},"comments":{"href":"https://api.github.com/repos/njbarrett/laravel-postgis/issues/42/comments"},"review_comments":{"href":"https://api.github.com/repos/njbarrett/laravel-postgis/pulls/42/comments"},"review_comment":{"href":"https://api.github.com/repos/njbarrett/laravel-postgis/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/njbarrett/laravel-postgis/pulls/42/commits"},"statuses":{"href":"https://api.github.com/repos/njbarrett/laravel-postgis/statuses/3d63781d223699e35ce190323f3488914c199351"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"njbarrett","id":241407,"avatar_url":"https://avatars.githubusercontent.com/u/241407?v=3","gravatar_id":"","url":"https://api.github.com/users/njbarrett","html_url":"https://github.com/njbarrett","followers_url":"https://api.github.com/users/njbarrett/followers","following_url":"https://api.github.com/users/njbarrett/following{/other_user}","gists_url":"https://api.github.com/users/njbarrett/gists{/gist_id}","starred_url":"https://api.github.com/users/njbarrett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/njbarrett/subscriptions","organizations_url":"https://api.github.com/users/njbarrett/orgs","repos_url":"https://api.github.com/users/njbarrett/repos","events_url":"https://api.github.com/users/njbarrett/events{/privacy}","received_events_url":"https://api.github.com/users/njbarrett/received_events","type":"User","site_admin":false},"comments":1,"review_comments":0,"commits":2,"additions":6,"deletions":6,"changed_files":2}}