{"action":"created","comment":{"url":"https://api.github.com/repos/symfony/symfony/pulls/comments/200203958","pull_request_review_id":134473704,"id":200203958,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMDIwMzk1OA==","diff_hunk":"@@ -296,6 +296,11 @@ private function registerBusMiddleware(ContainerBuilder $container, string $busI\n                 $childDefinition = new ChildDefinition($messengerMiddlewareId);\n                 $count = \\count($definition->getArguments());\n                 foreach (array_values($arguments ?? array()) as $key => $argument) {\n+                    // Convert argument to references if needed.\n+                    if (is_string($argument) && '@' === $argument[0]) {\n+                        $argument = new Reference(substr($argument, 1));","path":"src/Symfony/Component/Messenger/DependencyInjection/MessengerPass.php","position":6,"original_position":6,"commit_id":"a212caf5f91139c33539ef557cf31a8cf3cf7b97","original_commit_id":"a212caf5f91139c33539ef557cf31a8cf3cf7b97","user":{"login":"ogizanagi","id":2211145,"node_id":"MDQ6VXNlcjIyMTExNDU=","avatar_url":"https://avatars0.githubusercontent.com/u/2211145?v=4","gravatar_id":"","url":"https://api.github.com/users/ogizanagi","html_url":"https://github.com/ogizanagi","followers_url":"https://api.github.com/users/ogizanagi/followers","following_url":"https://api.github.com/users/ogizanagi/following{/other_user}","gists_url":"https://api.github.com/users/ogizanagi/gists{/gist_id}","starred_url":"https://api.github.com/users/ogizanagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ogizanagi/subscriptions","organizations_url":"https://api.github.com/users/ogizanagi/orgs","repos_url":"https://api.github.com/users/ogizanagi/repos","events_url":"https://api.github.com/users/ogizanagi/events{/privacy}","received_events_url":"https://api.github.com/users/ogizanagi/received_events","type":"User","site_admin":false},"body":"The idea of factories weren't to replace DI config when more suitable, only to solve most simple needs for configurable middlewares. Therefore, I don't think we should add services references support.\r\nIf really desired, we could indeed use dedicated service locators or perhaps let the user wiring it itself by creating the middleware service using DI config for now.","created_at":"2018-07-04T21:44:07Z","updated_at":"2018-07-04T21:44:07Z","html_url":"https://github.com/symfony/symfony/pull/27844#discussion_r200203958","pull_request_url":"https://api.github.com/repos/symfony/symfony/pulls/27844","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments/200203958"},"html":{"href":"https://github.com/symfony/symfony/pull/27844#discussion_r200203958"},"pull_request":{"href":"https://api.github.com/repos/symfony/symfony/pulls/27844"}},"in_reply_to_id":200139915},"pull_request":{"url":"https://api.github.com/repos/symfony/symfony/pulls/27844","id":199254993,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5MjU0OTkz","html_url":"https://github.com/symfony/symfony/pull/27844","diff_url":"https://github.com/symfony/symfony/pull/27844.diff","patch_url":"https://github.com/symfony/symfony/pull/27844.patch","issue_url":"https://api.github.com/repos/symfony/symfony/issues/27844","number":27844,"state":"open","locked":false,"title":"[Messenger] Adding support for record messages","user":{"login":"Nyholm","id":1275206,"node_id":"MDQ6VXNlcjEyNzUyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/1275206?v=4","gravatar_id":"","url":"https://api.github.com/users/Nyholm","html_url":"https://github.com/Nyholm","followers_url":"https://api.github.com/users/Nyholm/followers","following_url":"https://api.github.com/users/Nyholm/following{/other_user}","gists_url":"https://api.github.com/users/Nyholm/gists{/gist_id}","starred_url":"https://api.github.com/users/Nyholm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nyholm/subscriptions","organizations_url":"https://api.github.com/users/Nyholm/orgs","repos_url":"https://api.github.com/users/Nyholm/repos","events_url":"https://api.github.com/users/Nyholm/events{/privacy}","received_events_url":"https://api.github.com/users/Nyholm/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        | https://github.com/symfony/symfony-docs/pull/10015\r\n\r\nWith inspiration from [this blog post](https://matthiasnoback.nl/2015/01/collecting-events-and-the-events-aware-command-bus/), I created a message recorder. This is needed when you handle messages in the same doctrine transaction. Ie, you have a `Command` and the `CommandHandler` dispatches `Events`. Those events should be handled in a new doctrine transaction. \r\n\r\n### Scenario\r\n\r\nIf the command handler creates a User with uuid X and dispatches `UserCreated` event. If they are handled in the same transaction then this code will find nothing: \r\n\r\n```php\r\n$this->em->getRepository(User::class)->findOneBy(['uuid'=>X]);\r\n```\r\n\r\n---------\r\n\r\nExample configuration:\r\n\r\n```yaml\r\n\r\nframework:\r\n    messenger:\r\n        default_bus: messenger.bus.command\r\n        buses:\r\n            messenger.bus.command:\r\n                middleware:\r\n                    # Make sure recorded events are handled by the event bus. You may also configure the message recorder with a second parameter. \r\n                    - messenger.middleware.handles_recorded_messages: ['@messenger.bus.event']\r\n                    - doctrine_transaction_middleware: ['default']\r\n        # -- more buses\r\n```","created_at":"2018-07-04T13:46:54Z","updated_at":"2018-07-04T21:44:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dc38ca180daa0dde6f03327e77cf3918fd25c218","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":150,"closed_issues":93,"state":"open","created_at":"2018-04-02T12:03:21Z","updated_at":"2018-07-04T15:33:52Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/symfony/symfony/pulls/27844/commits","review_comments_url":"https://api.github.com/repos/symfony/symfony/pulls/27844/comments","review_comment_url":"https://api.github.com/repos/symfony/symfony/pulls/comments{/number}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/27844/comments","statuses_url":"https://api.github.com/repos/symfony/symfony/statuses/a212caf5f91139c33539ef557cf31a8cf3cf7b97","head":{"label":"Nyholm:record-messages","ref":"record-messages","sha":"a212caf5f91139c33539ef557cf31a8cf3cf7b97","user":{"login":"Nyholm","id":1275206,"node_id":"MDQ6VXNlcjEyNzUyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/1275206?v=4","gravatar_id":"","url":"https://api.github.com/users/Nyholm","html_url":"https://github.com/Nyholm","followers_url":"https://api.github.com/users/Nyholm/followers","following_url":"https://api.github.com/users/Nyholm/following{/other_user}","gists_url":"https://api.github.com/users/Nyholm/gists{/gist_id}","starred_url":"https://api.github.com/users/Nyholm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nyholm/subscriptions","organizations_url":"https://api.github.com/users/Nyholm/orgs","repos_url":"https://api.github.com/users/Nyholm/repos","events_url":"https://api.github.com/users/Nyholm/events{/privacy}","received_events_url":"https://api.github.com/users/Nyholm/received_events","type":"User","site_admin":false},"repo":{"id":21617818,"node_id":"MDEwOlJlcG9zaXRvcnkyMTYxNzgxOA==","name":"symfony","full_name":"Nyholm/symfony","owner":{"login":"Nyholm","id":1275206,"node_id":"MDQ6VXNlcjEyNzUyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/1275206?v=4","gravatar_id":"","url":"https://api.github.com/users/Nyholm","html_url":"https://github.com/Nyholm","followers_url":"https://api.github.com/users/Nyholm/followers","following_url":"https://api.github.com/users/Nyholm/following{/other_user}","gists_url":"https://api.github.com/users/Nyholm/gists{/gist_id}","starred_url":"https://api.github.com/users/Nyholm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nyholm/subscriptions","organizations_url":"https://api.github.com/users/Nyholm/orgs","repos_url":"https://api.github.com/users/Nyholm/repos","events_url":"https://api.github.com/users/Nyholm/events{/privacy}","received_events_url":"https://api.github.com/users/Nyholm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Nyholm/symfony","description":"The Symfony PHP framework","fork":true,"url":"https://api.github.com/repos/Nyholm/symfony","forks_url":"https://api.github.com/repos/Nyholm/symfony/forks","keys_url":"https://api.github.com/repos/Nyholm/symfony/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Nyholm/symfony/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Nyholm/symfony/teams","hooks_url":"https://api.github.com/repos/Nyholm/symfony/hooks","issue_events_url":"https://api.github.com/repos/Nyholm/symfony/issues/events{/number}","events_url":"https://api.github.com/repos/Nyholm/symfony/events","assignees_url":"https://api.github.com/repos/Nyholm/symfony/assignees{/user}","branches_url":"https://api.github.com/repos/Nyholm/symfony/branches{/branch}","tags_url":"https://api.github.com/repos/Nyholm/symfony/tags","blobs_url":"https://api.github.com/repos/Nyholm/symfony/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Nyholm/symfony/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Nyholm/symfony/git/refs{/sha}","trees_url":"https://api.github.com/repos/Nyholm/symfony/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Nyholm/symfony/statuses/{sha}","languages_url":"https://api.github.com/repos/Nyholm/symfony/languages","stargazers_url":"https://api.github.com/repos/Nyholm/symfony/stargazers","contributors_url":"https://api.github.com/repos/Nyholm/symfony/contributors","subscribers_url":"https://api.github.com/repos/Nyholm/symfony/subscribers","subscription_url":"https://api.github.com/repos/Nyholm/symfony/subscription","commits_url":"https://api.github.com/repos/Nyholm/symfony/commits{/sha}","git_commits_url":"https://api.github.com/repos/Nyholm/symfony/git/commits{/sha}","comments_url":"https://api.github.com/repos/Nyholm/symfony/comments{/number}","issue_comment_url":"https://api.github.com/repos/Nyholm/symfony/issues/comments{/number}","contents_url":"https://api.github.com/repos/Nyholm/symfony/contents/{+path}","compare_url":"https://api.github.com/repos/Nyholm/symfony/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Nyholm/symfony/merges","archive_url":"https://api.github.com/repos/Nyholm/symfony/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Nyholm/symfony/downloads","issues_url":"https://api.github.com/repos/Nyholm/symfony/issues{/number}","pulls_url":"https://api.github.com/repos/Nyholm/symfony/pulls{/number}","milestones_url":"https://api.github.com/repos/Nyholm/symfony/milestones{/number}","notifications_url":"https://api.github.com/repos/Nyholm/symfony/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Nyholm/symfony/labels{/name}","releases_url":"https://api.github.com/repos/Nyholm/symfony/releases{/id}","deployments_url":"https://api.github.com/repos/Nyholm/symfony/deployments","created_at":"2014-07-08T15:18:43Z","updated_at":"2016-04-20T10:33:36Z","pushed_at":"2018-07-04T13:49:30Z","git_url":"git://github.com/Nyholm/symfony.git","ssh_url":"git@github.com:Nyholm/symfony.git","clone_url":"https://github.com/Nyholm/symfony.git","svn_url":"https://github.com/Nyholm/symfony","homepage":"symfony.com","size":115598,"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":"04b2c2db4f64174b9aca74f3cb60c84e55172807","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","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},"private":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-07-04T16:39:15Z","pushed_at":"2018-07-04T21:35:57Z","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":120132,"stargazers_count":17984,"watchers_count":17984,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":6297,"mirror_url":null,"archived":false,"open_issues_count":885,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":6297,"open_issues":885,"watchers":17984,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/27844"},"html":{"href":"https://github.com/symfony/symfony/pull/27844"},"issue":{"href":"https://api.github.com/repos/symfony/symfony/issues/27844"},"comments":{"href":"https://api.github.com/repos/symfony/symfony/issues/27844/comments"},"review_comments":{"href":"https://api.github.com/repos/symfony/symfony/pulls/27844/comments"},"review_comment":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/symfony/symfony/pulls/27844/commits"},"statuses":{"href":"https://api.github.com/repos/symfony/symfony/statuses/a212caf5f91139c33539ef557cf31a8cf3cf7b97"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"ogizanagi"}}