{"action":"created","issue":{"url":"https://api.github.com/repos/doctrine/common/issues/759","repository_url":"https://api.github.com/repos/doctrine/common","labels_url":"https://api.github.com/repos/doctrine/common/issues/759/labels{/name}","comments_url":"https://api.github.com/repos/doctrine/common/issues/759/comments","events_url":"https://api.github.com/repos/doctrine/common/issues/759/events","html_url":"https://github.com/doctrine/common/issues/759","id":199620119,"number":759,"title":"Void return type on proxies fails","user":{"login":"Garbee","id":868301,"avatar_url":"https://avatars.githubusercontent.com/u/868301?v=3","gravatar_id":"","url":"https://api.github.com/users/Garbee","html_url":"https://github.com/Garbee","followers_url":"https://api.github.com/users/Garbee/followers","following_url":"https://api.github.com/users/Garbee/following{/other_user}","gists_url":"https://api.github.com/users/Garbee/gists{/gist_id}","starred_url":"https://api.github.com/users/Garbee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Garbee/subscriptions","organizations_url":"https://api.github.com/users/Garbee/orgs","repos_url":"https://api.github.com/users/Garbee/repos","events_url":"https://api.github.com/users/Garbee/events{/privacy}","received_events_url":"https://api.github.com/users/Garbee/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-01-09T18:02:33Z","updated_at":"2017-01-09T18:05:04Z","closed_at":null,"body":"If I setup a model that has a `: void` return type hint on a setter, this causes a failure with the generated proxy. As the void return type hint is added to the proxy, but the proxies always *return* the call to the main class.\r\n\r\nI recommend that if a void return type is present, `return` is not inserted into the generated proxy (to avoid these compile-time errors.) Or, if the proxies must return something for internal purposes, they detect the void return type and strip it from the proxy class.\r\n\r\n<details>\r\n<summary>Example class</summary>\r\n\r\n```php\r\n<?php\r\n\r\nclass Product\r\n{\r\n  private $name;\r\n\r\n  public function __construct(string $name)\r\n  {\r\n    $this->id = uuid4();\r\n    $this->name = $name;\r\n  }\r\n\r\n  public function getName() : string\r\n  {\r\n    return $this->name;\r\n  }\r\n\r\n  public function setName(string $name) : void\r\n  {\r\n    $this->name = $name;\r\n  }\r\n}\r\n```\r\n\r\n</details>"},"comment":{"url":"https://api.github.com/repos/doctrine/common/issues/comments/271358016","html_url":"https://github.com/doctrine/common/issues/759#issuecomment-271358016","issue_url":"https://api.github.com/repos/doctrine/common/issues/759","id":271358016,"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},"created_at":"2017-01-09T18:05:03Z","updated_at":"2017-01-09T18:05:03Z","body":"Please ensure that you have doctrine/common 2.7.*\n\nOn 9 Jan 2017 19:02, \"Jonathan Garbee\" <notifications@github.com> wrote:\n\n> If I setup a model that has a : void return type hint on a setter, this\n> causes a failure with the generated proxy. As the void return type hint is\n> added to the proxy, but the proxies always *return* the call to the main\n> class.\n>\n> I recommend that if a void return type is present, return is not inserted\n> into the generated proxy (to avoid these compile-time errors.) Or, if the\n> proxies must return something for internal purposes, they detect the void\n> return type and strip it from the proxy class.\n> Example class ```php class Product\n> {\n> private $name;\n>\n> public function __construct(string $name)\n> {\n> $this->id = uuid4();\n> $this->name = $name;\n> }\n>\n> public function getName() : string\n> {\n> return $this->name;\n> }\n>\n> public function setName(string $name) : void\n> {\n> $this->name = $name;\n> }\n> }\n>\n> </details>\n>\n> —\n> You are receiving this because you are subscribed to this thread.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/doctrine/common/issues/759>, or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/AAJakA_Y3Uf_7KaMCSz2XqRnbGIcPLh_ks5rQnY6gaJpZM4LejKX>\n> .\n>\n"}}
{"actor":{"display_login":"Ocramius"}}