{"action":"created","comment":{"url":"https://api.github.com/repos/cultuurnet/udb3-php/pulls/comments/90922423","pull_request_review_id":11435874,"id":90922423,"diff_hunk":"@@ -12,32 +10,22 @@ class LabelImporter\n      */\n     public function importLabels(\\CultureFeed_Cdb_Item_Base $item, $jsonLD)\n     {\n-        /** @var CultureFeed_Cdb_Data_Keyword[] $keywords */\n-        $keywords = array_values($item->getKeywords(true));\n-\n-        $validKeywords = array_filter(\n-            $keywords,\n-            function (CultureFeed_Cdb_Data_Keyword $keyword) {\n-                return strlen(trim($keyword->getValue())) > 0;\n-            }\n+        $labelCollection = LabelCollection::fromKeywords(\n+            $item->getKeywords(true)\n         );\n \n-        $visibleKeywords = array_filter(\n-            $validKeywords,\n-            function (CultureFeed_Cdb_Data_Keyword $keyword) {\n-                return $keyword->isVisible();\n+        $visibleLabelCollection = new LabelCollection();\n+        $hiddenLabelCollection = new LabelCollection();\n+        foreach ($labelCollection->asArray() as $label) {\n+            if ($label->isVisible()) {\n+                $visibleLabelCollection = $visibleLabelCollection->with($label);\n+            } else {\n+                $hiddenLabelCollection = $hiddenLabelCollection->with($label);","path":"src/LabelImporter.php","position":35,"original_position":35,"commit_id":"64b711a6b8d07a75806593447d47ee92c81fe797","original_commit_id":"6123581932067caa7b2c4f48287f83293e2737f7","user":{"login":"cyberwolf","id":95102,"avatar_url":"https://avatars.githubusercontent.com/u/95102?v=3","gravatar_id":"","url":"https://api.github.com/users/cyberwolf","html_url":"https://github.com/cyberwolf","followers_url":"https://api.github.com/users/cyberwolf/followers","following_url":"https://api.github.com/users/cyberwolf/following{/other_user}","gists_url":"https://api.github.com/users/cyberwolf/gists{/gist_id}","starred_url":"https://api.github.com/users/cyberwolf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyberwolf/subscriptions","organizations_url":"https://api.github.com/users/cyberwolf/orgs","repos_url":"https://api.github.com/users/cyberwolf/repos","events_url":"https://api.github.com/users/cyberwolf/events{/privacy}","received_events_url":"https://api.github.com/users/cyberwolf/received_events","type":"User","site_admin":false},"body":"Can we move this as new methods into the LabelCollection class? E.g. LabelCollection::onlyVisible() and LabelCollection::onlyInvisible(), which both return a new LabelCollection?","created_at":"2016-12-05T18:12:14Z","updated_at":"2016-12-05T18:21:10Z","html_url":"https://github.com/cultuurnet/udb3-php/pull/249#discussion_r90922423","pull_request_url":"https://api.github.com/repos/cultuurnet/udb3-php/pulls/249","_links":{"self":{"href":"https://api.github.com/repos/cultuurnet/udb3-php/pulls/comments/90922423"},"html":{"href":"https://github.com/cultuurnet/udb3-php/pull/249#discussion_r90922423"},"pull_request":{"href":"https://api.github.com/repos/cultuurnet/udb3-php/pulls/249"}}},"pull_request":{"url":"https://api.github.com/repos/cultuurnet/udb3-php/pulls/249","id":96540107,"html_url":"https://github.com/cultuurnet/udb3-php/pull/249","diff_url":"https://github.com/cultuurnet/udb3-php/pull/249.diff","patch_url":"https://github.com/cultuurnet/udb3-php/pull/249.patch","issue_url":"https://api.github.com/repos/cultuurnet/udb3-php/issues/249","number":249,"state":"open","locked":false,"title":"III-1667 Importing labels which only have different casing.","user":{"login":"LucWollants","id":1322949,"avatar_url":"https://avatars.githubusercontent.com/u/1322949?v=3","gravatar_id":"","url":"https://api.github.com/users/LucWollants","html_url":"https://github.com/LucWollants","followers_url":"https://api.github.com/users/LucWollants/followers","following_url":"https://api.github.com/users/LucWollants/following{/other_user}","gists_url":"https://api.github.com/users/LucWollants/gists{/gist_id}","starred_url":"https://api.github.com/users/LucWollants/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LucWollants/subscriptions","organizations_url":"https://api.github.com/users/LucWollants/orgs","repos_url":"https://api.github.com/users/LucWollants/repos","events_url":"https://api.github.com/users/LucWollants/events{/privacy}","received_events_url":"https://api.github.com/users/LucWollants/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-12-05T14:38:45Z","updated_at":"2016-12-05T18:24:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"453f07d2cfcbcbbfa7c9a0740463a94c91fda82b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/cultuurnet/udb3-php/pulls/249/commits","review_comments_url":"https://api.github.com/repos/cultuurnet/udb3-php/pulls/249/comments","review_comment_url":"https://api.github.com/repos/cultuurnet/udb3-php/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cultuurnet/udb3-php/issues/249/comments","statuses_url":"https://api.github.com/repos/cultuurnet/udb3-php/statuses/64b711a6b8d07a75806593447d47ee92c81fe797","head":{"label":"cultuurnet:feature/III-1667","ref":"feature/III-1667","sha":"64b711a6b8d07a75806593447d47ee92c81fe797","user":{"login":"cultuurnet","id":1853030,"avatar_url":"https://avatars.githubusercontent.com/u/1853030?v=3","gravatar_id":"","url":"https://api.github.com/users/cultuurnet","html_url":"https://github.com/cultuurnet","followers_url":"https://api.github.com/users/cultuurnet/followers","following_url":"https://api.github.com/users/cultuurnet/following{/other_user}","gists_url":"https://api.github.com/users/cultuurnet/gists{/gist_id}","starred_url":"https://api.github.com/users/cultuurnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cultuurnet/subscriptions","organizations_url":"https://api.github.com/users/cultuurnet/orgs","repos_url":"https://api.github.com/users/cultuurnet/repos","events_url":"https://api.github.com/users/cultuurnet/events{/privacy}","received_events_url":"https://api.github.com/users/cultuurnet/received_events","type":"Organization","site_admin":false},"repo":{"id":29340227,"name":"udb3-php","full_name":"cultuurnet/udb3-php","owner":{"login":"cultuurnet","id":1853030,"avatar_url":"https://avatars.githubusercontent.com/u/1853030?v=3","gravatar_id":"","url":"https://api.github.com/users/cultuurnet","html_url":"https://github.com/cultuurnet","followers_url":"https://api.github.com/users/cultuurnet/followers","following_url":"https://api.github.com/users/cultuurnet/following{/other_user}","gists_url":"https://api.github.com/users/cultuurnet/gists{/gist_id}","starred_url":"https://api.github.com/users/cultuurnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cultuurnet/subscriptions","organizations_url":"https://api.github.com/users/cultuurnet/orgs","repos_url":"https://api.github.com/users/cultuurnet/repos","events_url":"https://api.github.com/users/cultuurnet/events{/privacy}","received_events_url":"https://api.github.com/users/cultuurnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cultuurnet/udb3-php","description":"UDB PHP library","fork":false,"url":"https://api.github.com/repos/cultuurnet/udb3-php","forks_url":"https://api.github.com/repos/cultuurnet/udb3-php/forks","keys_url":"https://api.github.com/repos/cultuurnet/udb3-php/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cultuurnet/udb3-php/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cultuurnet/udb3-php/teams","hooks_url":"https://api.github.com/repos/cultuurnet/udb3-php/hooks","issue_events_url":"https://api.github.com/repos/cultuurnet/udb3-php/issues/events{/number}","events_url":"https://api.github.com/repos/cultuurnet/udb3-php/events","assignees_url":"https://api.github.com/repos/cultuurnet/udb3-php/assignees{/user}","branches_url":"https://api.github.com/repos/cultuurnet/udb3-php/branches{/branch}","tags_url":"https://api.github.com/repos/cultuurnet/udb3-php/tags","blobs_url":"https://api.github.com/repos/cultuurnet/udb3-php/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cultuurnet/udb3-php/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cultuurnet/udb3-php/git/refs{/sha}","trees_url":"https://api.github.com/repos/cultuurnet/udb3-php/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cultuurnet/udb3-php/statuses/{sha}","languages_url":"https://api.github.com/repos/cultuurnet/udb3-php/languages","stargazers_url":"https://api.github.com/repos/cultuurnet/udb3-php/stargazers","contributors_url":"https://api.github.com/repos/cultuurnet/udb3-php/contributors","subscribers_url":"https://api.github.com/repos/cultuurnet/udb3-php/subscribers","subscription_url":"https://api.github.com/repos/cultuurnet/udb3-php/subscription","commits_url":"https://api.github.com/repos/cultuurnet/udb3-php/commits{/sha}","git_commits_url":"https://api.github.com/repos/cultuurnet/udb3-php/git/commits{/sha}","comments_url":"https://api.github.com/repos/cultuurnet/udb3-php/comments{/number}","issue_comment_url":"https://api.github.com/repos/cultuurnet/udb3-php/issues/comments{/number}","contents_url":"https://api.github.com/repos/cultuurnet/udb3-php/contents/{+path}","compare_url":"https://api.github.com/repos/cultuurnet/udb3-php/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cultuurnet/udb3-php/merges","archive_url":"https://api.github.com/repos/cultuurnet/udb3-php/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cultuurnet/udb3-php/downloads","issues_url":"https://api.github.com/repos/cultuurnet/udb3-php/issues{/number}","pulls_url":"https://api.github.com/repos/cultuurnet/udb3-php/pulls{/number}","milestones_url":"https://api.github.com/repos/cultuurnet/udb3-php/milestones{/number}","notifications_url":"https://api.github.com/repos/cultuurnet/udb3-php/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cultuurnet/udb3-php/labels{/name}","releases_url":"https://api.github.com/repos/cultuurnet/udb3-php/releases{/id}","deployments_url":"https://api.github.com/repos/cultuurnet/udb3-php/deployments","created_at":"2015-01-16T08:48:52Z","updated_at":"2016-10-22T10:55:13Z","pushed_at":"2016-12-05T18:21:10Z","git_url":"git://github.com/cultuurnet/udb3-php.git","ssh_url":"git@github.com:cultuurnet/udb3-php.git","clone_url":"https://github.com/cultuurnet/udb3-php.git","svn_url":"https://github.com/cultuurnet/udb3-php","homepage":"","size":4992,"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":4,"forks":0,"open_issues":4,"watchers":1,"default_branch":"master"}},"base":{"label":"cultuurnet:master","ref":"master","sha":"0e1155cb63d4e09f1d203ebf13f1a52ad50720bb","user":{"login":"cultuurnet","id":1853030,"avatar_url":"https://avatars.githubusercontent.com/u/1853030?v=3","gravatar_id":"","url":"https://api.github.com/users/cultuurnet","html_url":"https://github.com/cultuurnet","followers_url":"https://api.github.com/users/cultuurnet/followers","following_url":"https://api.github.com/users/cultuurnet/following{/other_user}","gists_url":"https://api.github.com/users/cultuurnet/gists{/gist_id}","starred_url":"https://api.github.com/users/cultuurnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cultuurnet/subscriptions","organizations_url":"https://api.github.com/users/cultuurnet/orgs","repos_url":"https://api.github.com/users/cultuurnet/repos","events_url":"https://api.github.com/users/cultuurnet/events{/privacy}","received_events_url":"https://api.github.com/users/cultuurnet/received_events","type":"Organization","site_admin":false},"repo":{"id":29340227,"name":"udb3-php","full_name":"cultuurnet/udb3-php","owner":{"login":"cultuurnet","id":1853030,"avatar_url":"https://avatars.githubusercontent.com/u/1853030?v=3","gravatar_id":"","url":"https://api.github.com/users/cultuurnet","html_url":"https://github.com/cultuurnet","followers_url":"https://api.github.com/users/cultuurnet/followers","following_url":"https://api.github.com/users/cultuurnet/following{/other_user}","gists_url":"https://api.github.com/users/cultuurnet/gists{/gist_id}","starred_url":"https://api.github.com/users/cultuurnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cultuurnet/subscriptions","organizations_url":"https://api.github.com/users/cultuurnet/orgs","repos_url":"https://api.github.com/users/cultuurnet/repos","events_url":"https://api.github.com/users/cultuurnet/events{/privacy}","received_events_url":"https://api.github.com/users/cultuurnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cultuurnet/udb3-php","description":"UDB PHP library","fork":false,"url":"https://api.github.com/repos/cultuurnet/udb3-php","forks_url":"https://api.github.com/repos/cultuurnet/udb3-php/forks","keys_url":"https://api.github.com/repos/cultuurnet/udb3-php/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cultuurnet/udb3-php/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cultuurnet/udb3-php/teams","hooks_url":"https://api.github.com/repos/cultuurnet/udb3-php/hooks","issue_events_url":"https://api.github.com/repos/cultuurnet/udb3-php/issues/events{/number}","events_url":"https://api.github.com/repos/cultuurnet/udb3-php/events","assignees_url":"https://api.github.com/repos/cultuurnet/udb3-php/assignees{/user}","branches_url":"https://api.github.com/repos/cultuurnet/udb3-php/branches{/branch}","tags_url":"https://api.github.com/repos/cultuurnet/udb3-php/tags","blobs_url":"https://api.github.com/repos/cultuurnet/udb3-php/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cultuurnet/udb3-php/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cultuurnet/udb3-php/git/refs{/sha}","trees_url":"https://api.github.com/repos/cultuurnet/udb3-php/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cultuurnet/udb3-php/statuses/{sha}","languages_url":"https://api.github.com/repos/cultuurnet/udb3-php/languages","stargazers_url":"https://api.github.com/repos/cultuurnet/udb3-php/stargazers","contributors_url":"https://api.github.com/repos/cultuurnet/udb3-php/contributors","subscribers_url":"https://api.github.com/repos/cultuurnet/udb3-php/subscribers","subscription_url":"https://api.github.com/repos/cultuurnet/udb3-php/subscription","commits_url":"https://api.github.com/repos/cultuurnet/udb3-php/commits{/sha}","git_commits_url":"https://api.github.com/repos/cultuurnet/udb3-php/git/commits{/sha}","comments_url":"https://api.github.com/repos/cultuurnet/udb3-php/comments{/number}","issue_comment_url":"https://api.github.com/repos/cultuurnet/udb3-php/issues/comments{/number}","contents_url":"https://api.github.com/repos/cultuurnet/udb3-php/contents/{+path}","compare_url":"https://api.github.com/repos/cultuurnet/udb3-php/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cultuurnet/udb3-php/merges","archive_url":"https://api.github.com/repos/cultuurnet/udb3-php/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cultuurnet/udb3-php/downloads","issues_url":"https://api.github.com/repos/cultuurnet/udb3-php/issues{/number}","pulls_url":"https://api.github.com/repos/cultuurnet/udb3-php/pulls{/number}","milestones_url":"https://api.github.com/repos/cultuurnet/udb3-php/milestones{/number}","notifications_url":"https://api.github.com/repos/cultuurnet/udb3-php/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cultuurnet/udb3-php/labels{/name}","releases_url":"https://api.github.com/repos/cultuurnet/udb3-php/releases{/id}","deployments_url":"https://api.github.com/repos/cultuurnet/udb3-php/deployments","created_at":"2015-01-16T08:48:52Z","updated_at":"2016-10-22T10:55:13Z","pushed_at":"2016-12-05T18:21:10Z","git_url":"git://github.com/cultuurnet/udb3-php.git","ssh_url":"git@github.com:cultuurnet/udb3-php.git","clone_url":"https://github.com/cultuurnet/udb3-php.git","svn_url":"https://github.com/cultuurnet/udb3-php","homepage":"","size":4992,"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":4,"forks":0,"open_issues":4,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cultuurnet/udb3-php/pulls/249"},"html":{"href":"https://github.com/cultuurnet/udb3-php/pull/249"},"issue":{"href":"https://api.github.com/repos/cultuurnet/udb3-php/issues/249"},"comments":{"href":"https://api.github.com/repos/cultuurnet/udb3-php/issues/249/comments"},"review_comments":{"href":"https://api.github.com/repos/cultuurnet/udb3-php/pulls/249/comments"},"review_comment":{"href":"https://api.github.com/repos/cultuurnet/udb3-php/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cultuurnet/udb3-php/pulls/249/commits"},"statuses":{"href":"https://api.github.com/repos/cultuurnet/udb3-php/statuses/64b711a6b8d07a75806593447d47ee92c81fe797"}}}}
{"actor":{"display_login":"cyberwolf"}}