{"action":"created","comment":{"url":"https://api.github.com/repos/Sylius/Sylius/pulls/comments/45742844","id":45742844,"diff_hunk":"@@ -0,0 +1,245 @@\n+<?php\n+\n+/*\n+ * This file is part of the Sylius package.\n+ *\n+ * (c) Paweł Jędrzejewski\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 Sylius\\Component\\Resource\\Repository;\n+\n+use ArrayObject;\n+use Pagerfanta\\Adapter\\ArrayAdapter;\n+use Pagerfanta\\Pagerfanta;\n+use Sylius\\Component\\Resource\\Exception\\UnexpectedTypeException;\n+use Sylius\\Component\\Resource\\Model\\ResourceInterface;\n+use Symfony\\Component\\PropertyAccess\\PropertyAccess;\n+use Symfony\\Component\\PropertyAccess\\PropertyAccessor;\n+\n+/**\n+ * @author Jan Góralski <jan.goralski@lakion.com>\n+ */\n+class InMemoryRepository implements RepositoryInterface\n+{\n+    /**\n+     * @var PropertyAccessor\n+     */\n+    protected $accessor;\n+\n+    /**\n+     * @var ArrayObject\n+     */\n+    protected $arrayObject;\n+\n+    /**\n+     * @var string\n+     */\n+    protected $interface;\n+\n+    /**\n+     * @param string $interface\n+     *\n+     * @throws \\InvalidArgumentException\n+     * @throws UnexpectedTypeException\n+     */\n+    public function __construct($interface)\n+    {\n+        if (null === $interface) {\n+            throw new \\InvalidArgumentException('Resource\\'s interface needs to be stated.');\n+        }\n+\n+        if (!in_array(ResourceInterface::class, class_implements($interface))) {\n+            throw new UnexpectedTypeException($interface, ResourceInterface::class);\n+        }\n+\n+        $this->interface = $interface;\n+        $this->accessor = PropertyAccess::createPropertyAccessor();\n+        $this->arrayObject = new ArrayObject();\n+    }\n+\n+    /**\n+     * @param ResourceInterface $resource\n+     *\n+     * @throws \\InvalidArgumentException\n+     * @throws UnexpectedTypeException\n+     */\n+    public function add(ResourceInterface $resource)\n+    {\n+        if (!in_array($this->interface, class_implements($resource))) {","path":"src/Sylius/Component/Resource/Repository/InMemoryRepository.php","position":71,"original_position":71,"commit_id":"4a057ae07bb781becd8384be458a9f703d408e28","original_commit_id":"4a057ae07bb781becd8384be458a9f703d408e28","user":{"login":"pamil","id":1897953,"avatar_url":"https://avatars.githubusercontent.com/u/1897953?v=3","gravatar_id":"","url":"https://api.github.com/users/pamil","html_url":"https://github.com/pamil","followers_url":"https://api.github.com/users/pamil/followers","following_url":"https://api.github.com/users/pamil/following{/other_user}","gists_url":"https://api.github.com/users/pamil/gists{/gist_id}","starred_url":"https://api.github.com/users/pamil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pamil/subscriptions","organizations_url":"https://api.github.com/users/pamil/orgs","repos_url":"https://api.github.com/users/pamil/repos","events_url":"https://api.github.com/users/pamil/events{/privacy}","received_events_url":"https://api.github.com/users/pamil/received_events","type":"User","site_admin":false},"body":"It would be a lot faster :+1:","created_at":"2015-11-24T14:41:16Z","updated_at":"2015-11-24T14:41:16Z","html_url":"https://github.com/Sylius/Sylius/pull/3617#discussion_r45742844","pull_request_url":"https://api.github.com/repos/Sylius/Sylius/pulls/3617","_links":{"self":{"href":"https://api.github.com/repos/Sylius/Sylius/pulls/comments/45742844"},"html":{"href":"https://github.com/Sylius/Sylius/pull/3617#discussion_r45742844"},"pull_request":{"href":"https://api.github.com/repos/Sylius/Sylius/pulls/3617"}}},"pull_request":{"url":"https://api.github.com/repos/Sylius/Sylius/pulls/3617","id":51653888,"html_url":"https://github.com/Sylius/Sylius/pull/3617","diff_url":"https://github.com/Sylius/Sylius/pull/3617.diff","patch_url":"https://github.com/Sylius/Sylius/pull/3617.patch","issue_url":"https://api.github.com/repos/Sylius/Sylius/issues/3617","number":3617,"state":"open","locked":false,"title":"[WIP] [Resource] Created InMemoryRepository and implemented ResourceInterface","user":{"login":"NeverResponse","id":9448101,"avatar_url":"https://avatars.githubusercontent.com/u/9448101?v=3","gravatar_id":"","url":"https://api.github.com/users/NeverResponse","html_url":"https://github.com/NeverResponse","followers_url":"https://api.github.com/users/NeverResponse/followers","following_url":"https://api.github.com/users/NeverResponse/following{/other_user}","gists_url":"https://api.github.com/users/NeverResponse/gists{/gist_id}","starred_url":"https://api.github.com/users/NeverResponse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NeverResponse/subscriptions","organizations_url":"https://api.github.com/users/NeverResponse/orgs","repos_url":"https://api.github.com/users/NeverResponse/repos","events_url":"https://api.github.com/users/NeverResponse/events{/privacy}","received_events_url":"https://api.github.com/users/NeverResponse/received_events","type":"User","site_admin":false},"body":"| Q             | A\r\n| ------------- | ---\r\n| Bug fix?      | no\r\n| New feature?  | yes\r\n| BC breaks?    | yes\r\n| Deprecations? | no\r\n| Fixed tickets | -\r\n| License       | MIT\r\n| Doc PR        | -","created_at":"2015-11-24T12:35:14Z","updated_at":"2015-11-24T14:41:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e8d14491eeea88f521ad70c3afde94856b1e2303","assignee":null,"milestone":{"url":"https://api.github.com/repos/Sylius/Sylius/milestones/3","html_url":"https://github.com/Sylius/Sylius/milestones/v0.16.0","labels_url":"https://api.github.com/repos/Sylius/Sylius/milestones/3/labels","id":1104561,"number":3,"title":"v0.16.0","description":"Version v0.16.0 of Sylius platform.","creator":{"login":"pjedrzejewski","id":614970,"avatar_url":"https://avatars.githubusercontent.com/u/614970?v=3","gravatar_id":"","url":"https://api.github.com/users/pjedrzejewski","html_url":"https://github.com/pjedrzejewski","followers_url":"https://api.github.com/users/pjedrzejewski/followers","following_url":"https://api.github.com/users/pjedrzejewski/following{/other_user}","gists_url":"https://api.github.com/users/pjedrzejewski/gists{/gist_id}","starred_url":"https://api.github.com/users/pjedrzejewski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjedrzejewski/subscriptions","organizations_url":"https://api.github.com/users/pjedrzejewski/orgs","repos_url":"https://api.github.com/users/pjedrzejewski/repos","events_url":"https://api.github.com/users/pjedrzejewski/events{/privacy}","received_events_url":"https://api.github.com/users/pjedrzejewski/received_events","type":"User","site_admin":false},"open_issues":75,"closed_issues":103,"state":"open","created_at":"2015-05-11T11:10:02Z","updated_at":"2015-11-24T14:18:54Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/Sylius/Sylius/pulls/3617/commits","review_comments_url":"https://api.github.com/repos/Sylius/Sylius/pulls/3617/comments","review_comment_url":"https://api.github.com/repos/Sylius/Sylius/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Sylius/Sylius/issues/3617/comments","statuses_url":"https://api.github.com/repos/Sylius/Sylius/statuses/4a057ae07bb781becd8384be458a9f703d408e28","head":{"label":"NeverResponse:in-memory-repository-array-object","ref":"in-memory-repository-array-object","sha":"4a057ae07bb781becd8384be458a9f703d408e28","user":{"login":"NeverResponse","id":9448101,"avatar_url":"https://avatars.githubusercontent.com/u/9448101?v=3","gravatar_id":"","url":"https://api.github.com/users/NeverResponse","html_url":"https://github.com/NeverResponse","followers_url":"https://api.github.com/users/NeverResponse/followers","following_url":"https://api.github.com/users/NeverResponse/following{/other_user}","gists_url":"https://api.github.com/users/NeverResponse/gists{/gist_id}","starred_url":"https://api.github.com/users/NeverResponse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NeverResponse/subscriptions","organizations_url":"https://api.github.com/users/NeverResponse/orgs","repos_url":"https://api.github.com/users/NeverResponse/repos","events_url":"https://api.github.com/users/NeverResponse/events{/privacy}","received_events_url":"https://api.github.com/users/NeverResponse/received_events","type":"User","site_admin":false},"repo":{"id":42593920,"name":"Sylius","full_name":"NeverResponse/Sylius","owner":{"login":"NeverResponse","id":9448101,"avatar_url":"https://avatars.githubusercontent.com/u/9448101?v=3","gravatar_id":"","url":"https://api.github.com/users/NeverResponse","html_url":"https://github.com/NeverResponse","followers_url":"https://api.github.com/users/NeverResponse/followers","following_url":"https://api.github.com/users/NeverResponse/following{/other_user}","gists_url":"https://api.github.com/users/NeverResponse/gists{/gist_id}","starred_url":"https://api.github.com/users/NeverResponse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NeverResponse/subscriptions","organizations_url":"https://api.github.com/users/NeverResponse/orgs","repos_url":"https://api.github.com/users/NeverResponse/repos","events_url":"https://api.github.com/users/NeverResponse/events{/privacy}","received_events_url":"https://api.github.com/users/NeverResponse/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/NeverResponse/Sylius","description":"Modern e-commerce for PHP, based on the Symfony2 framework.","fork":true,"url":"https://api.github.com/repos/NeverResponse/Sylius","forks_url":"https://api.github.com/repos/NeverResponse/Sylius/forks","keys_url":"https://api.github.com/repos/NeverResponse/Sylius/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NeverResponse/Sylius/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NeverResponse/Sylius/teams","hooks_url":"https://api.github.com/repos/NeverResponse/Sylius/hooks","issue_events_url":"https://api.github.com/repos/NeverResponse/Sylius/issues/events{/number}","events_url":"https://api.github.com/repos/NeverResponse/Sylius/events","assignees_url":"https://api.github.com/repos/NeverResponse/Sylius/assignees{/user}","branches_url":"https://api.github.com/repos/NeverResponse/Sylius/branches{/branch}","tags_url":"https://api.github.com/repos/NeverResponse/Sylius/tags","blobs_url":"https://api.github.com/repos/NeverResponse/Sylius/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NeverResponse/Sylius/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NeverResponse/Sylius/git/refs{/sha}","trees_url":"https://api.github.com/repos/NeverResponse/Sylius/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NeverResponse/Sylius/statuses/{sha}","languages_url":"https://api.github.com/repos/NeverResponse/Sylius/languages","stargazers_url":"https://api.github.com/repos/NeverResponse/Sylius/stargazers","contributors_url":"https://api.github.com/repos/NeverResponse/Sylius/contributors","subscribers_url":"https://api.github.com/repos/NeverResponse/Sylius/subscribers","subscription_url":"https://api.github.com/repos/NeverResponse/Sylius/subscription","commits_url":"https://api.github.com/repos/NeverResponse/Sylius/commits{/sha}","git_commits_url":"https://api.github.com/repos/NeverResponse/Sylius/git/commits{/sha}","comments_url":"https://api.github.com/repos/NeverResponse/Sylius/comments{/number}","issue_comment_url":"https://api.github.com/repos/NeverResponse/Sylius/issues/comments{/number}","contents_url":"https://api.github.com/repos/NeverResponse/Sylius/contents/{+path}","compare_url":"https://api.github.com/repos/NeverResponse/Sylius/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NeverResponse/Sylius/merges","archive_url":"https://api.github.com/repos/NeverResponse/Sylius/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NeverResponse/Sylius/downloads","issues_url":"https://api.github.com/repos/NeverResponse/Sylius/issues{/number}","pulls_url":"https://api.github.com/repos/NeverResponse/Sylius/pulls{/number}","milestones_url":"https://api.github.com/repos/NeverResponse/Sylius/milestones{/number}","notifications_url":"https://api.github.com/repos/NeverResponse/Sylius/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NeverResponse/Sylius/labels{/name}","releases_url":"https://api.github.com/repos/NeverResponse/Sylius/releases{/id}","created_at":"2015-09-16T14:54:32Z","updated_at":"2015-09-16T14:54:38Z","pushed_at":"2015-11-24T12:55:32Z","git_url":"git://github.com/NeverResponse/Sylius.git","ssh_url":"git@github.com:NeverResponse/Sylius.git","clone_url":"https://github.com/NeverResponse/Sylius.git","svn_url":"https://github.com/NeverResponse/Sylius","homepage":"Sylius.org","size":19727,"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":"Sylius:master","ref":"master","sha":"b3117e6f8449aa0152d4d2fb3b522bca4a1992bc","user":{"login":"Sylius","id":719423,"avatar_url":"https://avatars.githubusercontent.com/u/719423?v=3","gravatar_id":"","url":"https://api.github.com/users/Sylius","html_url":"https://github.com/Sylius","followers_url":"https://api.github.com/users/Sylius/followers","following_url":"https://api.github.com/users/Sylius/following{/other_user}","gists_url":"https://api.github.com/users/Sylius/gists{/gist_id}","starred_url":"https://api.github.com/users/Sylius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sylius/subscriptions","organizations_url":"https://api.github.com/users/Sylius/orgs","repos_url":"https://api.github.com/users/Sylius/repos","events_url":"https://api.github.com/users/Sylius/events{/privacy}","received_events_url":"https://api.github.com/users/Sylius/received_events","type":"Organization","site_admin":false},"repo":{"id":2717549,"name":"Sylius","full_name":"Sylius/Sylius","owner":{"login":"Sylius","id":719423,"avatar_url":"https://avatars.githubusercontent.com/u/719423?v=3","gravatar_id":"","url":"https://api.github.com/users/Sylius","html_url":"https://github.com/Sylius","followers_url":"https://api.github.com/users/Sylius/followers","following_url":"https://api.github.com/users/Sylius/following{/other_user}","gists_url":"https://api.github.com/users/Sylius/gists{/gist_id}","starred_url":"https://api.github.com/users/Sylius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sylius/subscriptions","organizations_url":"https://api.github.com/users/Sylius/orgs","repos_url":"https://api.github.com/users/Sylius/repos","events_url":"https://api.github.com/users/Sylius/events{/privacy}","received_events_url":"https://api.github.com/users/Sylius/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Sylius/Sylius","description":"Modern e-commerce for PHP, based on the Symfony2 framework.","fork":false,"url":"https://api.github.com/repos/Sylius/Sylius","forks_url":"https://api.github.com/repos/Sylius/Sylius/forks","keys_url":"https://api.github.com/repos/Sylius/Sylius/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Sylius/Sylius/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Sylius/Sylius/teams","hooks_url":"https://api.github.com/repos/Sylius/Sylius/hooks","issue_events_url":"https://api.github.com/repos/Sylius/Sylius/issues/events{/number}","events_url":"https://api.github.com/repos/Sylius/Sylius/events","assignees_url":"https://api.github.com/repos/Sylius/Sylius/assignees{/user}","branches_url":"https://api.github.com/repos/Sylius/Sylius/branches{/branch}","tags_url":"https://api.github.com/repos/Sylius/Sylius/tags","blobs_url":"https://api.github.com/repos/Sylius/Sylius/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Sylius/Sylius/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Sylius/Sylius/git/refs{/sha}","trees_url":"https://api.github.com/repos/Sylius/Sylius/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Sylius/Sylius/statuses/{sha}","languages_url":"https://api.github.com/repos/Sylius/Sylius/languages","stargazers_url":"https://api.github.com/repos/Sylius/Sylius/stargazers","contributors_url":"https://api.github.com/repos/Sylius/Sylius/contributors","subscribers_url":"https://api.github.com/repos/Sylius/Sylius/subscribers","subscription_url":"https://api.github.com/repos/Sylius/Sylius/subscription","commits_url":"https://api.github.com/repos/Sylius/Sylius/commits{/sha}","git_commits_url":"https://api.github.com/repos/Sylius/Sylius/git/commits{/sha}","comments_url":"https://api.github.com/repos/Sylius/Sylius/comments{/number}","issue_comment_url":"https://api.github.com/repos/Sylius/Sylius/issues/comments{/number}","contents_url":"https://api.github.com/repos/Sylius/Sylius/contents/{+path}","compare_url":"https://api.github.com/repos/Sylius/Sylius/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Sylius/Sylius/merges","archive_url":"https://api.github.com/repos/Sylius/Sylius/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Sylius/Sylius/downloads","issues_url":"https://api.github.com/repos/Sylius/Sylius/issues{/number}","pulls_url":"https://api.github.com/repos/Sylius/Sylius/pulls{/number}","milestones_url":"https://api.github.com/repos/Sylius/Sylius/milestones{/number}","notifications_url":"https://api.github.com/repos/Sylius/Sylius/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Sylius/Sylius/labels{/name}","releases_url":"https://api.github.com/repos/Sylius/Sylius/releases{/id}","created_at":"2011-11-05T22:05:52Z","updated_at":"2015-11-24T14:13:55Z","pushed_at":"2015-11-24T14:40:21Z","git_url":"git://github.com/Sylius/Sylius.git","ssh_url":"git@github.com:Sylius/Sylius.git","clone_url":"https://github.com/Sylius/Sylius.git","svn_url":"https://github.com/Sylius/Sylius","homepage":"Sylius.org","size":45757,"stargazers_count":2062,"watchers_count":2062,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":755,"mirror_url":null,"open_issues_count":566,"forks":755,"open_issues":566,"watchers":2062,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Sylius/Sylius/pulls/3617"},"html":{"href":"https://github.com/Sylius/Sylius/pull/3617"},"issue":{"href":"https://api.github.com/repos/Sylius/Sylius/issues/3617"},"comments":{"href":"https://api.github.com/repos/Sylius/Sylius/issues/3617/comments"},"review_comments":{"href":"https://api.github.com/repos/Sylius/Sylius/pulls/3617/comments"},"review_comment":{"href":"https://api.github.com/repos/Sylius/Sylius/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Sylius/Sylius/pulls/3617/commits"},"statuses":{"href":"https://api.github.com/repos/Sylius/Sylius/statuses/4a057ae07bb781becd8384be458a9f703d408e28"}}}}