{"action":"created","comment":{"url":"https://api.github.com/repos/yiisoft/yii2/pulls/comments/39372341","id":39372341,"diff_hunk":"@@ -762,12 +780,11 @@ public function updateCounters($counters)\n     {\n         if ($this->updateAllCounters($counters, $this->getOldPrimaryKey(true)) > 0) {\n             foreach ($counters as $name => $value) {\n-                if (!isset($this->_attributes[$name])) {\n-                    $this->_attributes[$name] = $value;\n-                } else {\n-                    $this->_attributes[$name] += $value;\n+                if (null !== $current = $this->getAttribute($name)) {","path":"framework/db/BaseActiveRecord.php","position":172,"original_position":172,"commit_id":"715c8c807e329bbeaef3d3f3185646b3e541192f","original_commit_id":"d629351c6112798f22d3ef1f7a26394f16e0a5a9","user":{"login":"SamMousa","id":547021,"avatar_url":"https://avatars.githubusercontent.com/u/547021?v=3","gravatar_id":"","url":"https://api.github.com/users/SamMousa","html_url":"https://github.com/SamMousa","followers_url":"https://api.github.com/users/SamMousa/followers","following_url":"https://api.github.com/users/SamMousa/following{/other_user}","gists_url":"https://api.github.com/users/SamMousa/gists{/gist_id}","starred_url":"https://api.github.com/users/SamMousa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamMousa/subscriptions","organizations_url":"https://api.github.com/users/SamMousa/orgs","repos_url":"https://api.github.com/users/SamMousa/repos","events_url":"https://api.github.com/users/SamMousa/events{/privacy}","received_events_url":"https://api.github.com/users/SamMousa/received_events","type":"User","site_admin":false},"body":"This is subjective, so if you want me to change it I will.\r\n\r\nMy reasoning:\r\n\r\n($a = $b) == $c \r\n\r\nand\r\n\r\n$a = $b == $c\r\n\r\nhave the same return value, but will result in diferent side effects. \r\nWhen reading either of them I have to think about brackets or operator priority. Whereas:\r\n\r\n       $c == $a = $b \r\n\r\nIs unambiguous without brackets.\r\n","created_at":"2015-09-14T08:54:43Z","updated_at":"2015-09-14T08:54:43Z","html_url":"https://github.com/yiisoft/yii2/pull/9683#discussion_r39372341","pull_request_url":"https://api.github.com/repos/yiisoft/yii2/pulls/9683","_links":{"self":{"href":"https://api.github.com/repos/yiisoft/yii2/pulls/comments/39372341"},"html":{"href":"https://github.com/yiisoft/yii2/pull/9683#discussion_r39372341"},"pull_request":{"href":"https://api.github.com/repos/yiisoft/yii2/pulls/9683"}}},"pull_request":{"url":"https://api.github.com/repos/yiisoft/yii2/pulls/9683","id":44901083,"html_url":"https://github.com/yiisoft/yii2/pull/9683","diff_url":"https://github.com/yiisoft/yii2/pull/9683.diff","patch_url":"https://github.com/yiisoft/yii2/pull/9683.patch","issue_url":"https://api.github.com/repos/yiisoft/yii2/issues/9683","number":9683,"state":"open","locked":false,"title":"Fix issue 9656 optimized","user":{"login":"SamMousa","id":547021,"avatar_url":"https://avatars.githubusercontent.com/u/547021?v=3","gravatar_id":"","url":"https://api.github.com/users/SamMousa","html_url":"https://github.com/SamMousa","followers_url":"https://api.github.com/users/SamMousa/followers","following_url":"https://api.github.com/users/SamMousa/following{/other_user}","gists_url":"https://api.github.com/users/SamMousa/gists{/gist_id}","starred_url":"https://api.github.com/users/SamMousa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamMousa/subscriptions","organizations_url":"https://api.github.com/users/SamMousa/orgs","repos_url":"https://api.github.com/users/SamMousa/repos","events_url":"https://api.github.com/users/SamMousa/events{/privacy}","received_events_url":"https://api.github.com/users/SamMousa/received_events","type":"User","site_admin":false},"body":"Does not break public API and should pass all tests!","created_at":"2015-09-14T07:45:51Z","updated_at":"2015-09-14T08:54:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4f0b3f042dddf1a857ace5de6d5e6a93fb02dc31","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/yiisoft/yii2/pulls/9683/commits","review_comments_url":"https://api.github.com/repos/yiisoft/yii2/pulls/9683/comments","review_comment_url":"https://api.github.com/repos/yiisoft/yii2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/9683/comments","statuses_url":"https://api.github.com/repos/yiisoft/yii2/statuses/715c8c807e329bbeaef3d3f3185646b3e541192f","head":{"label":"SamMousa:fix-issue-9656-optimized","ref":"fix-issue-9656-optimized","sha":"715c8c807e329bbeaef3d3f3185646b3e541192f","user":{"login":"SamMousa","id":547021,"avatar_url":"https://avatars.githubusercontent.com/u/547021?v=3","gravatar_id":"","url":"https://api.github.com/users/SamMousa","html_url":"https://github.com/SamMousa","followers_url":"https://api.github.com/users/SamMousa/followers","following_url":"https://api.github.com/users/SamMousa/following{/other_user}","gists_url":"https://api.github.com/users/SamMousa/gists{/gist_id}","starred_url":"https://api.github.com/users/SamMousa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamMousa/subscriptions","organizations_url":"https://api.github.com/users/SamMousa/orgs","repos_url":"https://api.github.com/users/SamMousa/repos","events_url":"https://api.github.com/users/SamMousa/events{/privacy}","received_events_url":"https://api.github.com/users/SamMousa/received_events","type":"User","site_admin":false},"repo":{"id":31261382,"name":"yii2","full_name":"SamMousa/yii2","owner":{"login":"SamMousa","id":547021,"avatar_url":"https://avatars.githubusercontent.com/u/547021?v=3","gravatar_id":"","url":"https://api.github.com/users/SamMousa","html_url":"https://github.com/SamMousa","followers_url":"https://api.github.com/users/SamMousa/followers","following_url":"https://api.github.com/users/SamMousa/following{/other_user}","gists_url":"https://api.github.com/users/SamMousa/gists{/gist_id}","starred_url":"https://api.github.com/users/SamMousa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamMousa/subscriptions","organizations_url":"https://api.github.com/users/SamMousa/orgs","repos_url":"https://api.github.com/users/SamMousa/repos","events_url":"https://api.github.com/users/SamMousa/events{/privacy}","received_events_url":"https://api.github.com/users/SamMousa/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/SamMousa/yii2","description":"Yii 2 framework main development repo","fork":true,"url":"https://api.github.com/repos/SamMousa/yii2","forks_url":"https://api.github.com/repos/SamMousa/yii2/forks","keys_url":"https://api.github.com/repos/SamMousa/yii2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SamMousa/yii2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SamMousa/yii2/teams","hooks_url":"https://api.github.com/repos/SamMousa/yii2/hooks","issue_events_url":"https://api.github.com/repos/SamMousa/yii2/issues/events{/number}","events_url":"https://api.github.com/repos/SamMousa/yii2/events","assignees_url":"https://api.github.com/repos/SamMousa/yii2/assignees{/user}","branches_url":"https://api.github.com/repos/SamMousa/yii2/branches{/branch}","tags_url":"https://api.github.com/repos/SamMousa/yii2/tags","blobs_url":"https://api.github.com/repos/SamMousa/yii2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SamMousa/yii2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SamMousa/yii2/git/refs{/sha}","trees_url":"https://api.github.com/repos/SamMousa/yii2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SamMousa/yii2/statuses/{sha}","languages_url":"https://api.github.com/repos/SamMousa/yii2/languages","stargazers_url":"https://api.github.com/repos/SamMousa/yii2/stargazers","contributors_url":"https://api.github.com/repos/SamMousa/yii2/contributors","subscribers_url":"https://api.github.com/repos/SamMousa/yii2/subscribers","subscription_url":"https://api.github.com/repos/SamMousa/yii2/subscription","commits_url":"https://api.github.com/repos/SamMousa/yii2/commits{/sha}","git_commits_url":"https://api.github.com/repos/SamMousa/yii2/git/commits{/sha}","comments_url":"https://api.github.com/repos/SamMousa/yii2/comments{/number}","issue_comment_url":"https://api.github.com/repos/SamMousa/yii2/issues/comments{/number}","contents_url":"https://api.github.com/repos/SamMousa/yii2/contents/{+path}","compare_url":"https://api.github.com/repos/SamMousa/yii2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SamMousa/yii2/merges","archive_url":"https://api.github.com/repos/SamMousa/yii2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SamMousa/yii2/downloads","issues_url":"https://api.github.com/repos/SamMousa/yii2/issues{/number}","pulls_url":"https://api.github.com/repos/SamMousa/yii2/pulls{/number}","milestones_url":"https://api.github.com/repos/SamMousa/yii2/milestones{/number}","notifications_url":"https://api.github.com/repos/SamMousa/yii2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SamMousa/yii2/labels{/name}","releases_url":"https://api.github.com/repos/SamMousa/yii2/releases{/id}","created_at":"2015-02-24T13:32:17Z","updated_at":"2015-02-24T13:32:22Z","pushed_at":"2015-09-14T08:22:38Z","git_url":"git://github.com/SamMousa/yii2.git","ssh_url":"git@github.com:SamMousa/yii2.git","clone_url":"https://github.com/SamMousa/yii2.git","svn_url":"https://github.com/SamMousa/yii2","homepage":"http://www.yiiframework.com","size":36040,"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":"yiisoft:master","ref":"master","sha":"efb61c350b38084886de2c0b7cfb28d45601aa01","user":{"login":"yiisoft","id":993323,"avatar_url":"https://avatars.githubusercontent.com/u/993323?v=3","gravatar_id":"","url":"https://api.github.com/users/yiisoft","html_url":"https://github.com/yiisoft","followers_url":"https://api.github.com/users/yiisoft/followers","following_url":"https://api.github.com/users/yiisoft/following{/other_user}","gists_url":"https://api.github.com/users/yiisoft/gists{/gist_id}","starred_url":"https://api.github.com/users/yiisoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yiisoft/subscriptions","organizations_url":"https://api.github.com/users/yiisoft/orgs","repos_url":"https://api.github.com/users/yiisoft/repos","events_url":"https://api.github.com/users/yiisoft/events{/privacy}","received_events_url":"https://api.github.com/users/yiisoft/received_events","type":"Organization","site_admin":false},"repo":{"id":3431193,"name":"yii2","full_name":"yiisoft/yii2","owner":{"login":"yiisoft","id":993323,"avatar_url":"https://avatars.githubusercontent.com/u/993323?v=3","gravatar_id":"","url":"https://api.github.com/users/yiisoft","html_url":"https://github.com/yiisoft","followers_url":"https://api.github.com/users/yiisoft/followers","following_url":"https://api.github.com/users/yiisoft/following{/other_user}","gists_url":"https://api.github.com/users/yiisoft/gists{/gist_id}","starred_url":"https://api.github.com/users/yiisoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yiisoft/subscriptions","organizations_url":"https://api.github.com/users/yiisoft/orgs","repos_url":"https://api.github.com/users/yiisoft/repos","events_url":"https://api.github.com/users/yiisoft/events{/privacy}","received_events_url":"https://api.github.com/users/yiisoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yiisoft/yii2","description":"Yii 2 framework main development repo","fork":false,"url":"https://api.github.com/repos/yiisoft/yii2","forks_url":"https://api.github.com/repos/yiisoft/yii2/forks","keys_url":"https://api.github.com/repos/yiisoft/yii2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yiisoft/yii2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yiisoft/yii2/teams","hooks_url":"https://api.github.com/repos/yiisoft/yii2/hooks","issue_events_url":"https://api.github.com/repos/yiisoft/yii2/issues/events{/number}","events_url":"https://api.github.com/repos/yiisoft/yii2/events","assignees_url":"https://api.github.com/repos/yiisoft/yii2/assignees{/user}","branches_url":"https://api.github.com/repos/yiisoft/yii2/branches{/branch}","tags_url":"https://api.github.com/repos/yiisoft/yii2/tags","blobs_url":"https://api.github.com/repos/yiisoft/yii2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yiisoft/yii2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yiisoft/yii2/git/refs{/sha}","trees_url":"https://api.github.com/repos/yiisoft/yii2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yiisoft/yii2/statuses/{sha}","languages_url":"https://api.github.com/repos/yiisoft/yii2/languages","stargazers_url":"https://api.github.com/repos/yiisoft/yii2/stargazers","contributors_url":"https://api.github.com/repos/yiisoft/yii2/contributors","subscribers_url":"https://api.github.com/repos/yiisoft/yii2/subscribers","subscription_url":"https://api.github.com/repos/yiisoft/yii2/subscription","commits_url":"https://api.github.com/repos/yiisoft/yii2/commits{/sha}","git_commits_url":"https://api.github.com/repos/yiisoft/yii2/git/commits{/sha}","comments_url":"https://api.github.com/repos/yiisoft/yii2/comments{/number}","issue_comment_url":"https://api.github.com/repos/yiisoft/yii2/issues/comments{/number}","contents_url":"https://api.github.com/repos/yiisoft/yii2/contents/{+path}","compare_url":"https://api.github.com/repos/yiisoft/yii2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yiisoft/yii2/merges","archive_url":"https://api.github.com/repos/yiisoft/yii2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yiisoft/yii2/downloads","issues_url":"https://api.github.com/repos/yiisoft/yii2/issues{/number}","pulls_url":"https://api.github.com/repos/yiisoft/yii2/pulls{/number}","milestones_url":"https://api.github.com/repos/yiisoft/yii2/milestones{/number}","notifications_url":"https://api.github.com/repos/yiisoft/yii2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yiisoft/yii2/labels{/name}","releases_url":"https://api.github.com/repos/yiisoft/yii2/releases{/id}","created_at":"2012-02-13T15:32:36Z","updated_at":"2015-09-14T03:28:46Z","pushed_at":"2015-09-14T08:22:41Z","git_url":"git://github.com/yiisoft/yii2.git","ssh_url":"git@github.com:yiisoft/yii2.git","clone_url":"https://github.com/yiisoft/yii2.git","svn_url":"https://github.com/yiisoft/yii2","homepage":"http://www.yiiframework.com","size":93851,"stargazers_count":6604,"watchers_count":6604,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3832,"mirror_url":null,"open_issues_count":1022,"forks":3832,"open_issues":1022,"watchers":6604,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yiisoft/yii2/pulls/9683"},"html":{"href":"https://github.com/yiisoft/yii2/pull/9683"},"issue":{"href":"https://api.github.com/repos/yiisoft/yii2/issues/9683"},"comments":{"href":"https://api.github.com/repos/yiisoft/yii2/issues/9683/comments"},"review_comments":{"href":"https://api.github.com/repos/yiisoft/yii2/pulls/9683/comments"},"review_comment":{"href":"https://api.github.com/repos/yiisoft/yii2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yiisoft/yii2/pulls/9683/commits"},"statuses":{"href":"https://api.github.com/repos/yiisoft/yii2/statuses/715c8c807e329bbeaef3d3f3185646b3e541192f"}}}}