{"action":"created","comment":{"url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/pulls/comments/32619512","id":32619512,"diff_hunk":"@@ -17,19 +17,18 @@ class PathFinderCore extends PathFinderBase implements PathFinderInterface {\n   public function find($seed) {\n     $seed = realpath($seed);\n     // Try to create the iterator with the seed.\n-    try {\n+    $directory = NULL;\n+    if (is_dir($seed)) {\n       $directory = new \\DirectoryIterator($seed);\n     }\n-    catch (\\RuntimeException $e) {\n-      // If the seed was not a directory, then get the parent directory.\n-      $path_info = pathinfo($seed);\n-      $directory = new \\DirectoryIterator($path_info['dirname']);\n+    else {\n+      $directory = new \\DirectoryIterator(dirname($seed));\n     }\n     // Starting at the directory containing the seed path, we go one directory\n     // up and up and up until we reach the Drupal root.\n     do {\n       if ($this->isDrupalRoot($directory)) {\n-        return $this->cleanDirPath($directory->getPathName()) . $this->path;\n+        return dirname($this->cleanDirPath($directory->getPathName())) . $this->path;","path":"src/Discovery/PathFinderCore.php","position":21,"original_position":21,"commit_id":"0df82163e13280c930a9f2f6aedd1ce8957ac8c5","original_commit_id":"0df82163e13280c930a9f2f6aedd1ce8957ac8c5","user":{"login":"mateu-aguilo-bosch","id":1140906,"avatar_url":"https://avatars.githubusercontent.com/u/1140906?v=3","gravatar_id":"","url":"https://api.github.com/users/mateu-aguilo-bosch","html_url":"https://github.com/mateu-aguilo-bosch","followers_url":"https://api.github.com/users/mateu-aguilo-bosch/followers","following_url":"https://api.github.com/users/mateu-aguilo-bosch/following{/other_user}","gists_url":"https://api.github.com/users/mateu-aguilo-bosch/gists{/gist_id}","starred_url":"https://api.github.com/users/mateu-aguilo-bosch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mateu-aguilo-bosch/subscriptions","organizations_url":"https://api.github.com/users/mateu-aguilo-bosch/orgs","repos_url":"https://api.github.com/users/mateu-aguilo-bosch/repos","events_url":"https://api.github.com/users/mateu-aguilo-bosch/events{/privacy}","received_events_url":"https://api.github.com/users/mateu-aguilo-bosch/received_events","type":"User","site_admin":false},"body":"Oh! I see, you want to replace `cleanDirPath` by `dirname`.","created_at":"2015-06-17T12:09:41Z","updated_at":"2015-06-17T12:09:41Z","html_url":"https://github.com/mateu-aguilo-bosch/drupal-unit-autoload/pull/20#discussion_r32619512","pull_request_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/pulls/20","_links":{"self":{"href":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/pulls/comments/32619512"},"html":{"href":"https://github.com/mateu-aguilo-bosch/drupal-unit-autoload/pull/20#discussion_r32619512"},"pull_request":{"href":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/pulls/20"}}},"pull_request":{"url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/pulls/20","id":37890337,"html_url":"https://github.com/mateu-aguilo-bosch/drupal-unit-autoload/pull/20","diff_url":"https://github.com/mateu-aguilo-bosch/drupal-unit-autoload/pull/20.diff","patch_url":"https://github.com/mateu-aguilo-bosch/drupal-unit-autoload/pull/20.patch","issue_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/issues/20","number":20,"state":"open","locked":false,"title":"Cleaned up path creation and drupal checks.","user":{"login":"penyaskito","id":516163,"avatar_url":"https://avatars.githubusercontent.com/u/516163?v=3","gravatar_id":"","url":"https://api.github.com/users/penyaskito","html_url":"https://github.com/penyaskito","followers_url":"https://api.github.com/users/penyaskito/followers","following_url":"https://api.github.com/users/penyaskito/following{/other_user}","gists_url":"https://api.github.com/users/penyaskito/gists{/gist_id}","starred_url":"https://api.github.com/users/penyaskito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/penyaskito/subscriptions","organizations_url":"https://api.github.com/users/penyaskito/orgs","repos_url":"https://api.github.com/users/penyaskito/repos","events_url":"https://api.github.com/users/penyaskito/events{/privacy}","received_events_url":"https://api.github.com/users/penyaskito/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-06-17T11:25:48Z","updated_at":"2015-06-17T12:09:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1fd50b684e50738d0debac854e6b64a4f9f31591","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/pulls/20/commits","review_comments_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/pulls/20/comments","review_comment_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/issues/20/comments","statuses_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/statuses/0df82163e13280c930a9f2f6aedd1ce8957ac8c5","head":{"label":"mateu-aguilo-bosch:fixed-recursion-problem","ref":"fixed-recursion-problem","sha":"0df82163e13280c930a9f2f6aedd1ce8957ac8c5","user":{"login":"mateu-aguilo-bosch","id":1140906,"avatar_url":"https://avatars.githubusercontent.com/u/1140906?v=3","gravatar_id":"","url":"https://api.github.com/users/mateu-aguilo-bosch","html_url":"https://github.com/mateu-aguilo-bosch","followers_url":"https://api.github.com/users/mateu-aguilo-bosch/followers","following_url":"https://api.github.com/users/mateu-aguilo-bosch/following{/other_user}","gists_url":"https://api.github.com/users/mateu-aguilo-bosch/gists{/gist_id}","starred_url":"https://api.github.com/users/mateu-aguilo-bosch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mateu-aguilo-bosch/subscriptions","organizations_url":"https://api.github.com/users/mateu-aguilo-bosch/orgs","repos_url":"https://api.github.com/users/mateu-aguilo-bosch/repos","events_url":"https://api.github.com/users/mateu-aguilo-bosch/events{/privacy}","received_events_url":"https://api.github.com/users/mateu-aguilo-bosch/received_events","type":"User","site_admin":false},"repo":{"id":37407321,"name":"drupal-unit-autoload","full_name":"mateu-aguilo-bosch/drupal-unit-autoload","owner":{"login":"mateu-aguilo-bosch","id":1140906,"avatar_url":"https://avatars.githubusercontent.com/u/1140906?v=3","gravatar_id":"","url":"https://api.github.com/users/mateu-aguilo-bosch","html_url":"https://github.com/mateu-aguilo-bosch","followers_url":"https://api.github.com/users/mateu-aguilo-bosch/followers","following_url":"https://api.github.com/users/mateu-aguilo-bosch/following{/other_user}","gists_url":"https://api.github.com/users/mateu-aguilo-bosch/gists{/gist_id}","starred_url":"https://api.github.com/users/mateu-aguilo-bosch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mateu-aguilo-bosch/subscriptions","organizations_url":"https://api.github.com/users/mateu-aguilo-bosch/orgs","repos_url":"https://api.github.com/users/mateu-aguilo-bosch/repos","events_url":"https://api.github.com/users/mateu-aguilo-bosch/events{/privacy}","received_events_url":"https://api.github.com/users/mateu-aguilo-bosch/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mateu-aguilo-bosch/drupal-unit-autoload","description":"Helper library for autoloading during PHPUnit tests in Drupal 7 modules.","fork":false,"url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload","forks_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/forks","keys_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/teams","hooks_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/hooks","issue_events_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/issues/events{/number}","events_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/events","assignees_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/assignees{/user}","branches_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/branches{/branch}","tags_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/tags","blobs_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/git/refs{/sha}","trees_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/statuses/{sha}","languages_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/languages","stargazers_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/stargazers","contributors_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/contributors","subscribers_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/subscribers","subscription_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/subscription","commits_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/commits{/sha}","git_commits_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/git/commits{/sha}","comments_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/comments{/number}","issue_comment_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/issues/comments{/number}","contents_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/contents/{+path}","compare_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/merges","archive_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/downloads","issues_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/issues{/number}","pulls_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/pulls{/number}","milestones_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/milestones{/number}","notifications_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/labels{/name}","releases_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/releases{/id}","created_at":"2015-06-14T09:53:02Z","updated_at":"2015-06-14T20:51:10Z","pushed_at":"2015-06-17T11:25:49Z","git_url":"git://github.com/mateu-aguilo-bosch/drupal-unit-autoload.git","ssh_url":"git@github.com:mateu-aguilo-bosch/drupal-unit-autoload.git","clone_url":"https://github.com/mateu-aguilo-bosch/drupal-unit-autoload.git","svn_url":"https://github.com/mateu-aguilo-bosch/drupal-unit-autoload","homepage":null,"size":362,"stargazers_count":3,"watchers_count":3,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":3,"default_branch":"master"}},"base":{"label":"mateu-aguilo-bosch:master","ref":"master","sha":"2f8ac28ff16f6b188f13935bbcbdb479712bb4e6","user":{"login":"mateu-aguilo-bosch","id":1140906,"avatar_url":"https://avatars.githubusercontent.com/u/1140906?v=3","gravatar_id":"","url":"https://api.github.com/users/mateu-aguilo-bosch","html_url":"https://github.com/mateu-aguilo-bosch","followers_url":"https://api.github.com/users/mateu-aguilo-bosch/followers","following_url":"https://api.github.com/users/mateu-aguilo-bosch/following{/other_user}","gists_url":"https://api.github.com/users/mateu-aguilo-bosch/gists{/gist_id}","starred_url":"https://api.github.com/users/mateu-aguilo-bosch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mateu-aguilo-bosch/subscriptions","organizations_url":"https://api.github.com/users/mateu-aguilo-bosch/orgs","repos_url":"https://api.github.com/users/mateu-aguilo-bosch/repos","events_url":"https://api.github.com/users/mateu-aguilo-bosch/events{/privacy}","received_events_url":"https://api.github.com/users/mateu-aguilo-bosch/received_events","type":"User","site_admin":false},"repo":{"id":37407321,"name":"drupal-unit-autoload","full_name":"mateu-aguilo-bosch/drupal-unit-autoload","owner":{"login":"mateu-aguilo-bosch","id":1140906,"avatar_url":"https://avatars.githubusercontent.com/u/1140906?v=3","gravatar_id":"","url":"https://api.github.com/users/mateu-aguilo-bosch","html_url":"https://github.com/mateu-aguilo-bosch","followers_url":"https://api.github.com/users/mateu-aguilo-bosch/followers","following_url":"https://api.github.com/users/mateu-aguilo-bosch/following{/other_user}","gists_url":"https://api.github.com/users/mateu-aguilo-bosch/gists{/gist_id}","starred_url":"https://api.github.com/users/mateu-aguilo-bosch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mateu-aguilo-bosch/subscriptions","organizations_url":"https://api.github.com/users/mateu-aguilo-bosch/orgs","repos_url":"https://api.github.com/users/mateu-aguilo-bosch/repos","events_url":"https://api.github.com/users/mateu-aguilo-bosch/events{/privacy}","received_events_url":"https://api.github.com/users/mateu-aguilo-bosch/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mateu-aguilo-bosch/drupal-unit-autoload","description":"Helper library for autoloading during PHPUnit tests in Drupal 7 modules.","fork":false,"url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload","forks_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/forks","keys_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/teams","hooks_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/hooks","issue_events_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/issues/events{/number}","events_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/events","assignees_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/assignees{/user}","branches_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/branches{/branch}","tags_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/tags","blobs_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/git/refs{/sha}","trees_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/statuses/{sha}","languages_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/languages","stargazers_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/stargazers","contributors_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/contributors","subscribers_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/subscribers","subscription_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/subscription","commits_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/commits{/sha}","git_commits_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/git/commits{/sha}","comments_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/comments{/number}","issue_comment_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/issues/comments{/number}","contents_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/contents/{+path}","compare_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/merges","archive_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/downloads","issues_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/issues{/number}","pulls_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/pulls{/number}","milestones_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/milestones{/number}","notifications_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/labels{/name}","releases_url":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/releases{/id}","created_at":"2015-06-14T09:53:02Z","updated_at":"2015-06-14T20:51:10Z","pushed_at":"2015-06-17T11:25:49Z","git_url":"git://github.com/mateu-aguilo-bosch/drupal-unit-autoload.git","ssh_url":"git@github.com:mateu-aguilo-bosch/drupal-unit-autoload.git","clone_url":"https://github.com/mateu-aguilo-bosch/drupal-unit-autoload.git","svn_url":"https://github.com/mateu-aguilo-bosch/drupal-unit-autoload","homepage":null,"size":362,"stargazers_count":3,"watchers_count":3,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/pulls/20"},"html":{"href":"https://github.com/mateu-aguilo-bosch/drupal-unit-autoload/pull/20"},"issue":{"href":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/issues/20"},"comments":{"href":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/issues/20/comments"},"review_comments":{"href":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/pulls/20/comments"},"review_comment":{"href":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/pulls/20/commits"},"statuses":{"href":"https://api.github.com/repos/mateu-aguilo-bosch/drupal-unit-autoload/statuses/0df82163e13280c930a9f2f6aedd1ce8957ac8c5"}}}}