{"action":"created","comment":{"url":"https://api.github.com/repos/symfony/symfony/pulls/comments/229114805","pull_request_review_id":169537500,"id":229114805,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyOTExNDgwNQ==","diff_hunk":"@@ -0,0 +1,57 @@\n+<?php\n+\n+/*\n+ * This file is part of the Symfony package.\n+ *\n+ * (c) Fabien Potencier <fabien@symfony.com>\n+ *\n+ * For the full copyright and license information, please view the LICENSE\n+ * file that was distributed with this source code.\n+ */\n+\n+namespace Symfony\\Component\\Messenger\\Transport\\Doctrine;\n+\n+use Symfony\\Bridge\\Doctrine\\RegistryInterface;\n+use Symfony\\Component\\Messenger\\Transport\\Serialization\\Serializer;\n+use Symfony\\Component\\Messenger\\Transport\\Serialization\\SerializerInterface;\n+use Symfony\\Component\\Messenger\\Transport\\TransportFactoryInterface;\n+use Symfony\\Component\\Messenger\\Transport\\TransportInterface;\n+\n+/**\n+ * @author Vincent Touzet <vincent.touzet@gmail.com>\n+ */\n+class DoctrineTransportFactory implements TransportFactoryInterface\n+{\n+    private $registry;\n+    private $serializer;\n+    private $debug;\n+\n+    public function __construct(RegistryInterface $registry, SerializerInterface $serializer = null, $debug = false)\n+    {\n+        $this->registry = $registry;\n+        $this->serializer = $serializer ?? Serializer::create();\n+        $this->debug = $debug;\n+    }\n+\n+    public function createTransport(string $dsn, array $options): TransportInterface\n+    {\n+        $manager = str_replace('doctrine://', '', $dsn);\n+\n+        try {\n+            $connection = new Connection($options['table_name'] ?? 'messenger_messages', $this->registry->getConnection($manager), $this->debug);\n+        } catch (\\InvalidArgumentException $e) {\n+            throw new \\RuntimeException(\n+                sprintf('Unable to create Doctrine transport for Messenger (dsn \"%s\"): %s', $dsn, $e->getMessage()),\n+                0,\n+                $e\n+            );","path":"src/Symfony/Component/Messenger/Transport/Doctrine/DoctrineTransportFactory.php","position":47,"original_position":47,"commit_id":"4023eaa5fd947cee696f979c44c6b720e1c9dfbd","original_commit_id":"4023eaa5fd947cee696f979c44c6b720e1c9dfbd","user":{"login":"yceruto","id":2028198,"node_id":"MDQ6VXNlcjIwMjgxOTg=","avatar_url":"https://avatars0.githubusercontent.com/u/2028198?v=4","gravatar_id":"","url":"https://api.github.com/users/yceruto","html_url":"https://github.com/yceruto","followers_url":"https://api.github.com/users/yceruto/followers","following_url":"https://api.github.com/users/yceruto/following{/other_user}","gists_url":"https://api.github.com/users/yceruto/gists{/gist_id}","starred_url":"https://api.github.com/users/yceruto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yceruto/subscriptions","organizations_url":"https://api.github.com/users/yceruto/orgs","repos_url":"https://api.github.com/users/yceruto/repos","events_url":"https://api.github.com/users/yceruto/events{/privacy}","received_events_url":"https://api.github.com/users/yceruto/received_events","type":"User","site_admin":false},"body":"According to Code Standard should be in one line.","created_at":"2018-10-29T22:00:36Z","updated_at":"2018-10-29T22:00:36Z","html_url":"https://github.com/symfony/symfony/pull/29007#discussion_r229114805","pull_request_url":"https://api.github.com/repos/symfony/symfony/pulls/29007","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments/229114805"},"html":{"href":"https://github.com/symfony/symfony/pull/29007#discussion_r229114805"},"pull_request":{"href":"https://api.github.com/repos/symfony/symfony/pulls/29007"}}},"pull_request":{"url":"https://api.github.com/repos/symfony/symfony/pulls/29007","id":226382644,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI2MzgyNjQ0","html_url":"https://github.com/symfony/symfony/pull/29007","diff_url":"https://github.com/symfony/symfony/pull/29007.diff","patch_url":"https://github.com/symfony/symfony/pull/29007.patch","issue_url":"https://api.github.com/repos/symfony/symfony/issues/29007","number":29007,"state":"open","locked":false,"title":"WIP: [Messenger] Add a Doctrine transport","user":{"login":"vincenttouzet","id":2057992,"node_id":"MDQ6VXNlcjIwNTc5OTI=","avatar_url":"https://avatars3.githubusercontent.com/u/2057992?v=4","gravatar_id":"","url":"https://api.github.com/users/vincenttouzet","html_url":"https://github.com/vincenttouzet","followers_url":"https://api.github.com/users/vincenttouzet/followers","following_url":"https://api.github.com/users/vincenttouzet/following{/other_user}","gists_url":"https://api.github.com/users/vincenttouzet/gists{/gist_id}","starred_url":"https://api.github.com/users/vincenttouzet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vincenttouzet/subscriptions","organizations_url":"https://api.github.com/users/vincenttouzet/orgs","repos_url":"https://api.github.com/users/vincenttouzet/repos","events_url":"https://api.github.com/users/vincenttouzet/events{/privacy}","received_events_url":"https://api.github.com/users/vincenttouzet/received_events","type":"User","site_admin":false},"body":"| Q             | A\r\n| ------------- | ---\r\n| Branch?       | master\r\n| Bug fix?      | no\r\n| New feature?  | yes\r\n| BC breaks?    | no     \r\n| Deprecations? | no \r\n| Tests pass?   | yes    \r\n| Fixed tickets | \r\n| License       | MIT\r\n| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->\r\n| DoctrineBundle PR | doctrine/DoctrineBundle#868\r\n\r\nAs discussed with @sroze on PHPForum I've worked on adding a Doctrine transport to the Messenger component.\r\n\r\nActually `AMQP` is the only supported transport and it could be a good thing to support multiple transports. Having a Doctrine transport could help users to start using the component IMHO (Almost all projects use a database)\r\n\r\nThis PR clearly needs more work but I've submitted it for comments for now.\r\n\r\n\r\nTODO\r\n\r\n- [x] Add tests\r\n- [ ] Create DOC PR\r\n- [x] PR on doctrine-bundle for transport factory\r\n\r\nI am also considering to introduce a `SetupableTransportInterface` and a `SetupTransportsCommand` to avoid checking schema differencies at runtime. But it could be in a separated PR maybe ?\r\n","created_at":"2018-10-28T17:19:05Z","updated_at":"2018-10-29T22:00:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c9b7f306d7bb21f3f5da21bfcc19e2e5383854d3","assignee":null,"assignees":[],"requested_reviewers":[{"login":"sroze","id":804625,"node_id":"MDQ6VXNlcjgwNDYyNQ==","avatar_url":"https://avatars0.githubusercontent.com/u/804625?v=4","gravatar_id":"","url":"https://api.github.com/users/sroze","html_url":"https://github.com/sroze","followers_url":"https://api.github.com/users/sroze/followers","following_url":"https://api.github.com/users/sroze/following{/other_user}","gists_url":"https://api.github.com/users/sroze/gists{/gist_id}","starred_url":"https://api.github.com/users/sroze/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sroze/subscriptions","organizations_url":"https://api.github.com/users/sroze/orgs","repos_url":"https://api.github.com/users/sroze/repos","events_url":"https://api.github.com/users/sroze/events{/privacy}","received_events_url":"https://api.github.com/users/sroze/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":100378,"node_id":"MDU6TGFiZWwxMDAzNzg=","url":"https://api.github.com/repos/symfony/symfony/labels/Feature","name":"Feature","color":"02e10c","default":false},{"id":877085690,"node_id":"MDU6TGFiZWw4NzcwODU2OTA=","url":"https://api.github.com/repos/symfony/symfony/labels/Messenger","name":"Messenger","color":"dddddd","default":false},{"id":237003792,"node_id":"MDU6TGFiZWwyMzcwMDM3OTI=","url":"https://api.github.com/repos/symfony/symfony/labels/Status:%20Needs%20Review","name":"Status: Needs Review","color":"ededed","default":false}],"milestone":{"url":"https://api.github.com/repos/symfony/symfony/milestones/18","html_url":"https://github.com/symfony/symfony/milestone/18","labels_url":"https://api.github.com/repos/symfony/symfony/milestones/18/labels","id":3234645,"node_id":"MDk6TWlsZXN0b25lMzIzNDY0NQ==","number":18,"title":"next","description":"https://symfony.com/roadmap?version=4.2#checker","creator":{"login":"nicolas-grekas","id":243674,"node_id":"MDQ6VXNlcjI0MzY3NA==","avatar_url":"https://avatars3.githubusercontent.com/u/243674?v=4","gravatar_id":"","url":"https://api.github.com/users/nicolas-grekas","html_url":"https://github.com/nicolas-grekas","followers_url":"https://api.github.com/users/nicolas-grekas/followers","following_url":"https://api.github.com/users/nicolas-grekas/following{/other_user}","gists_url":"https://api.github.com/users/nicolas-grekas/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolas-grekas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolas-grekas/subscriptions","organizations_url":"https://api.github.com/users/nicolas-grekas/orgs","repos_url":"https://api.github.com/users/nicolas-grekas/repos","events_url":"https://api.github.com/users/nicolas-grekas/events{/privacy}","received_events_url":"https://api.github.com/users/nicolas-grekas/received_events","type":"User","site_admin":false},"open_issues":146,"closed_issues":343,"state":"open","created_at":"2018-04-02T12:03:21Z","updated_at":"2018-10-29T15:57:44Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/symfony/symfony/pulls/29007/commits","review_comments_url":"https://api.github.com/repos/symfony/symfony/pulls/29007/comments","review_comment_url":"https://api.github.com/repos/symfony/symfony/pulls/comments{/number}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/29007/comments","statuses_url":"https://api.github.com/repos/symfony/symfony/statuses/4023eaa5fd947cee696f979c44c6b720e1c9dfbd","head":{"label":"vincenttouzet:messenger-doctrine-transport","ref":"messenger-doctrine-transport","sha":"4023eaa5fd947cee696f979c44c6b720e1c9dfbd","user":{"login":"vincenttouzet","id":2057992,"node_id":"MDQ6VXNlcjIwNTc5OTI=","avatar_url":"https://avatars3.githubusercontent.com/u/2057992?v=4","gravatar_id":"","url":"https://api.github.com/users/vincenttouzet","html_url":"https://github.com/vincenttouzet","followers_url":"https://api.github.com/users/vincenttouzet/followers","following_url":"https://api.github.com/users/vincenttouzet/following{/other_user}","gists_url":"https://api.github.com/users/vincenttouzet/gists{/gist_id}","starred_url":"https://api.github.com/users/vincenttouzet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vincenttouzet/subscriptions","organizations_url":"https://api.github.com/users/vincenttouzet/orgs","repos_url":"https://api.github.com/users/vincenttouzet/repos","events_url":"https://api.github.com/users/vincenttouzet/events{/privacy}","received_events_url":"https://api.github.com/users/vincenttouzet/received_events","type":"User","site_admin":false},"repo":{"id":152115567,"node_id":"MDEwOlJlcG9zaXRvcnkxNTIxMTU1Njc=","name":"symfony","full_name":"vincenttouzet/symfony","private":false,"owner":{"login":"vincenttouzet","id":2057992,"node_id":"MDQ6VXNlcjIwNTc5OTI=","avatar_url":"https://avatars3.githubusercontent.com/u/2057992?v=4","gravatar_id":"","url":"https://api.github.com/users/vincenttouzet","html_url":"https://github.com/vincenttouzet","followers_url":"https://api.github.com/users/vincenttouzet/followers","following_url":"https://api.github.com/users/vincenttouzet/following{/other_user}","gists_url":"https://api.github.com/users/vincenttouzet/gists{/gist_id}","starred_url":"https://api.github.com/users/vincenttouzet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vincenttouzet/subscriptions","organizations_url":"https://api.github.com/users/vincenttouzet/orgs","repos_url":"https://api.github.com/users/vincenttouzet/repos","events_url":"https://api.github.com/users/vincenttouzet/events{/privacy}","received_events_url":"https://api.github.com/users/vincenttouzet/received_events","type":"User","site_admin":false},"html_url":"https://github.com/vincenttouzet/symfony","description":"The Symfony PHP framework","fork":true,"url":"https://api.github.com/repos/vincenttouzet/symfony","forks_url":"https://api.github.com/repos/vincenttouzet/symfony/forks","keys_url":"https://api.github.com/repos/vincenttouzet/symfony/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vincenttouzet/symfony/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vincenttouzet/symfony/teams","hooks_url":"https://api.github.com/repos/vincenttouzet/symfony/hooks","issue_events_url":"https://api.github.com/repos/vincenttouzet/symfony/issues/events{/number}","events_url":"https://api.github.com/repos/vincenttouzet/symfony/events","assignees_url":"https://api.github.com/repos/vincenttouzet/symfony/assignees{/user}","branches_url":"https://api.github.com/repos/vincenttouzet/symfony/branches{/branch}","tags_url":"https://api.github.com/repos/vincenttouzet/symfony/tags","blobs_url":"https://api.github.com/repos/vincenttouzet/symfony/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vincenttouzet/symfony/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vincenttouzet/symfony/git/refs{/sha}","trees_url":"https://api.github.com/repos/vincenttouzet/symfony/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vincenttouzet/symfony/statuses/{sha}","languages_url":"https://api.github.com/repos/vincenttouzet/symfony/languages","stargazers_url":"https://api.github.com/repos/vincenttouzet/symfony/stargazers","contributors_url":"https://api.github.com/repos/vincenttouzet/symfony/contributors","subscribers_url":"https://api.github.com/repos/vincenttouzet/symfony/subscribers","subscription_url":"https://api.github.com/repos/vincenttouzet/symfony/subscription","commits_url":"https://api.github.com/repos/vincenttouzet/symfony/commits{/sha}","git_commits_url":"https://api.github.com/repos/vincenttouzet/symfony/git/commits{/sha}","comments_url":"https://api.github.com/repos/vincenttouzet/symfony/comments{/number}","issue_comment_url":"https://api.github.com/repos/vincenttouzet/symfony/issues/comments{/number}","contents_url":"https://api.github.com/repos/vincenttouzet/symfony/contents/{+path}","compare_url":"https://api.github.com/repos/vincenttouzet/symfony/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vincenttouzet/symfony/merges","archive_url":"https://api.github.com/repos/vincenttouzet/symfony/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vincenttouzet/symfony/downloads","issues_url":"https://api.github.com/repos/vincenttouzet/symfony/issues{/number}","pulls_url":"https://api.github.com/repos/vincenttouzet/symfony/pulls{/number}","milestones_url":"https://api.github.com/repos/vincenttouzet/symfony/milestones{/number}","notifications_url":"https://api.github.com/repos/vincenttouzet/symfony/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vincenttouzet/symfony/labels{/name}","releases_url":"https://api.github.com/repos/vincenttouzet/symfony/releases{/id}","deployments_url":"https://api.github.com/repos/vincenttouzet/symfony/deployments","created_at":"2018-10-08T16:59:27Z","updated_at":"2018-10-08T16:59:48Z","pushed_at":"2018-10-29T21:44:47Z","git_url":"git://github.com/vincenttouzet/symfony.git","ssh_url":"git@github.com:vincenttouzet/symfony.git","clone_url":"https://github.com/vincenttouzet/symfony.git","svn_url":"https://github.com/vincenttouzet/symfony","homepage":"https://symfony.com","size":121994,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"symfony:master","ref":"master","sha":"c2e55ff3f4260d3dd00e1617b685ee4b00362d1f","user":{"login":"symfony","id":143937,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MzkzNw==","avatar_url":"https://avatars3.githubusercontent.com/u/143937?v=4","gravatar_id":"","url":"https://api.github.com/users/symfony","html_url":"https://github.com/symfony","followers_url":"https://api.github.com/users/symfony/followers","following_url":"https://api.github.com/users/symfony/following{/other_user}","gists_url":"https://api.github.com/users/symfony/gists{/gist_id}","starred_url":"https://api.github.com/users/symfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symfony/subscriptions","organizations_url":"https://api.github.com/users/symfony/orgs","repos_url":"https://api.github.com/users/symfony/repos","events_url":"https://api.github.com/users/symfony/events{/privacy}","received_events_url":"https://api.github.com/users/symfony/received_events","type":"Organization","site_admin":false},"repo":{"id":458058,"node_id":"MDEwOlJlcG9zaXRvcnk0NTgwNTg=","name":"symfony","full_name":"symfony/symfony","private":false,"owner":{"login":"symfony","id":143937,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MzkzNw==","avatar_url":"https://avatars3.githubusercontent.com/u/143937?v=4","gravatar_id":"","url":"https://api.github.com/users/symfony","html_url":"https://github.com/symfony","followers_url":"https://api.github.com/users/symfony/followers","following_url":"https://api.github.com/users/symfony/following{/other_user}","gists_url":"https://api.github.com/users/symfony/gists{/gist_id}","starred_url":"https://api.github.com/users/symfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symfony/subscriptions","organizations_url":"https://api.github.com/users/symfony/orgs","repos_url":"https://api.github.com/users/symfony/repos","events_url":"https://api.github.com/users/symfony/events{/privacy}","received_events_url":"https://api.github.com/users/symfony/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/symfony/symfony","description":"The Symfony PHP framework","fork":false,"url":"https://api.github.com/repos/symfony/symfony","forks_url":"https://api.github.com/repos/symfony/symfony/forks","keys_url":"https://api.github.com/repos/symfony/symfony/keys{/key_id}","collaborators_url":"https://api.github.com/repos/symfony/symfony/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/symfony/symfony/teams","hooks_url":"https://api.github.com/repos/symfony/symfony/hooks","issue_events_url":"https://api.github.com/repos/symfony/symfony/issues/events{/number}","events_url":"https://api.github.com/repos/symfony/symfony/events","assignees_url":"https://api.github.com/repos/symfony/symfony/assignees{/user}","branches_url":"https://api.github.com/repos/symfony/symfony/branches{/branch}","tags_url":"https://api.github.com/repos/symfony/symfony/tags","blobs_url":"https://api.github.com/repos/symfony/symfony/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/symfony/symfony/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/symfony/symfony/git/refs{/sha}","trees_url":"https://api.github.com/repos/symfony/symfony/git/trees{/sha}","statuses_url":"https://api.github.com/repos/symfony/symfony/statuses/{sha}","languages_url":"https://api.github.com/repos/symfony/symfony/languages","stargazers_url":"https://api.github.com/repos/symfony/symfony/stargazers","contributors_url":"https://api.github.com/repos/symfony/symfony/contributors","subscribers_url":"https://api.github.com/repos/symfony/symfony/subscribers","subscription_url":"https://api.github.com/repos/symfony/symfony/subscription","commits_url":"https://api.github.com/repos/symfony/symfony/commits{/sha}","git_commits_url":"https://api.github.com/repos/symfony/symfony/git/commits{/sha}","comments_url":"https://api.github.com/repos/symfony/symfony/comments{/number}","issue_comment_url":"https://api.github.com/repos/symfony/symfony/issues/comments{/number}","contents_url":"https://api.github.com/repos/symfony/symfony/contents/{+path}","compare_url":"https://api.github.com/repos/symfony/symfony/compare/{base}...{head}","merges_url":"https://api.github.com/repos/symfony/symfony/merges","archive_url":"https://api.github.com/repos/symfony/symfony/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/symfony/symfony/downloads","issues_url":"https://api.github.com/repos/symfony/symfony/issues{/number}","pulls_url":"https://api.github.com/repos/symfony/symfony/pulls{/number}","milestones_url":"https://api.github.com/repos/symfony/symfony/milestones{/number}","notifications_url":"https://api.github.com/repos/symfony/symfony/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/symfony/symfony/labels{/name}","releases_url":"https://api.github.com/repos/symfony/symfony/releases{/id}","deployments_url":"https://api.github.com/repos/symfony/symfony/deployments","created_at":"2010-01-04T14:21:21Z","updated_at":"2018-10-29T17:21:59Z","pushed_at":"2018-10-29T21:44:50Z","git_url":"git://github.com/symfony/symfony.git","ssh_url":"git@github.com:symfony/symfony.git","clone_url":"https://github.com/symfony/symfony.git","svn_url":"https://github.com/symfony/symfony","homepage":"https://symfony.com","size":127424,"stargazers_count":18895,"watchers_count":18895,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":6479,"mirror_url":null,"archived":false,"open_issues_count":819,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":6479,"open_issues":819,"watchers":18895,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/29007"},"html":{"href":"https://github.com/symfony/symfony/pull/29007"},"issue":{"href":"https://api.github.com/repos/symfony/symfony/issues/29007"},"comments":{"href":"https://api.github.com/repos/symfony/symfony/issues/29007/comments"},"review_comments":{"href":"https://api.github.com/repos/symfony/symfony/pulls/29007/comments"},"review_comment":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/symfony/symfony/pulls/29007/commits"},"statuses":{"href":"https://api.github.com/repos/symfony/symfony/statuses/4023eaa5fd947cee696f979c44c6b720e1c9dfbd"}},"author_association":"NONE"}}
{"actor":{"display_login":"yceruto"}}