{"action":"opened","issue":{"url":"https://api.github.com/repos/nikic/PHP-Parser/issues/482","repository_url":"https://api.github.com/repos/nikic/PHP-Parser","labels_url":"https://api.github.com/repos/nikic/PHP-Parser/issues/482/labels{/name}","comments_url":"https://api.github.com/repos/nikic/PHP-Parser/issues/482/comments","events_url":"https://api.github.com/repos/nikic/PHP-Parser/issues/482/events","html_url":"https://github.com/nikic/PHP-Parser/issues/482","id":301413576,"number":482,"title":"Split method call","user":{"login":"vaceletm","id":216464,"avatar_url":"https://avatars0.githubusercontent.com/u/216464?v=4","gravatar_id":"","url":"https://api.github.com/users/vaceletm","html_url":"https://github.com/vaceletm","followers_url":"https://api.github.com/users/vaceletm/followers","following_url":"https://api.github.com/users/vaceletm/following{/other_user}","gists_url":"https://api.github.com/users/vaceletm/gists{/gist_id}","starred_url":"https://api.github.com/users/vaceletm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vaceletm/subscriptions","organizations_url":"https://api.github.com/users/vaceletm/orgs","repos_url":"https://api.github.com/users/vaceletm/repos","events_url":"https://api.github.com/users/vaceletm/events{/privacy}","received_events_url":"https://api.github.com/users/vaceletm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-01T13:58:20Z","updated_at":"2018-03-01T13:58:20Z","closed_at":null,"author_association":"NONE","body":"First of all thanks for PHP-Parser, it's awesome to have such tool available in php ecosystem.\r\n\r\nI try to use it for source to source transformation thanks to the now released 4.0 and the [preserve formatting feature]( My code is based on https://github.com/nikic/PHP-Parser/blob/master/doc/component/Pretty_printing.markdown#formatting-preserving-pretty-printing). I'm using it as a base and it works very well for Expression to Expression transformations but I'm facing an issue when I want to split a call.\r\n\r\n    $dao->expectOnce('addUserService', array(112, 'showService'));\r\n    $dao->setReturnValue('addUserService', true);\r\n\r\nThat I need to transform to\r\n\r\n    $mock = $dao->shouldReceive('addUserService');\r\n    $mock->withArgs(array(112, 'showService'));\r\n    $mock->once();\r\n    $mock->andReturns(true);\r\n\r\nI failed to find a way to introduce (or remove) statements in my AST during visit.\r\n\r\n(I hope this is the right place to ask questions)\r\n\r\n\r\n"}}
{"actor":{"display_login":"vaceletm"}}