{"action":"created","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/29340","repository_url":"https://api.github.com/repos/symfony/symfony","labels_url":"https://api.github.com/repos/symfony/symfony/issues/29340/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/29340/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/29340/events","html_url":"https://github.com/symfony/symfony/issues/29340","id":384503537,"node_id":"MDU6SXNzdWUzODQ1MDM1Mzc=","number":29340,"title":"[PropertyAccess] #28966 introduces subtle change in behaviour","user":{"login":"bendavies","id":625392,"node_id":"MDQ6VXNlcjYyNTM5Mg==","avatar_url":"https://avatars3.githubusercontent.com/u/625392?v=4","gravatar_id":"","url":"https://api.github.com/users/bendavies","html_url":"https://github.com/bendavies","followers_url":"https://api.github.com/users/bendavies/followers","following_url":"https://api.github.com/users/bendavies/following{/other_user}","gists_url":"https://api.github.com/users/bendavies/gists{/gist_id}","starred_url":"https://api.github.com/users/bendavies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bendavies/subscriptions","organizations_url":"https://api.github.com/users/bendavies/orgs","repos_url":"https://api.github.com/users/bendavies/repos","events_url":"https://api.github.com/users/bendavies/events{/privacy}","received_events_url":"https://api.github.com/users/bendavies/received_events","type":"User","site_admin":false},"labels":[{"id":231677,"node_id":"MDU6TGFiZWwyMzE2Nzc=","url":"https://api.github.com/repos/symfony/symfony/labels/BC%20Break","name":"BC Break","color":"e10c02","default":false},{"id":100079,"node_id":"MDU6TGFiZWwxMDAwNzk=","url":"https://api.github.com/repos/symfony/symfony/labels/Bug","name":"Bug","color":"e10c02","default":false},{"id":28502152,"node_id":"MDU6TGFiZWwyODUwMjE1Mg==","url":"https://api.github.com/repos/symfony/symfony/labels/PropertyAccess","name":"PropertyAccess","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}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-11-26T20:46:46Z","updated_at":"2018-11-27T10:29:51Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"**Symfony version(s) affected**: 4.1.18\r\n\r\n**Description**  \r\n#28966 fixing an issue where a model has 2 properties, the 2nd property name being the plural form of the first.\r\n\r\nThe fix introduced a change in behaviour when a model has a collection property, that has a setter **and** an adder+remover defined.\r\n\r\n```php\r\nclass Foo\r\n{\r\n    private $invoices = [];\r\n\r\n    public function setInvoices(array $invoices): void\r\n    {\r\n        //...\r\n    }\r\n\r\n    public function addInvoice(Invoice $invoice): void\r\n    {\r\n        //...\r\n    }\r\n\r\n    public function removeInvoice(Invoice $item): void\r\n    {\r\n        //...\r\n    }\r\n}\r\n```\r\n\r\nIf setting the invoices collection:\r\n - before #28966, the adder/remover is used over the setter.\r\n - after #28966, the setter is used over the added/remover.\r\n\r\nIt could be said that if your model is depending on an order here, your model probably has a bug.\r\nIn fact, the change of behaviour did indeed highlighted a bug in my model, so I'm grateful for that!\r\n\r\nRegardless, is this an intended, acceptable behaviour change for collection properties?\r\n"},"comment":{"url":"https://api.github.com/repos/symfony/symfony/issues/comments/442008295","html_url":"https://github.com/symfony/symfony/issues/29340#issuecomment-442008295","issue_url":"https://api.github.com/repos/symfony/symfony/issues/29340","id":442008295,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MjAwODI5NQ==","user":{"login":"karser","id":1675033,"node_id":"MDQ6VXNlcjE2NzUwMzM=","avatar_url":"https://avatars3.githubusercontent.com/u/1675033?v=4","gravatar_id":"","url":"https://api.github.com/users/karser","html_url":"https://github.com/karser","followers_url":"https://api.github.com/users/karser/followers","following_url":"https://api.github.com/users/karser/following{/other_user}","gists_url":"https://api.github.com/users/karser/gists{/gist_id}","starred_url":"https://api.github.com/users/karser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karser/subscriptions","organizations_url":"https://api.github.com/users/karser/orgs","repos_url":"https://api.github.com/users/karser/repos","events_url":"https://api.github.com/users/karser/events{/privacy}","received_events_url":"https://api.github.com/users/karser/received_events","type":"User","site_admin":false},"created_at":"2018-11-27T10:29:51Z","updated_at":"2018-11-27T10:29:51Z","author_association":"CONTRIBUTOR","body":"Ok, I'll try to reproduce this issue and see if it's just priority order issue."}}
{"actor":{"display_login":"karser"}}