{"action":"created","comment":{"url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/pulls/comments/72258744","id":72258744,"diff_hunk":"@@ -0,0 +1,91 @@\n+<?php\n+/**\n+ * This file is part of DoctrineRestDriver.\n+ *\n+ * DoctrineRestDriver is free software: you can redistribute it and/or modify\n+ * it under the terms of the GNU General Public License as published by\n+ * the Free Software Foundation, either version 3 of the License, or\n+ * (at your option) any later version.\n+ *\n+ * DoctrineRestDriver is distributed in the hope that it will be useful,\n+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\n+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+ * GNU General Public License for more details.\n+ *\n+ * You should have received a copy of the GNU General Public License\n+ * along with DoctrineRestDriver.  If not, see <http://www.gnu.org/licenses/>.\n+ */\n+\n+namespace Circle\\DoctrineRestDriver\\Annotations;\n+\n+use Circle\\DoctrineRestDriver\\Validation\\Assertions;\n+use Doctrine\\Common\\Annotations\\AnnotationReader;\n+\n+/**\n+ * Contains all routing information about all entities\n+ *\n+ * @author    Tobias Hauck <tobias@circle.ai>\n+ * @copyright 2015 TeeAge-Beatz UG\n+ */\n+class RoutingTable {\n+\n+    /**\n+     * @var array\n+     */\n+    private $routingTable = [];\n+\n+    /**\n+     * @var AnnotationReader\n+     */\n+    private $reader;\n+\n+    /**\n+     * @var array\n+     */\n+    private $annotations = [\n+        'post'   => 'Circle\\DoctrineRestDriver\\Annotations\\Insert',\n+        'put'    => 'Circle\\DoctrineRestDriver\\Annotations\\Update',\n+        'get'    => 'Circle\\DoctrineRestDriver\\Annotations\\Select',\n+        'delete' => 'Circle\\DoctrineRestDriver\\Annotations\\Delete',\n+        'getAll' => 'Circle\\DoctrineRestDriver\\Annotations\\Fetch'\n+    ];\n+\n+    /**\n+     * RoutingTable constructor\n+     *\n+     * @param array $entities\n+     *\n+     * @SuppressWarnings(\"PHPMD.StaticAccess\")\n+     */\n+    public function __construct(array $entities) {\n+        Assertions::assertHashMap('entities', $entities);\n+\n+        $this->reader = new AnnotationReader();\n+\n+        $aliases            = array_flip($entities);\n+        $this->routingTable = array_reduce($entities, function ($carry, $namespace) use ($aliases) {","path":"Annotations/RoutingTable.php","position":66,"original_position":66,"commit_id":"b22c7650f4022b8c45a19f4a0d1ea1bc7e33159a","original_commit_id":"b22c7650f4022b8c45a19f4a0d1ea1bc7e33159a","user":{"login":"donjuandem","id":1221906,"avatar_url":"https://avatars.githubusercontent.com/u/1221906?v=3","gravatar_id":"","url":"https://api.github.com/users/donjuandem","html_url":"https://github.com/donjuandem","followers_url":"https://api.github.com/users/donjuandem/followers","following_url":"https://api.github.com/users/donjuandem/following{/other_user}","gists_url":"https://api.github.com/users/donjuandem/gists{/gist_id}","starred_url":"https://api.github.com/users/donjuandem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donjuandem/subscriptions","organizations_url":"https://api.github.com/users/donjuandem/orgs","repos_url":"https://api.github.com/users/donjuandem/repos","events_url":"https://api.github.com/users/donjuandem/events{/privacy}","received_events_url":"https://api.github.com/users/donjuandem/received_events","type":"User","site_admin":false},"body":"das mit dem reduce in dem reduce kommt mir noch falsch vor, aber ich versteh auch grad nit genau was du machs, also du reduced entities (en array) auf en routingtable, was en auch en array der selben größe is (jede entity hat ein routing) => das is en map und das andere holt dann über die annotations die routes - aber warum du da das geflippte array brauchs, verstehe ich nich (kann aber auch mit php zu tun haben :D). Wenn dieses gedöns da is, um die keys richtig zu setzen (was ich vermute), dann mach das lieber schrittweise:\r\n\r\n* ers die values als liste nehmen und zu den values transformieren die du brauchs\r\n* dann die liste nehmen und auf die datenstruktur reducen, die du brauchst\r\n\r\naber evtl is es auch was anderes, ich bräuchte da input","created_at":"2016-07-26T14:22:54Z","updated_at":"2016-07-26T14:22:54Z","html_url":"https://github.com/CircleOfNice/DoctrineRestDriver/pull/26#discussion_r72258744","pull_request_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/pulls/26","_links":{"self":{"href":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/pulls/comments/72258744"},"html":{"href":"https://github.com/CircleOfNice/DoctrineRestDriver/pull/26#discussion_r72258744"},"pull_request":{"href":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/pulls/26"}}},"pull_request":{"url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/pulls/26","id":78299376,"html_url":"https://github.com/CircleOfNice/DoctrineRestDriver/pull/26","diff_url":"https://github.com/CircleOfNice/DoctrineRestDriver/pull/26.diff","patch_url":"https://github.com/CircleOfNice/DoctrineRestDriver/pull/26.patch","issue_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/issues/26","number":26,"state":"open","locked":false,"title":"Route annotations","user":{"login":"TobiasHauck","id":6579735,"avatar_url":"https://avatars.githubusercontent.com/u/6579735?v=3","gravatar_id":"","url":"https://api.github.com/users/TobiasHauck","html_url":"https://github.com/TobiasHauck","followers_url":"https://api.github.com/users/TobiasHauck/followers","following_url":"https://api.github.com/users/TobiasHauck/following{/other_user}","gists_url":"https://api.github.com/users/TobiasHauck/gists{/gist_id}","starred_url":"https://api.github.com/users/TobiasHauck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TobiasHauck/subscriptions","organizations_url":"https://api.github.com/users/TobiasHauck/orgs","repos_url":"https://api.github.com/users/TobiasHauck/repos","events_url":"https://api.github.com/users/TobiasHauck/events{/privacy}","received_events_url":"https://api.github.com/users/TobiasHauck/received_events","type":"User","site_admin":false},"body":"**Fixes** #24 Routing configuration for each method\r\n\r\n#### Proposed Changes\r\n* Adds an annotation for each route to configure each url\r\n\r\n!!README.md needs to be updated!!","created_at":"2016-07-21T11:24:37Z","updated_at":"2016-07-26T14:22:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"860bda7aee1283a630488c7b297f0dc0393f8f8a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/pulls/26/commits","review_comments_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/pulls/26/comments","review_comment_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/issues/26/comments","statuses_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/statuses/b22c7650f4022b8c45a19f4a0d1ea1bc7e33159a","head":{"label":"CircleOfNice:route-annotations","ref":"route-annotations","sha":"b22c7650f4022b8c45a19f4a0d1ea1bc7e33159a","user":{"login":"CircleOfNice","id":7568718,"avatar_url":"https://avatars.githubusercontent.com/u/7568718?v=3","gravatar_id":"","url":"https://api.github.com/users/CircleOfNice","html_url":"https://github.com/CircleOfNice","followers_url":"https://api.github.com/users/CircleOfNice/followers","following_url":"https://api.github.com/users/CircleOfNice/following{/other_user}","gists_url":"https://api.github.com/users/CircleOfNice/gists{/gist_id}","starred_url":"https://api.github.com/users/CircleOfNice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CircleOfNice/subscriptions","organizations_url":"https://api.github.com/users/CircleOfNice/orgs","repos_url":"https://api.github.com/users/CircleOfNice/repos","events_url":"https://api.github.com/users/CircleOfNice/events{/privacy}","received_events_url":"https://api.github.com/users/CircleOfNice/received_events","type":"Organization","site_admin":false},"repo":{"id":53810158,"name":"DoctrineRestDriver","full_name":"CircleOfNice/DoctrineRestDriver","owner":{"login":"CircleOfNice","id":7568718,"avatar_url":"https://avatars.githubusercontent.com/u/7568718?v=3","gravatar_id":"","url":"https://api.github.com/users/CircleOfNice","html_url":"https://github.com/CircleOfNice","followers_url":"https://api.github.com/users/CircleOfNice/followers","following_url":"https://api.github.com/users/CircleOfNice/following{/other_user}","gists_url":"https://api.github.com/users/CircleOfNice/gists{/gist_id}","starred_url":"https://api.github.com/users/CircleOfNice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CircleOfNice/subscriptions","organizations_url":"https://api.github.com/users/CircleOfNice/orgs","repos_url":"https://api.github.com/users/CircleOfNice/repos","events_url":"https://api.github.com/users/CircleOfNice/events{/privacy}","received_events_url":"https://api.github.com/users/CircleOfNice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CircleOfNice/DoctrineRestDriver","description":"","fork":false,"url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver","forks_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/forks","keys_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/teams","hooks_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/hooks","issue_events_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/issues/events{/number}","events_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/events","assignees_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/assignees{/user}","branches_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/branches{/branch}","tags_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/tags","blobs_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/git/refs{/sha}","trees_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/statuses/{sha}","languages_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/languages","stargazers_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/stargazers","contributors_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/contributors","subscribers_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/subscribers","subscription_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/subscription","commits_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/commits{/sha}","git_commits_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/git/commits{/sha}","comments_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/comments{/number}","issue_comment_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/issues/comments{/number}","contents_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/contents/{+path}","compare_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/merges","archive_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/downloads","issues_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/issues{/number}","pulls_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/pulls{/number}","milestones_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/milestones{/number}","notifications_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/labels{/name}","releases_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/releases{/id}","deployments_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/deployments","created_at":"2016-03-13T22:05:24Z","updated_at":"2016-07-13T06:55:08Z","pushed_at":"2016-07-26T07:42:50Z","git_url":"git://github.com/CircleOfNice/DoctrineRestDriver.git","ssh_url":"git@github.com:CircleOfNice/DoctrineRestDriver.git","clone_url":"https://github.com/CircleOfNice/DoctrineRestDriver.git","svn_url":"https://github.com/CircleOfNice/DoctrineRestDriver","homepage":null,"size":204,"stargazers_count":23,"watchers_count":23,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":4,"forks":4,"open_issues":4,"watchers":23,"default_branch":"master"}},"base":{"label":"CircleOfNice:master","ref":"master","sha":"64111920c7d9a692052a2e7dc61ab6f6f3c38119","user":{"login":"CircleOfNice","id":7568718,"avatar_url":"https://avatars.githubusercontent.com/u/7568718?v=3","gravatar_id":"","url":"https://api.github.com/users/CircleOfNice","html_url":"https://github.com/CircleOfNice","followers_url":"https://api.github.com/users/CircleOfNice/followers","following_url":"https://api.github.com/users/CircleOfNice/following{/other_user}","gists_url":"https://api.github.com/users/CircleOfNice/gists{/gist_id}","starred_url":"https://api.github.com/users/CircleOfNice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CircleOfNice/subscriptions","organizations_url":"https://api.github.com/users/CircleOfNice/orgs","repos_url":"https://api.github.com/users/CircleOfNice/repos","events_url":"https://api.github.com/users/CircleOfNice/events{/privacy}","received_events_url":"https://api.github.com/users/CircleOfNice/received_events","type":"Organization","site_admin":false},"repo":{"id":53810158,"name":"DoctrineRestDriver","full_name":"CircleOfNice/DoctrineRestDriver","owner":{"login":"CircleOfNice","id":7568718,"avatar_url":"https://avatars.githubusercontent.com/u/7568718?v=3","gravatar_id":"","url":"https://api.github.com/users/CircleOfNice","html_url":"https://github.com/CircleOfNice","followers_url":"https://api.github.com/users/CircleOfNice/followers","following_url":"https://api.github.com/users/CircleOfNice/following{/other_user}","gists_url":"https://api.github.com/users/CircleOfNice/gists{/gist_id}","starred_url":"https://api.github.com/users/CircleOfNice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CircleOfNice/subscriptions","organizations_url":"https://api.github.com/users/CircleOfNice/orgs","repos_url":"https://api.github.com/users/CircleOfNice/repos","events_url":"https://api.github.com/users/CircleOfNice/events{/privacy}","received_events_url":"https://api.github.com/users/CircleOfNice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CircleOfNice/DoctrineRestDriver","description":"","fork":false,"url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver","forks_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/forks","keys_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/teams","hooks_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/hooks","issue_events_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/issues/events{/number}","events_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/events","assignees_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/assignees{/user}","branches_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/branches{/branch}","tags_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/tags","blobs_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/git/refs{/sha}","trees_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/statuses/{sha}","languages_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/languages","stargazers_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/stargazers","contributors_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/contributors","subscribers_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/subscribers","subscription_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/subscription","commits_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/commits{/sha}","git_commits_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/git/commits{/sha}","comments_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/comments{/number}","issue_comment_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/issues/comments{/number}","contents_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/contents/{+path}","compare_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/merges","archive_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/downloads","issues_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/issues{/number}","pulls_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/pulls{/number}","milestones_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/milestones{/number}","notifications_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/labels{/name}","releases_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/releases{/id}","deployments_url":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/deployments","created_at":"2016-03-13T22:05:24Z","updated_at":"2016-07-13T06:55:08Z","pushed_at":"2016-07-26T07:42:50Z","git_url":"git://github.com/CircleOfNice/DoctrineRestDriver.git","ssh_url":"git@github.com:CircleOfNice/DoctrineRestDriver.git","clone_url":"https://github.com/CircleOfNice/DoctrineRestDriver.git","svn_url":"https://github.com/CircleOfNice/DoctrineRestDriver","homepage":null,"size":204,"stargazers_count":23,"watchers_count":23,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":4,"forks":4,"open_issues":4,"watchers":23,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/pulls/26"},"html":{"href":"https://github.com/CircleOfNice/DoctrineRestDriver/pull/26"},"issue":{"href":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/issues/26"},"comments":{"href":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/issues/26/comments"},"review_comments":{"href":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/pulls/26/comments"},"review_comment":{"href":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/pulls/26/commits"},"statuses":{"href":"https://api.github.com/repos/CircleOfNice/DoctrineRestDriver/statuses/b22c7650f4022b8c45a19f4a0d1ea1bc7e33159a"}}}}
{"actor":{"display_login":"donjuandem"}}