{"action":"created","comment":{"url":"https://api.github.com/repos/doctrine/dbal/pulls/comments/56422068","id":56422068,"diff_hunk":"@@ -234,13 +234,21 @@ public static function typeExists($name)\n      */\n     public static function unknownColumnType($name)\n     {\n-        return new self('Unknown column type \"'.$name.'\" requested. Any Doctrine type that you use has ' .\n-            'to be registered with \\Doctrine\\DBAL\\Types\\Type::addType(). You can get a list of all the ' .\n-            'known types with \\Doctrine\\DBAL\\Types\\Type::getTypesMap(). If this error occurs during database ' .\n-            'introspection then you might have forgot to register all database types for a Doctrine Type. Use ' .\n-            'AbstractPlatform#registerDoctrineTypeMapping() or have your custom types implement ' .\n-            'Type#getMappedDatabaseTypes(). If the type name is empty you might ' .\n-            'have a problem with the cache or forgot some mapping information.'\n+        $bestGuess = '';\n+\n+        foreach (array_keys(Type::getTypesMap()) as $typeName) {\n+            if (levenshtein($typeName, $name) < 3) {","path":"lib/Doctrine/DBAL/DBALException.php","position":14,"original_position":14,"commit_id":"0c011b373d53f0f77e04f2c3d9a254e09e32a497","original_commit_id":"0c011b373d53f0f77e04f2c3d9a254e09e32a497","user":{"login":"Ocramius","id":154256,"avatar_url":"https://avatars.githubusercontent.com/u/154256?v=3","gravatar_id":"","url":"https://api.github.com/users/Ocramius","html_url":"https://github.com/Ocramius","followers_url":"https://api.github.com/users/Ocramius/followers","following_url":"https://api.github.com/users/Ocramius/following{/other_user}","gists_url":"https://api.github.com/users/Ocramius/gists{/gist_id}","starred_url":"https://api.github.com/users/Ocramius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ocramius/subscriptions","organizations_url":"https://api.github.com/users/Ocramius/orgs","repos_url":"https://api.github.com/users/Ocramius/repos","events_url":"https://api.github.com/users/Ocramius/events{/privacy}","received_events_url":"https://api.github.com/users/Ocramius/received_events","type":"User","site_admin":false},"body":"While the intent is good here, shouldn't you look for the closest match? The loop will overwrite the value with non-closest matches here.\r\n\r\nIn addition to that, test case needs to be added, since we start having some actual non-trivial stuff going on here :-)","created_at":"2016-03-16T21:50:42Z","updated_at":"2016-03-16T21:50:42Z","html_url":"https://github.com/doctrine/dbal/pull/2336#discussion_r56422068","pull_request_url":"https://api.github.com/repos/doctrine/dbal/pulls/2336","_links":{"self":{"href":"https://api.github.com/repos/doctrine/dbal/pulls/comments/56422068"},"html":{"href":"https://github.com/doctrine/dbal/pull/2336#discussion_r56422068"},"pull_request":{"href":"https://api.github.com/repos/doctrine/dbal/pulls/2336"}}},"pull_request":{"url":"https://api.github.com/repos/doctrine/dbal/pulls/2336","id":63141143,"html_url":"https://github.com/doctrine/dbal/pull/2336","diff_url":"https://github.com/doctrine/dbal/pull/2336.diff","patch_url":"https://github.com/doctrine/dbal/pull/2336.patch","issue_url":"https://api.github.com/repos/doctrine/dbal/issues/2336","number":2336,"state":"open","locked":false,"title":"[Types] Make unknown type exception a bit friendlier","user":{"login":"kix","id":345754,"avatar_url":"https://avatars.githubusercontent.com/u/345754?v=3","gravatar_id":"","url":"https://api.github.com/users/kix","html_url":"https://github.com/kix","followers_url":"https://api.github.com/users/kix/followers","following_url":"https://api.github.com/users/kix/following{/other_user}","gists_url":"https://api.github.com/users/kix/gists{/gist_id}","starred_url":"https://api.github.com/users/kix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kix/subscriptions","organizations_url":"https://api.github.com/users/kix/orgs","repos_url":"https://api.github.com/users/kix/repos","events_url":"https://api.github.com/users/kix/events{/privacy}","received_events_url":"https://api.github.com/users/kix/received_events","type":"User","site_admin":false},"body":"This adds a suggested type for cases when someone could have badly referenced a mapping type, yet there is a type that's named closely to what the user originally wanted.","created_at":"2016-03-16T21:45:40Z","updated_at":"2016-03-16T21:50:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6d768ca799dc4cc5787dfd6b30d9540f1b324750","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/doctrine/dbal/pulls/2336/commits","review_comments_url":"https://api.github.com/repos/doctrine/dbal/pulls/2336/comments","review_comment_url":"https://api.github.com/repos/doctrine/dbal/pulls/comments{/number}","comments_url":"https://api.github.com/repos/doctrine/dbal/issues/2336/comments","statuses_url":"https://api.github.com/repos/doctrine/dbal/statuses/0c011b373d53f0f77e04f2c3d9a254e09e32a497","head":{"label":"kix:friendlier-type-exception","ref":"friendlier-type-exception","sha":"0c011b373d53f0f77e04f2c3d9a254e09e32a497","user":{"login":"kix","id":345754,"avatar_url":"https://avatars.githubusercontent.com/u/345754?v=3","gravatar_id":"","url":"https://api.github.com/users/kix","html_url":"https://github.com/kix","followers_url":"https://api.github.com/users/kix/followers","following_url":"https://api.github.com/users/kix/following{/other_user}","gists_url":"https://api.github.com/users/kix/gists{/gist_id}","starred_url":"https://api.github.com/users/kix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kix/subscriptions","organizations_url":"https://api.github.com/users/kix/orgs","repos_url":"https://api.github.com/users/kix/repos","events_url":"https://api.github.com/users/kix/events{/privacy}","received_events_url":"https://api.github.com/users/kix/received_events","type":"User","site_admin":false},"repo":{"id":54068038,"name":"dbal","full_name":"kix/dbal","owner":{"login":"kix","id":345754,"avatar_url":"https://avatars.githubusercontent.com/u/345754?v=3","gravatar_id":"","url":"https://api.github.com/users/kix","html_url":"https://github.com/kix","followers_url":"https://api.github.com/users/kix/followers","following_url":"https://api.github.com/users/kix/following{/other_user}","gists_url":"https://api.github.com/users/kix/gists{/gist_id}","starred_url":"https://api.github.com/users/kix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kix/subscriptions","organizations_url":"https://api.github.com/users/kix/orgs","repos_url":"https://api.github.com/users/kix/repos","events_url":"https://api.github.com/users/kix/events{/privacy}","received_events_url":"https://api.github.com/users/kix/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kix/dbal","description":"Doctrine Database Abstraction Layer","fork":true,"url":"https://api.github.com/repos/kix/dbal","forks_url":"https://api.github.com/repos/kix/dbal/forks","keys_url":"https://api.github.com/repos/kix/dbal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kix/dbal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kix/dbal/teams","hooks_url":"https://api.github.com/repos/kix/dbal/hooks","issue_events_url":"https://api.github.com/repos/kix/dbal/issues/events{/number}","events_url":"https://api.github.com/repos/kix/dbal/events","assignees_url":"https://api.github.com/repos/kix/dbal/assignees{/user}","branches_url":"https://api.github.com/repos/kix/dbal/branches{/branch}","tags_url":"https://api.github.com/repos/kix/dbal/tags","blobs_url":"https://api.github.com/repos/kix/dbal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kix/dbal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kix/dbal/git/refs{/sha}","trees_url":"https://api.github.com/repos/kix/dbal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kix/dbal/statuses/{sha}","languages_url":"https://api.github.com/repos/kix/dbal/languages","stargazers_url":"https://api.github.com/repos/kix/dbal/stargazers","contributors_url":"https://api.github.com/repos/kix/dbal/contributors","subscribers_url":"https://api.github.com/repos/kix/dbal/subscribers","subscription_url":"https://api.github.com/repos/kix/dbal/subscription","commits_url":"https://api.github.com/repos/kix/dbal/commits{/sha}","git_commits_url":"https://api.github.com/repos/kix/dbal/git/commits{/sha}","comments_url":"https://api.github.com/repos/kix/dbal/comments{/number}","issue_comment_url":"https://api.github.com/repos/kix/dbal/issues/comments{/number}","contents_url":"https://api.github.com/repos/kix/dbal/contents/{+path}","compare_url":"https://api.github.com/repos/kix/dbal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kix/dbal/merges","archive_url":"https://api.github.com/repos/kix/dbal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kix/dbal/downloads","issues_url":"https://api.github.com/repos/kix/dbal/issues{/number}","pulls_url":"https://api.github.com/repos/kix/dbal/pulls{/number}","milestones_url":"https://api.github.com/repos/kix/dbal/milestones{/number}","notifications_url":"https://api.github.com/repos/kix/dbal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kix/dbal/labels{/name}","releases_url":"https://api.github.com/repos/kix/dbal/releases{/id}","deployments_url":"https://api.github.com/repos/kix/dbal/deployments","created_at":"2016-03-16T21:32:52Z","updated_at":"2016-03-16T21:32:54Z","pushed_at":"2016-03-16T21:44:58Z","git_url":"git://github.com/kix/dbal.git","ssh_url":"git@github.com:kix/dbal.git","clone_url":"https://github.com/kix/dbal.git","svn_url":"https://github.com/kix/dbal","homepage":"http://www.doctrine-project.org/projects/dbal","size":21454,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"doctrine:master","ref":"master","sha":"61e1f860a304c3fb6961ecbec36927b5f20b71c6","user":{"login":"doctrine","id":209254,"avatar_url":"https://avatars.githubusercontent.com/u/209254?v=3","gravatar_id":"","url":"https://api.github.com/users/doctrine","html_url":"https://github.com/doctrine","followers_url":"https://api.github.com/users/doctrine/followers","following_url":"https://api.github.com/users/doctrine/following{/other_user}","gists_url":"https://api.github.com/users/doctrine/gists{/gist_id}","starred_url":"https://api.github.com/users/doctrine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doctrine/subscriptions","organizations_url":"https://api.github.com/users/doctrine/orgs","repos_url":"https://api.github.com/users/doctrine/repos","events_url":"https://api.github.com/users/doctrine/events{/privacy}","received_events_url":"https://api.github.com/users/doctrine/received_events","type":"Organization","site_admin":false},"repo":{"id":677464,"name":"dbal","full_name":"doctrine/dbal","owner":{"login":"doctrine","id":209254,"avatar_url":"https://avatars.githubusercontent.com/u/209254?v=3","gravatar_id":"","url":"https://api.github.com/users/doctrine","html_url":"https://github.com/doctrine","followers_url":"https://api.github.com/users/doctrine/followers","following_url":"https://api.github.com/users/doctrine/following{/other_user}","gists_url":"https://api.github.com/users/doctrine/gists{/gist_id}","starred_url":"https://api.github.com/users/doctrine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doctrine/subscriptions","organizations_url":"https://api.github.com/users/doctrine/orgs","repos_url":"https://api.github.com/users/doctrine/repos","events_url":"https://api.github.com/users/doctrine/events{/privacy}","received_events_url":"https://api.github.com/users/doctrine/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/doctrine/dbal","description":"Doctrine Database Abstraction Layer","fork":false,"url":"https://api.github.com/repos/doctrine/dbal","forks_url":"https://api.github.com/repos/doctrine/dbal/forks","keys_url":"https://api.github.com/repos/doctrine/dbal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/doctrine/dbal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/doctrine/dbal/teams","hooks_url":"https://api.github.com/repos/doctrine/dbal/hooks","issue_events_url":"https://api.github.com/repos/doctrine/dbal/issues/events{/number}","events_url":"https://api.github.com/repos/doctrine/dbal/events","assignees_url":"https://api.github.com/repos/doctrine/dbal/assignees{/user}","branches_url":"https://api.github.com/repos/doctrine/dbal/branches{/branch}","tags_url":"https://api.github.com/repos/doctrine/dbal/tags","blobs_url":"https://api.github.com/repos/doctrine/dbal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/doctrine/dbal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/doctrine/dbal/git/refs{/sha}","trees_url":"https://api.github.com/repos/doctrine/dbal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/doctrine/dbal/statuses/{sha}","languages_url":"https://api.github.com/repos/doctrine/dbal/languages","stargazers_url":"https://api.github.com/repos/doctrine/dbal/stargazers","contributors_url":"https://api.github.com/repos/doctrine/dbal/contributors","subscribers_url":"https://api.github.com/repos/doctrine/dbal/subscribers","subscription_url":"https://api.github.com/repos/doctrine/dbal/subscription","commits_url":"https://api.github.com/repos/doctrine/dbal/commits{/sha}","git_commits_url":"https://api.github.com/repos/doctrine/dbal/git/commits{/sha}","comments_url":"https://api.github.com/repos/doctrine/dbal/comments{/number}","issue_comment_url":"https://api.github.com/repos/doctrine/dbal/issues/comments{/number}","contents_url":"https://api.github.com/repos/doctrine/dbal/contents/{+path}","compare_url":"https://api.github.com/repos/doctrine/dbal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/doctrine/dbal/merges","archive_url":"https://api.github.com/repos/doctrine/dbal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/doctrine/dbal/downloads","issues_url":"https://api.github.com/repos/doctrine/dbal/issues{/number}","pulls_url":"https://api.github.com/repos/doctrine/dbal/pulls{/number}","milestones_url":"https://api.github.com/repos/doctrine/dbal/milestones{/number}","notifications_url":"https://api.github.com/repos/doctrine/dbal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/doctrine/dbal/labels{/name}","releases_url":"https://api.github.com/repos/doctrine/dbal/releases{/id}","deployments_url":"https://api.github.com/repos/doctrine/dbal/deployments","created_at":"2010-05-20T17:01:42Z","updated_at":"2016-03-16T13:24:30Z","pushed_at":"2016-03-16T21:45:40Z","git_url":"git://github.com/doctrine/dbal.git","ssh_url":"git@github.com:doctrine/dbal.git","clone_url":"https://github.com/doctrine/dbal.git","svn_url":"https://github.com/doctrine/dbal","homepage":"http://www.doctrine-project.org/projects/dbal","size":23685,"stargazers_count":705,"watchers_count":705,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":607,"mirror_url":null,"open_issues_count":232,"forks":607,"open_issues":232,"watchers":705,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/doctrine/dbal/pulls/2336"},"html":{"href":"https://github.com/doctrine/dbal/pull/2336"},"issue":{"href":"https://api.github.com/repos/doctrine/dbal/issues/2336"},"comments":{"href":"https://api.github.com/repos/doctrine/dbal/issues/2336/comments"},"review_comments":{"href":"https://api.github.com/repos/doctrine/dbal/pulls/2336/comments"},"review_comment":{"href":"https://api.github.com/repos/doctrine/dbal/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/doctrine/dbal/pulls/2336/commits"},"statuses":{"href":"https://api.github.com/repos/doctrine/dbal/statuses/0c011b373d53f0f77e04f2c3d9a254e09e32a497"}}}}