{"action":"created","comment":{"url":"https://api.github.com/repos/doctrine/dbal/pulls/comments/40394081","id":40394081,"diff_hunk":"@@ -0,0 +1,94 @@\n+<?php\n+/*\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ *\n+ * This software consists of voluntary contributions made by many individuals\n+ * and is licensed under the MIT license. For more information, see\n+ * <http://www.doctrine-project.org>.\n+ */\n+\n+namespace Doctrine\\DBAL\\Types;\n+\n+use Doctrine\\DBAL\\Platforms\\AbstractPlatform;\n+\n+/**\n+ * Type generating json objects values\n+ *\n+ * @since  2.6\n+ * @author Baptiste Clavié <clavie.b@gmail.com>\n+ */\n+class JsonType extends Type\n+{\n+    /**\n+     * {@inheritdoc}\n+     */\n+    public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)\n+    {\n+        return $platform->getJsonTypeDeclarationSQL($fieldDeclaration);\n+    }\n+\n+    /**\n+     * {@inheritdoc}\n+     */\n+    public function convertToDatabaseValue($value, AbstractPlatform $platform)\n+    {\n+        if (null === $value) {\n+            return null;\n+        }\n+\n+        return json_encode($value);","path":"lib/Doctrine/DBAL/Types/JsonType.php","position":49,"original_position":49,"commit_id":"54f73b5f60d2e994abc2c3361acb2328276cd249","original_commit_id":"54f73b5f60d2e994abc2c3361acb2328276cd249","user":{"login":"zeroedin-bill","id":4266849,"avatar_url":"https://avatars.githubusercontent.com/u/4266849?v=3","gravatar_id":"","url":"https://api.github.com/users/zeroedin-bill","html_url":"https://github.com/zeroedin-bill","followers_url":"https://api.github.com/users/zeroedin-bill/followers","following_url":"https://api.github.com/users/zeroedin-bill/following{/other_user}","gists_url":"https://api.github.com/users/zeroedin-bill/gists{/gist_id}","starred_url":"https://api.github.com/users/zeroedin-bill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zeroedin-bill/subscriptions","organizations_url":"https://api.github.com/users/zeroedin-bill/orgs","repos_url":"https://api.github.com/users/zeroedin-bill/repos","events_url":"https://api.github.com/users/zeroedin-bill/events{/privacy}","received_events_url":"https://api.github.com/users/zeroedin-bill/received_events","type":"User","site_admin":false},"body":"No - the logic there is fine - ConversionException is missing a static constructor for this PHP->database scenario - there should probably be a ConversionException::serializationFailed method or something like that.","created_at":"2015-09-25T01:58:49Z","updated_at":"2015-09-25T01:58:49Z","html_url":"https://github.com/doctrine/dbal/pull/892#discussion_r40394081","pull_request_url":"https://api.github.com/repos/doctrine/dbal/pulls/892","_links":{"self":{"href":"https://api.github.com/repos/doctrine/dbal/pulls/comments/40394081"},"html":{"href":"https://github.com/doctrine/dbal/pull/892#discussion_r40394081"},"pull_request":{"href":"https://api.github.com/repos/doctrine/dbal/pulls/892"}}},"pull_request":{"url":"https://api.github.com/repos/doctrine/dbal/pulls/892","id":41560125,"html_url":"https://github.com/doctrine/dbal/pull/892","diff_url":"https://github.com/doctrine/dbal/pull/892.diff","patch_url":"https://github.com/doctrine/dbal/pull/892.patch","issue_url":"https://api.github.com/repos/doctrine/dbal/issues/892","number":892,"state":"open","locked":false,"title":"Json unflawed Type (DDC-3863)","user":{"login":"Taluu","id":239685,"avatar_url":"https://avatars.githubusercontent.com/u/239685?v=3","gravatar_id":"","url":"https://api.github.com/users/Taluu","html_url":"https://github.com/Taluu","followers_url":"https://api.github.com/users/Taluu/followers","following_url":"https://api.github.com/users/Taluu/following{/other_user}","gists_url":"https://api.github.com/users/Taluu/gists{/gist_id}","starred_url":"https://api.github.com/users/Taluu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Taluu/subscriptions","organizations_url":"https://api.github.com/users/Taluu/orgs","repos_url":"https://api.github.com/users/Taluu/repos","events_url":"https://api.github.com/users/Taluu/events{/privacy}","received_events_url":"https://api.github.com/users/Taluu/received_events","type":"User","site_admin":false},"body":"As discussed in #891, the `JsonArrayType` was deprecated in favor of a new `JsonType`. :}","created_at":"2015-08-04T11:36:10Z","updated_at":"2015-09-25T01:58:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"41a504011f665669c658fc7144c19405bd8096bd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/doctrine/dbal/pulls/892/commits","review_comments_url":"https://api.github.com/repos/doctrine/dbal/pulls/892/comments","review_comment_url":"https://api.github.com/repos/doctrine/dbal/pulls/comments{/number}","comments_url":"https://api.github.com/repos/doctrine/dbal/issues/892/comments","statuses_url":"https://api.github.com/repos/doctrine/dbal/statuses/54f73b5f60d2e994abc2c3361acb2328276cd249","head":{"label":"Taluu:json-unflawed","ref":"json-unflawed","sha":"54f73b5f60d2e994abc2c3361acb2328276cd249","user":{"login":"Taluu","id":239685,"avatar_url":"https://avatars.githubusercontent.com/u/239685?v=3","gravatar_id":"","url":"https://api.github.com/users/Taluu","html_url":"https://github.com/Taluu","followers_url":"https://api.github.com/users/Taluu/followers","following_url":"https://api.github.com/users/Taluu/following{/other_user}","gists_url":"https://api.github.com/users/Taluu/gists{/gist_id}","starred_url":"https://api.github.com/users/Taluu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Taluu/subscriptions","organizations_url":"https://api.github.com/users/Taluu/orgs","repos_url":"https://api.github.com/users/Taluu/repos","events_url":"https://api.github.com/users/Taluu/events{/privacy}","received_events_url":"https://api.github.com/users/Taluu/received_events","type":"User","site_admin":false},"repo":{"id":40127870,"name":"doctrine-dbal","full_name":"Taluu/doctrine-dbal","owner":{"login":"Taluu","id":239685,"avatar_url":"https://avatars.githubusercontent.com/u/239685?v=3","gravatar_id":"","url":"https://api.github.com/users/Taluu","html_url":"https://github.com/Taluu","followers_url":"https://api.github.com/users/Taluu/followers","following_url":"https://api.github.com/users/Taluu/following{/other_user}","gists_url":"https://api.github.com/users/Taluu/gists{/gist_id}","starred_url":"https://api.github.com/users/Taluu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Taluu/subscriptions","organizations_url":"https://api.github.com/users/Taluu/orgs","repos_url":"https://api.github.com/users/Taluu/repos","events_url":"https://api.github.com/users/Taluu/events{/privacy}","received_events_url":"https://api.github.com/users/Taluu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Taluu/doctrine-dbal","description":"Doctrine Database Abstraction Layer","fork":true,"url":"https://api.github.com/repos/Taluu/doctrine-dbal","forks_url":"https://api.github.com/repos/Taluu/doctrine-dbal/forks","keys_url":"https://api.github.com/repos/Taluu/doctrine-dbal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Taluu/doctrine-dbal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Taluu/doctrine-dbal/teams","hooks_url":"https://api.github.com/repos/Taluu/doctrine-dbal/hooks","issue_events_url":"https://api.github.com/repos/Taluu/doctrine-dbal/issues/events{/number}","events_url":"https://api.github.com/repos/Taluu/doctrine-dbal/events","assignees_url":"https://api.github.com/repos/Taluu/doctrine-dbal/assignees{/user}","branches_url":"https://api.github.com/repos/Taluu/doctrine-dbal/branches{/branch}","tags_url":"https://api.github.com/repos/Taluu/doctrine-dbal/tags","blobs_url":"https://api.github.com/repos/Taluu/doctrine-dbal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Taluu/doctrine-dbal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Taluu/doctrine-dbal/git/refs{/sha}","trees_url":"https://api.github.com/repos/Taluu/doctrine-dbal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Taluu/doctrine-dbal/statuses/{sha}","languages_url":"https://api.github.com/repos/Taluu/doctrine-dbal/languages","stargazers_url":"https://api.github.com/repos/Taluu/doctrine-dbal/stargazers","contributors_url":"https://api.github.com/repos/Taluu/doctrine-dbal/contributors","subscribers_url":"https://api.github.com/repos/Taluu/doctrine-dbal/subscribers","subscription_url":"https://api.github.com/repos/Taluu/doctrine-dbal/subscription","commits_url":"https://api.github.com/repos/Taluu/doctrine-dbal/commits{/sha}","git_commits_url":"https://api.github.com/repos/Taluu/doctrine-dbal/git/commits{/sha}","comments_url":"https://api.github.com/repos/Taluu/doctrine-dbal/comments{/number}","issue_comment_url":"https://api.github.com/repos/Taluu/doctrine-dbal/issues/comments{/number}","contents_url":"https://api.github.com/repos/Taluu/doctrine-dbal/contents/{+path}","compare_url":"https://api.github.com/repos/Taluu/doctrine-dbal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Taluu/doctrine-dbal/merges","archive_url":"https://api.github.com/repos/Taluu/doctrine-dbal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Taluu/doctrine-dbal/downloads","issues_url":"https://api.github.com/repos/Taluu/doctrine-dbal/issues{/number}","pulls_url":"https://api.github.com/repos/Taluu/doctrine-dbal/pulls{/number}","milestones_url":"https://api.github.com/repos/Taluu/doctrine-dbal/milestones{/number}","notifications_url":"https://api.github.com/repos/Taluu/doctrine-dbal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Taluu/doctrine-dbal/labels{/name}","releases_url":"https://api.github.com/repos/Taluu/doctrine-dbal/releases{/id}","created_at":"2015-08-03T14:01:39Z","updated_at":"2015-08-03T14:02:03Z","pushed_at":"2015-08-05T15:06:17Z","git_url":"git://github.com/Taluu/doctrine-dbal.git","ssh_url":"git@github.com:Taluu/doctrine-dbal.git","clone_url":"https://github.com/Taluu/doctrine-dbal.git","svn_url":"https://github.com/Taluu/doctrine-dbal","homepage":"http://www.doctrine-project.org/projects/dbal","size":21100,"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":"cc2d50385efa1ea87f5d0afa2c47cc2499914f81","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}","created_at":"2010-05-20T17:01:42Z","updated_at":"2015-09-24T14:26:07Z","pushed_at":"2015-09-22T10:24:34Z","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":31051,"stargazers_count":657,"watchers_count":657,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":562,"mirror_url":null,"open_issues_count":60,"forks":562,"open_issues":60,"watchers":657,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/doctrine/dbal/pulls/892"},"html":{"href":"https://github.com/doctrine/dbal/pull/892"},"issue":{"href":"https://api.github.com/repos/doctrine/dbal/issues/892"},"comments":{"href":"https://api.github.com/repos/doctrine/dbal/issues/892/comments"},"review_comments":{"href":"https://api.github.com/repos/doctrine/dbal/pulls/892/comments"},"review_comment":{"href":"https://api.github.com/repos/doctrine/dbal/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/doctrine/dbal/pulls/892/commits"},"statuses":{"href":"https://api.github.com/repos/doctrine/dbal/statuses/54f73b5f60d2e994abc2c3361acb2328276cd249"}}}}