{"action":"created","comment":{"url":"https://api.github.com/repos/Soullivaneuh/composer-lint/pulls/comments/65007647","id":65007647,"diff_hunk":"@@ -0,0 +1,52 @@\n+<?php\n+\n+namespace SLLH\\ComposerLint;\n+\n+/**\n+ * @author Sullivan Senechal <soullivaneuh@gmail.com>\n+ */\n+final class Linter\n+{\n+    /**\n+     * @param array $manifest composer.json file manifest\n+     *\n+     * @return string[]\n+     */\n+    public function validate($manifest)\n+    {\n+        $errors = array();\n+\n+        if (isset($manifest['config']['sort-packages']) && $manifest['config']['sort-packages']) {\n+            foreach (array('require', 'require-dev', 'conflict', 'replace', 'provide', 'suggest') as $linksSection) {\n+                if (array_key_exists($linksSection, $manifest) && !$this->packagesAreSorted($manifest[$linksSection])) {\n+                    array_push($errors, 'Links under '.$linksSection.' section are not sorted.');\n+                }\n+            }\n+        }\n+\n+        return $errors;\n+    }\n+\n+    private function packagesAreSorted(array $packages)\n+    {\n+        $names = array_keys($packages);\n+\n+        $hasPHP = in_array('php', $names);\n+        $extNames = array_filter($names, function ($name) {\n+            return 'ext-' === substr($name, 0, 4) && !strstr($name, '/');","path":"src/Linter.php","position":36,"original_position":36,"commit_id":"82892b35fe5767ede13aa8ad56207b16489672bd","original_commit_id":"82892b35fe5767ede13aa8ad56207b16489672bd","user":{"login":"Soullivaneuh","id":1698357,"avatar_url":"https://avatars.githubusercontent.com/u/1698357?v=3","gravatar_id":"","url":"https://api.github.com/users/Soullivaneuh","html_url":"https://github.com/Soullivaneuh","followers_url":"https://api.github.com/users/Soullivaneuh/followers","following_url":"https://api.github.com/users/Soullivaneuh/following{/other_user}","gists_url":"https://api.github.com/users/Soullivaneuh/gists{/gist_id}","starred_url":"https://api.github.com/users/Soullivaneuh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Soullivaneuh/subscriptions","organizations_url":"https://api.github.com/users/Soullivaneuh/orgs","repos_url":"https://api.github.com/users/Soullivaneuh/repos","events_url":"https://api.github.com/users/Soullivaneuh/events{/privacy}","received_events_url":"https://api.github.com/users/Soullivaneuh/received_events","type":"User","site_admin":false},"body":"> this makes the code unclear (at least to coders that don't come from Dagobah)\r\n\r\nHabits! :trollface: \r\n\r\n> we've seen that the main reason they have for closing an RFC for a change in coding style [...]  if they make a wrong decision and know it, they are going to stick with it forever\r\n\r\nFor this case, they never tell this is a bad decision. This is bad for your point of view. For them, this is a decision.\r\n\r\nThe \"merge nightmare\" is an additional reason.\r\n\r\n> I don't think it makes sense to follow SF coding standard (some of them, but not all of them), especially in this package that is not an SF bundle.\r\n\r\nI decide to follow SF standard on each of my project to not balance between them.\r\n\r\nAgree or not, SF coding standard includes Yoda condition, so we will follow it, even for sonata or my personal projects because I choose SF standards. :wink: ","created_at":"2016-05-29T16:30:08Z","updated_at":"2016-05-29T16:30:08Z","html_url":"https://github.com/Soullivaneuh/composer-lint/pull/2#discussion_r65007647","pull_request_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/Soullivaneuh/composer-lint/pulls/comments/65007647"},"html":{"href":"https://github.com/Soullivaneuh/composer-lint/pull/2#discussion_r65007647"},"pull_request":{"href":"https://api.github.com/repos/Soullivaneuh/composer-lint/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/Soullivaneuh/composer-lint/pulls/2","id":71812788,"html_url":"https://github.com/Soullivaneuh/composer-lint/pull/2","diff_url":"https://github.com/Soullivaneuh/composer-lint/pull/2.diff","patch_url":"https://github.com/Soullivaneuh/composer-lint/pull/2.patch","issue_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/issues/2","number":2,"state":"open","locked":false,"title":"Sort packages linter","user":{"login":"Soullivaneuh","id":1698357,"avatar_url":"https://avatars.githubusercontent.com/u/1698357?v=3","gravatar_id":"","url":"https://api.github.com/users/Soullivaneuh","html_url":"https://github.com/Soullivaneuh","followers_url":"https://api.github.com/users/Soullivaneuh/followers","following_url":"https://api.github.com/users/Soullivaneuh/following{/other_user}","gists_url":"https://api.github.com/users/Soullivaneuh/gists{/gist_id}","starred_url":"https://api.github.com/users/Soullivaneuh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Soullivaneuh/subscriptions","organizations_url":"https://api.github.com/users/Soullivaneuh/orgs","repos_url":"https://api.github.com/users/Soullivaneuh/repos","events_url":"https://api.github.com/users/Soullivaneuh/events{/privacy}","received_events_url":"https://api.github.com/users/Soullivaneuh/received_events","type":"User","site_admin":false},"body":"- [x] `ext-*` packages check (after php)\r\n- [x] Move the `JsonFile` read logic under the plugin class.\r\n- [ ] tests","created_at":"2016-05-28T22:07:25Z","updated_at":"2016-05-29T16:30:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9d9d29a0d0f78a0473d60b84ec4d739280f446d2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/pulls/2/commits","review_comments_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/pulls/2/comments","review_comment_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/issues/2/comments","statuses_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/statuses/82892b35fe5767ede13aa8ad56207b16489672bd","head":{"label":"Soullivaneuh:sort-package","ref":"sort-package","sha":"82892b35fe5767ede13aa8ad56207b16489672bd","user":{"login":"Soullivaneuh","id":1698357,"avatar_url":"https://avatars.githubusercontent.com/u/1698357?v=3","gravatar_id":"","url":"https://api.github.com/users/Soullivaneuh","html_url":"https://github.com/Soullivaneuh","followers_url":"https://api.github.com/users/Soullivaneuh/followers","following_url":"https://api.github.com/users/Soullivaneuh/following{/other_user}","gists_url":"https://api.github.com/users/Soullivaneuh/gists{/gist_id}","starred_url":"https://api.github.com/users/Soullivaneuh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Soullivaneuh/subscriptions","organizations_url":"https://api.github.com/users/Soullivaneuh/orgs","repos_url":"https://api.github.com/users/Soullivaneuh/repos","events_url":"https://api.github.com/users/Soullivaneuh/events{/privacy}","received_events_url":"https://api.github.com/users/Soullivaneuh/received_events","type":"User","site_admin":false},"repo":{"id":59914874,"name":"composer-lint","full_name":"Soullivaneuh/composer-lint","owner":{"login":"Soullivaneuh","id":1698357,"avatar_url":"https://avatars.githubusercontent.com/u/1698357?v=3","gravatar_id":"","url":"https://api.github.com/users/Soullivaneuh","html_url":"https://github.com/Soullivaneuh","followers_url":"https://api.github.com/users/Soullivaneuh/followers","following_url":"https://api.github.com/users/Soullivaneuh/following{/other_user}","gists_url":"https://api.github.com/users/Soullivaneuh/gists{/gist_id}","starred_url":"https://api.github.com/users/Soullivaneuh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Soullivaneuh/subscriptions","organizations_url":"https://api.github.com/users/Soullivaneuh/orgs","repos_url":"https://api.github.com/users/Soullivaneuh/repos","events_url":"https://api.github.com/users/Soullivaneuh/events{/privacy}","received_events_url":"https://api.github.com/users/Soullivaneuh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Soullivaneuh/composer-lint","description":"Extends the composer validate command with extra rules","fork":false,"url":"https://api.github.com/repos/Soullivaneuh/composer-lint","forks_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/forks","keys_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/teams","hooks_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/hooks","issue_events_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/issues/events{/number}","events_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/events","assignees_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/assignees{/user}","branches_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/branches{/branch}","tags_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/tags","blobs_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/git/refs{/sha}","trees_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/statuses/{sha}","languages_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/languages","stargazers_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/stargazers","contributors_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/contributors","subscribers_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/subscribers","subscription_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/subscription","commits_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/commits{/sha}","git_commits_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/git/commits{/sha}","comments_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/comments{/number}","issue_comment_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/issues/comments{/number}","contents_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/contents/{+path}","compare_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/merges","archive_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/downloads","issues_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/issues{/number}","pulls_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/pulls{/number}","milestones_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/milestones{/number}","notifications_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/labels{/name}","releases_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/releases{/id}","deployments_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/deployments","created_at":"2016-05-28T21:18:45Z","updated_at":"2016-05-28T21:34:29Z","pushed_at":"2016-05-29T08:42:39Z","git_url":"git://github.com/Soullivaneuh/composer-lint.git","ssh_url":"git@github.com:Soullivaneuh/composer-lint.git","clone_url":"https://github.com/Soullivaneuh/composer-lint.git","svn_url":"https://github.com/Soullivaneuh/composer-lint","homepage":null,"size":6,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"Soullivaneuh:master","ref":"master","sha":"17cddcc42331e81ab1da83e366baadf92eab5f7a","user":{"login":"Soullivaneuh","id":1698357,"avatar_url":"https://avatars.githubusercontent.com/u/1698357?v=3","gravatar_id":"","url":"https://api.github.com/users/Soullivaneuh","html_url":"https://github.com/Soullivaneuh","followers_url":"https://api.github.com/users/Soullivaneuh/followers","following_url":"https://api.github.com/users/Soullivaneuh/following{/other_user}","gists_url":"https://api.github.com/users/Soullivaneuh/gists{/gist_id}","starred_url":"https://api.github.com/users/Soullivaneuh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Soullivaneuh/subscriptions","organizations_url":"https://api.github.com/users/Soullivaneuh/orgs","repos_url":"https://api.github.com/users/Soullivaneuh/repos","events_url":"https://api.github.com/users/Soullivaneuh/events{/privacy}","received_events_url":"https://api.github.com/users/Soullivaneuh/received_events","type":"User","site_admin":false},"repo":{"id":59914874,"name":"composer-lint","full_name":"Soullivaneuh/composer-lint","owner":{"login":"Soullivaneuh","id":1698357,"avatar_url":"https://avatars.githubusercontent.com/u/1698357?v=3","gravatar_id":"","url":"https://api.github.com/users/Soullivaneuh","html_url":"https://github.com/Soullivaneuh","followers_url":"https://api.github.com/users/Soullivaneuh/followers","following_url":"https://api.github.com/users/Soullivaneuh/following{/other_user}","gists_url":"https://api.github.com/users/Soullivaneuh/gists{/gist_id}","starred_url":"https://api.github.com/users/Soullivaneuh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Soullivaneuh/subscriptions","organizations_url":"https://api.github.com/users/Soullivaneuh/orgs","repos_url":"https://api.github.com/users/Soullivaneuh/repos","events_url":"https://api.github.com/users/Soullivaneuh/events{/privacy}","received_events_url":"https://api.github.com/users/Soullivaneuh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Soullivaneuh/composer-lint","description":"Extends the composer validate command with extra rules","fork":false,"url":"https://api.github.com/repos/Soullivaneuh/composer-lint","forks_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/forks","keys_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/teams","hooks_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/hooks","issue_events_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/issues/events{/number}","events_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/events","assignees_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/assignees{/user}","branches_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/branches{/branch}","tags_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/tags","blobs_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/git/refs{/sha}","trees_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/statuses/{sha}","languages_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/languages","stargazers_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/stargazers","contributors_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/contributors","subscribers_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/subscribers","subscription_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/subscription","commits_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/commits{/sha}","git_commits_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/git/commits{/sha}","comments_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/comments{/number}","issue_comment_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/issues/comments{/number}","contents_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/contents/{+path}","compare_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/merges","archive_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/downloads","issues_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/issues{/number}","pulls_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/pulls{/number}","milestones_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/milestones{/number}","notifications_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/labels{/name}","releases_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/releases{/id}","deployments_url":"https://api.github.com/repos/Soullivaneuh/composer-lint/deployments","created_at":"2016-05-28T21:18:45Z","updated_at":"2016-05-28T21:34:29Z","pushed_at":"2016-05-29T08:42:39Z","git_url":"git://github.com/Soullivaneuh/composer-lint.git","ssh_url":"git@github.com:Soullivaneuh/composer-lint.git","clone_url":"https://github.com/Soullivaneuh/composer-lint.git","svn_url":"https://github.com/Soullivaneuh/composer-lint","homepage":null,"size":6,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Soullivaneuh/composer-lint/pulls/2"},"html":{"href":"https://github.com/Soullivaneuh/composer-lint/pull/2"},"issue":{"href":"https://api.github.com/repos/Soullivaneuh/composer-lint/issues/2"},"comments":{"href":"https://api.github.com/repos/Soullivaneuh/composer-lint/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/Soullivaneuh/composer-lint/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/Soullivaneuh/composer-lint/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Soullivaneuh/composer-lint/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/Soullivaneuh/composer-lint/statuses/82892b35fe5767ede13aa8ad56207b16489672bd"}}}}
{"actor":{"display_login":"Soullivaneuh"}}