{"action":"opened","issue":{"url":"https://api.github.com/repos/lisachenko/go-aop-php/issues/207","labels_url":"https://api.github.com/repos/lisachenko/go-aop-php/issues/207/labels{/name}","comments_url":"https://api.github.com/repos/lisachenko/go-aop-php/issues/207/comments","events_url":"https://api.github.com/repos/lisachenko/go-aop-php/issues/207/events","html_url":"https://github.com/lisachenko/go-aop-php/issues/207","id":59225051,"number":207,"title":"Generators result in fatal error","user":{"login":"TiGR","id":281226,"avatar_url":"https://avatars.githubusercontent.com/u/281226?v=3","gravatar_id":"","url":"https://api.github.com/users/TiGR","html_url":"https://github.com/TiGR","followers_url":"https://api.github.com/users/TiGR/followers","following_url":"https://api.github.com/users/TiGR/following{/other_user}","gists_url":"https://api.github.com/users/TiGR/gists{/gist_id}","starred_url":"https://api.github.com/users/TiGR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TiGR/subscriptions","organizations_url":"https://api.github.com/users/TiGR/orgs","repos_url":"https://api.github.com/users/TiGR/repos","events_url":"https://api.github.com/users/TiGR/events{/privacy}","received_events_url":"https://api.github.com/users/TiGR/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-27T11:34:51Z","updated_at":"2015-02-27T11:34:51Z","closed_at":null,"body":"Let's say you have two classes in separate files:\r\n\r\n```php\r\n<?php\r\nclass GeneratorTest extends GeneratorTestParent {}\r\n```\r\n\r\n```php\r\n<?php\r\n\r\nclass AOPTestParent {\r\n    protected function generator()\r\n    {\r\n        yield 'foo';\r\n    }\r\n}\r\n```\r\n\r\nThen, it is being internally converted to:\r\n\r\n```php\r\n<?php\r\n\r\nclass AOPTestParent {\r\n    protected function generator()\r\n    { if (($__am_res = __amock_before($this, __CLASS__, __FUNCTION__, array(), false)) !== __AM_CONTINUE__) return $__am_res; \r\n        yield 'foo';\r\n    }\r\n}\r\n```\r\n\r\nAnd any inclusion of AOPTest results in `PHP Fatal error:  Generators cannot return values using \"return\"`, since return was added to that method."}}