{"action":"created","comment":{"url":"https://api.github.com/repos/Cecilapp/Cecil/pulls/comments/238049336","pull_request_review_id":180508162,"id":238049336,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzODA0OTMzNg==","diff_hunk":"@@ -0,0 +1,274 @@\n+<?php\n+/*\n+ * Copyright (c) Arnaud Ligny <arnaud@ligny.org>\n+ *\n+ * For the full copyright and license information, please view the LICENSE\n+ * file that was distributed with this source code.\n+ */\n+\n+namespace Cecil\\Collection;\n+\n+/**\n+ * Class Collection.\n+ */\n+class Collection implements CollectionInterface\n+{\n+    /**\n+     * Collections's identifier.\n+     *\n+     * @var string\n+     */\n+    protected $id = '';\n+\n+    /**\n+     * Collection's items.\n+     *\n+     * @var array\n+     */\n+    protected $items = [];\n+\n+    /**\n+     * AbstractCollection constructor.\n+     *\n+     * @param string|null $id\n+     * @param array       $items\n+     */\n+    public function __construct($id = null, $items = [])\n+    {\n+        $this->setId($id);\n+        $this->items = $items;\n+    }\n+\n+    /**\n+     * If parameter is empty uses the object hash\n+     * {@inheritdoc}\n+     */\n+    public function setId($id = '')\n+    {\n+        if (empty($id)) {\n+            $this->id = spl_object_hash($this);\n+        } else {\n+            $this->id = $id;\n+        }\n+\n+        return $this;\n+    }\n+\n+    /**\n+     * {@inheritdoc}\n+     */\n+    public function getId()\n+    {\n+        return $this->id;\n+    }\n+\n+    /**\n+     * {@inheritdoc}\n+     */\n+    public function has($id)\n+    {\n+        return array_key_exists($id, $this->items);\n+    }\n+\n+    /**\n+     * {@inheritdoc}\n+     */\n+    public function add(ItemInterface $item)\n+    {\n+        if ($this->has($item->getId())) {\n+            throw new \\DomainException(sprintf(\n+                'Failed adding item \"%s\": an item with that id has already been added.',\n+                $item->getId()\n+            ));\n+        }\n+        $this->items[$item->getId()] = $item;\n+\n+        return $this;\n+    }\n+\n+    /**\n+     * {@inheritdoc}\n+     */\n+    public function replace($id, ItemInterface $item)\n+    {\n+        if ($this->has($id)) {\n+            $this->items[$id] = $item;\n+        } else {\n+            throw new \\DomainException(sprintf(\n+                'Failed replacing item \"%s\": item does not exist.',\n+                $item->getId()\n+            ));\n+        }\n+    }\n+\n+    /**\n+     * {@inheritdoc}\n+     */\n+    public function remove($id)\n+    {\n+        if ($this->has($id)) {\n+            unset($this->items[$id]);\n+        } else {\n+            throw new \\DomainException(sprintf(\n+                'Failed removing item with ID \"%s\": item does not exist.',\n+                $id\n+            ));\n+        }\n+    }\n+\n+    /**\n+     * {@inheritdoc}\n+     */\n+    public function get($id)","path":"src/Collection/Collection.php","position":122,"original_position":122,"commit_id":"9a41b1f031a836ec3928be919495492dd121617a","original_commit_id":"9a41b1f031a836ec3928be919495492dd121617a","user":{"login":"codacy-bot","id":19940114,"node_id":"MDQ6VXNlcjE5OTQwMTE0","avatar_url":"https://avatars1.githubusercontent.com/u/19940114?v=4","gravatar_id":"","url":"https://api.github.com/users/codacy-bot","html_url":"https://github.com/codacy-bot","followers_url":"https://api.github.com/users/codacy-bot/followers","following_url":"https://api.github.com/users/codacy-bot/following{/other_user}","gists_url":"https://api.github.com/users/codacy-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/codacy-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codacy-bot/subscriptions","organizations_url":"https://api.github.com/users/codacy-bot/orgs","repos_url":"https://api.github.com/users/codacy-bot/repos","events_url":"https://api.github.com/users/codacy-bot/events{/privacy}","received_events_url":"https://api.github.com/users/codacy-bot/received_events","type":"User","site_admin":false},"body":"![Codacy](https://app.codacy.com/assets/images/favicon.png) Issue found: [Avoid variables with short names like $id. Configured minimum length is 3.](https://app.codacy.com/app/Narno/Cecil/pullRequest?prid=2659525)","created_at":"2018-12-01T02:44:22Z","updated_at":"2018-12-01T02:44:22Z","html_url":"https://github.com/Cecilapp/Cecil/pull/189#discussion_r238049336","pull_request_url":"https://api.github.com/repos/Cecilapp/Cecil/pulls/189","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/Cecilapp/Cecil/pulls/comments/238049336"},"html":{"href":"https://github.com/Cecilapp/Cecil/pull/189#discussion_r238049336"},"pull_request":{"href":"https://api.github.com/repos/Cecilapp/Cecil/pulls/189"}}},"pull_request":{"url":"https://api.github.com/repos/Cecilapp/Cecil/pulls/189","id":234970390,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM0OTcwMzkw","html_url":"https://github.com/Cecilapp/Cecil/pull/189","diff_url":"https://github.com/Cecilapp/Cecil/pull/189.diff","patch_url":"https://github.com/Cecilapp/Cecil/pull/189.patch","issue_url":"https://api.github.com/repos/Cecilapp/Cecil/issues/189","number":189,"state":"closed","locked":false,"title":"Include the library in the app","user":{"login":"Narno","id":80580,"node_id":"MDQ6VXNlcjgwNTgw","avatar_url":"https://avatars0.githubusercontent.com/u/80580?v=4","gravatar_id":"","url":"https://api.github.com/users/Narno","html_url":"https://github.com/Narno","followers_url":"https://api.github.com/users/Narno/followers","following_url":"https://api.github.com/users/Narno/following{/other_user}","gists_url":"https://api.github.com/users/Narno/gists{/gist_id}","starred_url":"https://api.github.com/users/Narno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Narno/subscriptions","organizations_url":"https://api.github.com/users/Narno/orgs","repos_url":"https://api.github.com/users/Narno/repos","events_url":"https://api.github.com/users/Narno/events{/privacy}","received_events_url":"https://api.github.com/users/Narno/received_events","type":"User","site_admin":false},"body":"Big PR!\r\n\r\nThe goal: integrate the library in the core of the CLI App and stop to maintain the lib and the app separately.","created_at":"2018-11-30T12:21:52Z","updated_at":"2018-12-01T02:44:22Z","closed_at":"2018-12-01T01:08:37Z","merged_at":"2018-12-01T01:08:37Z","merge_commit_sha":"414a26ed4fed8d09152d04fdc92648d4db3a1cc2","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Cecilapp/Cecil/pulls/189/commits","review_comments_url":"https://api.github.com/repos/Cecilapp/Cecil/pulls/189/comments","review_comment_url":"https://api.github.com/repos/Cecilapp/Cecil/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Cecilapp/Cecil/issues/189/comments","statuses_url":"https://api.github.com/repos/Cecilapp/Cecil/statuses/9a41b1f031a836ec3928be919495492dd121617a","head":{"label":"Cecilapp:include-lib","ref":"include-lib","sha":"9a41b1f031a836ec3928be919495492dd121617a","user":{"login":"Cecilapp","id":45047331,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ1MDQ3MzMx","avatar_url":"https://avatars3.githubusercontent.com/u/45047331?v=4","gravatar_id":"","url":"https://api.github.com/users/Cecilapp","html_url":"https://github.com/Cecilapp","followers_url":"https://api.github.com/users/Cecilapp/followers","following_url":"https://api.github.com/users/Cecilapp/following{/other_user}","gists_url":"https://api.github.com/users/Cecilapp/gists{/gist_id}","starred_url":"https://api.github.com/users/Cecilapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cecilapp/subscriptions","organizations_url":"https://api.github.com/users/Cecilapp/orgs","repos_url":"https://api.github.com/users/Cecilapp/repos","events_url":"https://api.github.com/users/Cecilapp/events{/privacy}","received_events_url":"https://api.github.com/users/Cecilapp/received_events","type":"Organization","site_admin":false},"repo":{"id":12738012,"node_id":"MDEwOlJlcG9zaXRvcnkxMjczODAxMg==","name":"Cecil","full_name":"Cecilapp/Cecil","private":false,"owner":{"login":"Cecilapp","id":45047331,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ1MDQ3MzMx","avatar_url":"https://avatars3.githubusercontent.com/u/45047331?v=4","gravatar_id":"","url":"https://api.github.com/users/Cecilapp","html_url":"https://github.com/Cecilapp","followers_url":"https://api.github.com/users/Cecilapp/followers","following_url":"https://api.github.com/users/Cecilapp/following{/other_user}","gists_url":"https://api.github.com/users/Cecilapp/gists{/gist_id}","starred_url":"https://api.github.com/users/Cecilapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cecilapp/subscriptions","organizations_url":"https://api.github.com/users/Cecilapp/orgs","repos_url":"https://api.github.com/users/Cecilapp/repos","events_url":"https://api.github.com/users/Cecilapp/events{/privacy}","received_events_url":"https://api.github.com/users/Cecilapp/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Cecilapp/Cecil","description":"[PHPoole ➡️ Cecil] Your content driven static site generator.","fork":false,"url":"https://api.github.com/repos/Cecilapp/Cecil","forks_url":"https://api.github.com/repos/Cecilapp/Cecil/forks","keys_url":"https://api.github.com/repos/Cecilapp/Cecil/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Cecilapp/Cecil/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Cecilapp/Cecil/teams","hooks_url":"https://api.github.com/repos/Cecilapp/Cecil/hooks","issue_events_url":"https://api.github.com/repos/Cecilapp/Cecil/issues/events{/number}","events_url":"https://api.github.com/repos/Cecilapp/Cecil/events","assignees_url":"https://api.github.com/repos/Cecilapp/Cecil/assignees{/user}","branches_url":"https://api.github.com/repos/Cecilapp/Cecil/branches{/branch}","tags_url":"https://api.github.com/repos/Cecilapp/Cecil/tags","blobs_url":"https://api.github.com/repos/Cecilapp/Cecil/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Cecilapp/Cecil/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Cecilapp/Cecil/git/refs{/sha}","trees_url":"https://api.github.com/repos/Cecilapp/Cecil/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Cecilapp/Cecil/statuses/{sha}","languages_url":"https://api.github.com/repos/Cecilapp/Cecil/languages","stargazers_url":"https://api.github.com/repos/Cecilapp/Cecil/stargazers","contributors_url":"https://api.github.com/repos/Cecilapp/Cecil/contributors","subscribers_url":"https://api.github.com/repos/Cecilapp/Cecil/subscribers","subscription_url":"https://api.github.com/repos/Cecilapp/Cecil/subscription","commits_url":"https://api.github.com/repos/Cecilapp/Cecil/commits{/sha}","git_commits_url":"https://api.github.com/repos/Cecilapp/Cecil/git/commits{/sha}","comments_url":"https://api.github.com/repos/Cecilapp/Cecil/comments{/number}","issue_comment_url":"https://api.github.com/repos/Cecilapp/Cecil/issues/comments{/number}","contents_url":"https://api.github.com/repos/Cecilapp/Cecil/contents/{+path}","compare_url":"https://api.github.com/repos/Cecilapp/Cecil/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Cecilapp/Cecil/merges","archive_url":"https://api.github.com/repos/Cecilapp/Cecil/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Cecilapp/Cecil/downloads","issues_url":"https://api.github.com/repos/Cecilapp/Cecil/issues{/number}","pulls_url":"https://api.github.com/repos/Cecilapp/Cecil/pulls{/number}","milestones_url":"https://api.github.com/repos/Cecilapp/Cecil/milestones{/number}","notifications_url":"https://api.github.com/repos/Cecilapp/Cecil/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Cecilapp/Cecil/labels{/name}","releases_url":"https://api.github.com/repos/Cecilapp/Cecil/releases{/id}","deployments_url":"https://api.github.com/repos/Cecilapp/Cecil/deployments","created_at":"2013-09-10T19:06:45Z","updated_at":"2018-12-01T01:15:50Z","pushed_at":"2018-12-01T01:16:59Z","git_url":"git://github.com/Cecilapp/Cecil.git","ssh_url":"git@github.com:Cecilapp/Cecil.git","clone_url":"https://github.com/Cecilapp/Cecil.git","svn_url":"https://github.com/Cecilapp/Cecil","homepage":"https://cecil.app","size":1662,"stargazers_count":60,"watchers_count":60,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":6,"open_issues":0,"watchers":60,"default_branch":"master"}},"base":{"label":"Cecilapp:master","ref":"master","sha":"dc589868023b587cdc94e758ed1de07fc889dd40","user":{"login":"Cecilapp","id":45047331,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ1MDQ3MzMx","avatar_url":"https://avatars3.githubusercontent.com/u/45047331?v=4","gravatar_id":"","url":"https://api.github.com/users/Cecilapp","html_url":"https://github.com/Cecilapp","followers_url":"https://api.github.com/users/Cecilapp/followers","following_url":"https://api.github.com/users/Cecilapp/following{/other_user}","gists_url":"https://api.github.com/users/Cecilapp/gists{/gist_id}","starred_url":"https://api.github.com/users/Cecilapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cecilapp/subscriptions","organizations_url":"https://api.github.com/users/Cecilapp/orgs","repos_url":"https://api.github.com/users/Cecilapp/repos","events_url":"https://api.github.com/users/Cecilapp/events{/privacy}","received_events_url":"https://api.github.com/users/Cecilapp/received_events","type":"Organization","site_admin":false},"repo":{"id":12738012,"node_id":"MDEwOlJlcG9zaXRvcnkxMjczODAxMg==","name":"Cecil","full_name":"Cecilapp/Cecil","private":false,"owner":{"login":"Cecilapp","id":45047331,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ1MDQ3MzMx","avatar_url":"https://avatars3.githubusercontent.com/u/45047331?v=4","gravatar_id":"","url":"https://api.github.com/users/Cecilapp","html_url":"https://github.com/Cecilapp","followers_url":"https://api.github.com/users/Cecilapp/followers","following_url":"https://api.github.com/users/Cecilapp/following{/other_user}","gists_url":"https://api.github.com/users/Cecilapp/gists{/gist_id}","starred_url":"https://api.github.com/users/Cecilapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cecilapp/subscriptions","organizations_url":"https://api.github.com/users/Cecilapp/orgs","repos_url":"https://api.github.com/users/Cecilapp/repos","events_url":"https://api.github.com/users/Cecilapp/events{/privacy}","received_events_url":"https://api.github.com/users/Cecilapp/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Cecilapp/Cecil","description":"[PHPoole ➡️ Cecil] Your content driven static site generator.","fork":false,"url":"https://api.github.com/repos/Cecilapp/Cecil","forks_url":"https://api.github.com/repos/Cecilapp/Cecil/forks","keys_url":"https://api.github.com/repos/Cecilapp/Cecil/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Cecilapp/Cecil/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Cecilapp/Cecil/teams","hooks_url":"https://api.github.com/repos/Cecilapp/Cecil/hooks","issue_events_url":"https://api.github.com/repos/Cecilapp/Cecil/issues/events{/number}","events_url":"https://api.github.com/repos/Cecilapp/Cecil/events","assignees_url":"https://api.github.com/repos/Cecilapp/Cecil/assignees{/user}","branches_url":"https://api.github.com/repos/Cecilapp/Cecil/branches{/branch}","tags_url":"https://api.github.com/repos/Cecilapp/Cecil/tags","blobs_url":"https://api.github.com/repos/Cecilapp/Cecil/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Cecilapp/Cecil/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Cecilapp/Cecil/git/refs{/sha}","trees_url":"https://api.github.com/repos/Cecilapp/Cecil/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Cecilapp/Cecil/statuses/{sha}","languages_url":"https://api.github.com/repos/Cecilapp/Cecil/languages","stargazers_url":"https://api.github.com/repos/Cecilapp/Cecil/stargazers","contributors_url":"https://api.github.com/repos/Cecilapp/Cecil/contributors","subscribers_url":"https://api.github.com/repos/Cecilapp/Cecil/subscribers","subscription_url":"https://api.github.com/repos/Cecilapp/Cecil/subscription","commits_url":"https://api.github.com/repos/Cecilapp/Cecil/commits{/sha}","git_commits_url":"https://api.github.com/repos/Cecilapp/Cecil/git/commits{/sha}","comments_url":"https://api.github.com/repos/Cecilapp/Cecil/comments{/number}","issue_comment_url":"https://api.github.com/repos/Cecilapp/Cecil/issues/comments{/number}","contents_url":"https://api.github.com/repos/Cecilapp/Cecil/contents/{+path}","compare_url":"https://api.github.com/repos/Cecilapp/Cecil/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Cecilapp/Cecil/merges","archive_url":"https://api.github.com/repos/Cecilapp/Cecil/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Cecilapp/Cecil/downloads","issues_url":"https://api.github.com/repos/Cecilapp/Cecil/issues{/number}","pulls_url":"https://api.github.com/repos/Cecilapp/Cecil/pulls{/number}","milestones_url":"https://api.github.com/repos/Cecilapp/Cecil/milestones{/number}","notifications_url":"https://api.github.com/repos/Cecilapp/Cecil/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Cecilapp/Cecil/labels{/name}","releases_url":"https://api.github.com/repos/Cecilapp/Cecil/releases{/id}","deployments_url":"https://api.github.com/repos/Cecilapp/Cecil/deployments","created_at":"2013-09-10T19:06:45Z","updated_at":"2018-12-01T01:15:50Z","pushed_at":"2018-12-01T01:16:59Z","git_url":"git://github.com/Cecilapp/Cecil.git","ssh_url":"git@github.com:Cecilapp/Cecil.git","clone_url":"https://github.com/Cecilapp/Cecil.git","svn_url":"https://github.com/Cecilapp/Cecil","homepage":"https://cecil.app","size":1662,"stargazers_count":60,"watchers_count":60,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":6,"open_issues":0,"watchers":60,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Cecilapp/Cecil/pulls/189"},"html":{"href":"https://github.com/Cecilapp/Cecil/pull/189"},"issue":{"href":"https://api.github.com/repos/Cecilapp/Cecil/issues/189"},"comments":{"href":"https://api.github.com/repos/Cecilapp/Cecil/issues/189/comments"},"review_comments":{"href":"https://api.github.com/repos/Cecilapp/Cecil/pulls/189/comments"},"review_comment":{"href":"https://api.github.com/repos/Cecilapp/Cecil/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Cecilapp/Cecil/pulls/189/commits"},"statuses":{"href":"https://api.github.com/repos/Cecilapp/Cecil/statuses/9a41b1f031a836ec3928be919495492dd121617a"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"codacy-bot"}}