GitHub PullRequestReviewCommentEvent at 2014-12-08 08:24:58
Repository: jackalope
Actor: dbu
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/jackalope/jackalope/pulls/comments/21439625","id":21439625,"diff_hunk":"@@ -0,0 +1,94 @@\n+<?php\n+\n+namespace Jackalope\\Validation\\Path;\n+\n+use DOMElement;\n+use Jackalope\\Validation\\Exception\\InvalidPathException;\n+use Jackalope\\Validation\\PathValidatorInterface;\n+\n+/**\n+ * Abstract class for regex based validators\n+ *\n+ * @license http://www.apache.org/licenses Apache License Version 2.0, January 2004\n+ * @license http://opensource.org/licenses/MIT MIT License\n+ *\n+ * @private\n+ */\n+abstract class AbstractRegexValidator implements PathValidatorInterface\n+{\n+    /**\n+     * Return a regular expression for a valid path\n+     *\n+     * @return string\n+     */\n+    abstract protected function getPathPattern();\n+\n+    /**\n+     * Return a regular expression for a valid name\n+     *\n+     * @return string\n+     */\n+    abstract protected function getNamePattern();\n+\n+    /**\n+     * {@inheritDoc}\n+     */\n+    public function validatePath($path)\n+    {\n+        if (false === $this->validate($path, $this->getPathPattern())) {\n+            throw new InvalidPathException(sprintf('Path \"%s\" is not valid', $path));\n+        }\n+    }\n+\n+    /**\n+     * {@inheritDoc}\n+     */\n+    public function validateAbsPath($path)\n+    {\n+        if (substr($path, 0, 1) !== '/') {\n+            throw new InvalidPathException(sprintf('Path \"%s\" is not absolute', $path));\n+        }\n+\n+        return $this->validatePath($path);\n+    }\n+\n+    /**\n+     * {@inheritDoc}\n+     */\n+    public function validateDestPath($path)\n+    {\n+        if (']' === substr($path, -1)) {\n+            throw new InvalidPathException(sprintf('Destination path \"%s\" must not end with an index', $path));\n+        }\n+\n+        return $this->validatePath($path);","path":"src/Jackalope/Validation/Path/AbstractRegexValidator.php","position":64,"original_position":64,"commit_id":"7a0effbb7159472587f7c125d9fab13ad8d75adc","original_commit_id":"76dc743e01b172e8eba88e57ac6b5abb9eadd0e6","user":{"login":"dbu","id":76576,"avatar_url":"https://avatars.githubusercontent.com/u/76576?v=3","gravatar_id":"","url":"https://api.github.com/users/dbu","html_url":"https://github.com/dbu","followers_url":"https://api.github.com/users/dbu/followers","following_url":"https://api.github.com/users/dbu/following{/other_user}","gists_url":"https://api.github.com/users/dbu/gists{/gist_id}","starred_url":"https://api.github.com/users/dbu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbu/subscriptions","organizations_url":"https://api.github.com/users/dbu/orgs","repos_url":"https://api.github.com/users/dbu/repos","events_url":"https://api.github.com/users/dbu/events{/privacy}","received_events_url":"https://api.github.com/users/dbu/received_events","type":"User","site_admin":false},"body":"and i think a destination path must always be absolute, no?","created_at":"2014-12-08T08:24:58Z","updated_at":"2014-12-08T08:24:58Z","html_url":"https://github.com/jackalope/jackalope/pull/260#discussion_r21439625","pull_request_url":"https://api.github.com/repos/jackalope/jackalope/pulls/260","_links":{"self":{"href":"https://api.github.com/repos/jackalope/jackalope/pulls/comments/21439625"},"html":{"href":"https://github.com/jackalope/jackalope/pull/260#discussion_r21439625"},"pull_request":{"href":"https://api.github.com/repos/jackalope/jackalope/pulls/260"}}},"pull_request":{"url":"https://api.github.com/repos/jackalope/jackalope/pulls/260","id":24899726,"html_url":"https://github.com/jackalope/jackalope/pull/260","diff_url":"https://github.com/jackalope/jackalope/pull/260.diff","patch_url":"https://github.com/jackalope/jackalope/pull/260.patch","issue_url":"https://api.github.com/repos/jackalope/jackalope/issues/260","number":260,"state":"open","locked":false,"title":"Initial path validator","user":{"login":"dantleech","id":530801,"avatar_url":"https://avatars.githubusercontent.com/u/530801?v=3","gravatar_id":"","url":"https://api.github.com/users/dantleech","html_url":"https://github.com/dantleech","followers_url":"https://api.github.com/users/dantleech/followers","following_url":"https://api.github.com/users/dantleech/following{/other_user}","gists_url":"https://api.github.com/users/dantleech/gists{/gist_id}","starred_url":"https://api.github.com/users/dantleech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dantleech/subscriptions","organizations_url":"https://api.github.com/users/dantleech/orgs","repos_url":"https://api.github.com/users/dantleech/repos","events_url":"https://api.github.com/users/dantleech/events{/privacy}","received_events_url":"https://api.github.com/users/dantleech/received_events","type":"User","site_admin":false},"body":"This PR adds two \"path validator\" classes.\r\n\r\n- `JackrabbitPathValidator`\r\n  - Uses the same logic as Jackrabbit for validating paths (inferred from some of the jackrabbit source code)\r\n- `SimplePathValidator`\r\n  - Less permissive than the JackrabbitPathValidator but more basic / predictable.\r\n  - Based on the original Path validation in Doctrine-Dbal but more strict / correct. (the dbal path validator regex, `((/|..)?[-a-zA-Z0-9:_]+)+`, only requires a section of the path to be valid).","created_at":"2014-11-23T09:53:24Z","updated_at":"2014-12-08T08:24:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"970a24da17be1fa06cf732cd5fe2092eb8974212","assignee":null,"milestone":{"url":"https://api.github.com/repos/jackalope/jackalope/milestones/3","labels_url":"https://api.github.com/repos/jackalope/jackalope/milestones/3/labels","id":584833,"number":3,"title":"1.2","description":"","creator":{"login":"dbu","id":76576,"avatar_url":"https://avatars.githubusercontent.com/u/76576?v=3","gravatar_id":"","url":"https://api.github.com/users/dbu","html_url":"https://github.com/dbu","followers_url":"https://api.github.com/users/dbu/followers","following_url":"https://api.github.com/users/dbu/following{/other_user}","gists_url":"https://api.github.com/users/dbu/gists{/gist_id}","starred_url":"https://api.github.com/users/dbu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbu/subscriptions","organizations_url":"https://api.github.com/users/dbu/orgs","repos_url":"https://api.github.com/users/dbu/repos","events_url":"https://api.github.com/users/dbu/events{/privacy}","received_events_url":"https://api.github.com/users/dbu/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":6,"state":"open","created_at":"2014-03-02T12:15:35Z","updated_at":"2014-12-05T16:41:57Z","due_on":"2014-12-31T08:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/jackalope/jackalope/pulls/260/commits","review_comments_url":"https://api.github.com/repos/jackalope/jackalope/pulls/260/comments","review_comment_url":"https://api.github.com/repos/jackalope/jackalope/pulls/comments/{number}","comments_url":"https://api.github.com/repos/jackalope/jackalope/issues/260/comments","statuses_url":"https://api.github.com/repos/jackalope/jackalope/statuses/7a0effbb7159472587f7c125d9fab13ad8d75adc","head":{"label":"jackalope:path_validator","ref":"path_validator","sha":"7a0effbb7159472587f7c125d9fab13ad8d75adc","user":{"login":"jackalope","id":70245,"avatar_url":"https://avatars.githubusercontent.com/u/70245?v=3","gravatar_id":"","url":"https://api.github.com/users/jackalope","html_url":"https://github.com/jackalope","followers_url":"https://api.github.com/users/jackalope/followers","following_url":"https://api.github.com/users/jackalope/following{/other_user}","gists_url":"https://api.github.com/users/jackalope/gists{/gist_id}","starred_url":"https://api.github.com/users/jackalope/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jackalope/subscriptions","organizations_url":"https://api.github.com/users/jackalope/orgs","repos_url":"https://api.github.com/users/jackalope/repos","events_url":"https://api.github.com/users/jackalope/events{/privacy}","received_events_url":"https://api.github.com/users/jackalope/received_events","type":"Organization","site_admin":false},"repo":{"id":563272,"name":"jackalope","full_name":"jackalope/jackalope","owner":{"login":"jackalope","id":70245,"avatar_url":"https://avatars.githubusercontent.com/u/70245?v=3","gravatar_id":"","url":"https://api.github.com/users/jackalope","html_url":"https://github.com/jackalope","followers_url":"https://api.github.com/users/jackalope/followers","following_url":"https://api.github.com/users/jackalope/following{/other_user}","gists_url":"https://api.github.com/users/jackalope/gists{/gist_id}","starred_url":"https://api.github.com/users/jackalope/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jackalope/subscriptions","organizations_url":"https://api.github.com/users/jackalope/orgs","repos_url":"https://api.github.com/users/jackalope/repos","events_url":"https://api.github.com/users/jackalope/events{/privacy}","received_events_url":"https://api.github.com/users/jackalope/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jackalope/jackalope","description":"Jackalope implements the PHPCR API. This modular library contains bindings to store data with the Doctrine DBAL or in the Jackrabbit JCR server part","fork":false,"url":"https://api.github.com/repos/jackalope/jackalope","forks_url":"https://api.github.com/repos/jackalope/jackalope/forks","keys_url":"https://api.github.com/repos/jackalope/jackalope/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jackalope/jackalope/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jackalope/jackalope/teams","hooks_url":"https://api.github.com/repos/jackalope/jackalope/hooks","issue_events_url":"https://api.github.com/repos/jackalope/jackalope/issues/events{/number}","events_url":"https://api.github.com/repos/jackalope/jackalope/events","assignees_url":"https://api.github.com/repos/jackalope/jackalope/assignees{/user}","branches_url":"https://api.github.com/repos/jackalope/jackalope/branches{/branch}","tags_url":"https://api.github.com/repos/jackalope/jackalope/tags","blobs_url":"https://api.github.com/repos/jackalope/jackalope/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jackalope/jackalope/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jackalope/jackalope/git/refs{/sha}","trees_url":"https://api.github.com/repos/jackalope/jackalope/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jackalope/jackalope/statuses/{sha}","languages_url":"https://api.github.com/repos/jackalope/jackalope/languages","stargazers_url":"https://api.github.com/repos/jackalope/jackalope/stargazers","contributors_url":"https://api.github.com/repos/jackalope/jackalope/contributors","subscribers_url":"https://api.github.com/repos/jackalope/jackalope/subscribers","subscription_url":"https://api.github.com/repos/jackalope/jackalope/subscription","commits_url":"https://api.github.com/repos/jackalope/jackalope/commits{/sha}","git_commits_url":"https://api.github.com/repos/jackalope/jackalope/git/commits{/sha}","comments_url":"https://api.github.com/repos/jackalope/jackalope/comments{/number}","issue_comment_url":"https://api.github.com/repos/jackalope/jackalope/issues/comments/{number}","contents_url":"https://api.github.com/repos/jackalope/jackalope/contents/{+path}","compare_url":"https://api.github.com/repos/jackalope/jackalope/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jackalope/jackalope/merges","archive_url":"https://api.github.com/repos/jackalope/jackalope/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jackalope/jackalope/downloads","issues_url":"https://api.github.com/repos/jackalope/jackalope/issues{/number}","pulls_url":"https://api.github.com/repos/jackalope/jackalope/pulls{/number}","milestones_url":"https://api.github.com/repos/jackalope/jackalope/milestones{/number}","notifications_url":"https://api.github.com/repos/jackalope/jackalope/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jackalope/jackalope/labels{/name}","releases_url":"https://api.github.com/repos/jackalope/jackalope/releases{/id}","created_at":"2010-03-15T13:51:08Z","updated_at":"2014-11-24T08:17:27Z","pushed_at":"2014-12-08T08:23:25Z","git_url":"git://github.com/jackalope/jackalope.git","ssh_url":"git@github.com:jackalope/jackalope.git","clone_url":"https://github.com/jackalope/jackalope.git","svn_url":"https://github.com/jackalope/jackalope","homepage":"http://jackalope.github.io","size":13872,"stargazers_count":168,"watchers_count":168,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":54,"mirror_url":null,"open_issues_count":50,"forks":54,"open_issues":50,"watchers":168,"default_branch":"master"}},"base":{"label":"jackalope:master","ref":"master","sha":"af2cca6f47525d3dc4560addd46e9832bf11ef9c","user":{"login":"jackalope","id":70245,"avatar_url":"https://avatars.githubusercontent.com/u/70245?v=3","gravatar_id":"","url":"https://api.github.com/users/jackalope","html_url":"https://github.com/jackalope","followers_url":"https://api.github.com/users/jackalope/followers","following_url":"https://api.github.com/users/jackalope/following{/other_user}","gists_url":"https://api.github.com/users/jackalope/gists{/gist_id}","starred_url":"https://api.github.com/users/jackalope/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jackalope/subscriptions","organizations_url":"https://api.github.com/users/jackalope/orgs","repos_url":"https://api.github.com/users/jackalope/repos","events_url":"https://api.github.com/users/jackalope/events{/privacy}","received_events_url":"https://api.github.com/users/jackalope/received_events","type":"Organization","site_admin":false},"repo":{"id":563272,"name":"jackalope","full_name":"jackalope/jackalope","owner":{"login":"jackalope","id":70245,"avatar_url":"https://avatars.githubusercontent.com/u/70245?v=3","gravatar_id":"","url":"https://api.github.com/users/jackalope","html_url":"https://github.com/jackalope","followers_url":"https://api.github.com/users/jackalope/followers","following_url":"https://api.github.com/users/jackalope/following{/other_user}","gists_url":"https://api.github.com/users/jackalope/gists{/gist_id}","starred_url":"https://api.github.com/users/jackalope/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jackalope/subscriptions","organizations_url":"https://api.github.com/users/jackalope/orgs","repos_url":"https://api.github.com/users/jackalope/repos","events_url":"https://api.github.com/users/jackalope/events{/privacy}","received_events_url":"https://api.github.com/users/jackalope/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jackalope/jackalope","description":"Jackalope implements the PHPCR API. This modular library contains bindings to store data with the Doctrine DBAL or in the Jackrabbit JCR server part","fork":false,"url":"https://api.github.com/repos/jackalope/jackalope","forks_url":"https://api.github.com/repos/jackalope/jackalope/forks","keys_url":"https://api.github.com/repos/jackalope/jackalope/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jackalope/jackalope/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jackalope/jackalope/teams","hooks_url":"https://api.github.com/repos/jackalope/jackalope/hooks","issue_events_url":"https://api.github.com/repos/jackalope/jackalope/issues/events{/number}","events_url":"https://api.github.com/repos/jackalope/jackalope/events","assignees_url":"https://api.github.com/repos/jackalope/jackalope/assignees{/user}","branches_url":"https://api.github.com/repos/jackalope/jackalope/branches{/branch}","tags_url":"https://api.github.com/repos/jackalope/jackalope/tags","blobs_url":"https://api.github.com/repos/jackalope/jackalope/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jackalope/jackalope/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jackalope/jackalope/git/refs{/sha}","trees_url":"https://api.github.com/repos/jackalope/jackalope/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jackalope/jackalope/statuses/{sha}","languages_url":"https://api.github.com/repos/jackalope/jackalope/languages","stargazers_url":"https://api.github.com/repos/jackalope/jackalope/stargazers","contributors_url":"https://api.github.com/repos/jackalope/jackalope/contributors","subscribers_url":"https://api.github.com/repos/jackalope/jackalope/subscribers","subscription_url":"https://api.github.com/repos/jackalope/jackalope/subscription","commits_url":"https://api.github.com/repos/jackalope/jackalope/commits{/sha}","git_commits_url":"https://api.github.com/repos/jackalope/jackalope/git/commits{/sha}","comments_url":"https://api.github.com/repos/jackalope/jackalope/comments{/number}","issue_comment_url":"https://api.github.com/repos/jackalope/jackalope/issues/comments/{number}","contents_url":"https://api.github.com/repos/jackalope/jackalope/contents/{+path}","compare_url":"https://api.github.com/repos/jackalope/jackalope/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jackalope/jackalope/merges","archive_url":"https://api.github.com/repos/jackalope/jackalope/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jackalope/jackalope/downloads","issues_url":"https://api.github.com/repos/jackalope/jackalope/issues{/number}","pulls_url":"https://api.github.com/repos/jackalope/jackalope/pulls{/number}","milestones_url":"https://api.github.com/repos/jackalope/jackalope/milestones{/number}","notifications_url":"https://api.github.com/repos/jackalope/jackalope/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jackalope/jackalope/labels{/name}","releases_url":"https://api.github.com/repos/jackalope/jackalope/releases{/id}","created_at":"2010-03-15T13:51:08Z","updated_at":"2014-11-24T08:17:27Z","pushed_at":"2014-12-08T08:23:25Z","git_url":"git://github.com/jackalope/jackalope.git","ssh_url":"git@github.com:jackalope/jackalope.git","clone_url":"https://github.com/jackalope/jackalope.git","svn_url":"https://github.com/jackalope/jackalope","homepage":"http://jackalope.github.io","size":13872,"stargazers_count":168,"watchers_count":168,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":54,"mirror_url":null,"open_issues_count":50,"forks":54,"open_issues":50,"watchers":168,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jackalope/jackalope/pulls/260"},"html":{"href":"https://github.com/jackalope/jackalope/pull/260"},"issue":{"href":"https://api.github.com/repos/jackalope/jackalope/issues/260"},"comments":{"href":"https://api.github.com/repos/jackalope/jackalope/issues/260/comments"},"review_comments":{"href":"https://api.github.com/repos/jackalope/jackalope/pulls/260/comments"},"review_comment":{"href":"https://api.github.com/repos/jackalope/jackalope/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/jackalope/jackalope/pulls/260/commits"},"statuses":{"href":"https://api.github.com/repos/jackalope/jackalope/statuses/7a0effbb7159472587f7c125d9fab13ad8d75adc"}}}}