{"action":"closed","number":4,"pull_request":{"url":"https://api.github.com/repos/badoo/soft-mocks/pulls/4","id":63181202,"html_url":"https://github.com/badoo/soft-mocks/pull/4","diff_url":"https://github.com/badoo/soft-mocks/pull/4.diff","patch_url":"https://github.com/badoo/soft-mocks/pull/4.patch","issue_url":"https://api.github.com/repos/badoo/soft-mocks/issues/4","number":4,"state":"closed","locked":false,"title":"fix parsing declare() without body. ex: \"declare(ticks=1);\"","user":{"login":"axxapy","id":3088476,"avatar_url":"https://avatars.githubusercontent.com/u/3088476?v=3","gravatar_id":"","url":"https://api.github.com/users/axxapy","html_url":"https://github.com/axxapy","followers_url":"https://api.github.com/users/axxapy/followers","following_url":"https://api.github.com/users/axxapy/following{/other_user}","gists_url":"https://api.github.com/users/axxapy/gists{/gist_id}","starred_url":"https://api.github.com/users/axxapy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axxapy/subscriptions","organizations_url":"https://api.github.com/users/axxapy/orgs","repos_url":"https://api.github.com/users/axxapy/repos","events_url":"https://api.github.com/users/axxapy/events{/privacy}","received_events_url":"https://api.github.com/users/axxapy/received_events","type":"User","site_admin":false},"body":"There is fatal when parsing declare() without body.\r\n```\r\ndiff --git a/example/common.php b/example/common.php\r\nindex 42b3c83..33e5ed7 100644\r\n--- a/example/common.php\r\n+++ b/example/common.php\r\n@@ -16,6 +16,7 @@ class Example {\r\n \r\n     public function doSmthDynamic()\r\n     {\r\n+        declare(ticks = 1);\r\n         return self::DYNAMIC_DO_SMTH_RESULT;\r\n     }\r\n }\r\n```\r\n```\r\n$ php example/run_me.php \r\nPHP Fatal error:  Uncaught TypeError: Argument 1 passed to QA\\SoftMocksPrinter::pStmts() must be of the type array, null given, called in /home/axp/work/php/soft-mocks/src/QA/SoftMocks.php on line 156 and defined in /home/axp/work/php/soft-mocks/src/QA/SoftMocks.php:45\r\nStack trace:\r\n#0 /home/axp/work/php/soft-mocks/src/QA/SoftMocks.php(156): QA\\SoftMocksPrinter->pStmts(NULL)\r\n#1 /home/axp/work/php/soft-mocks/src/QA/SoftMocks.php(94): QA\\SoftMocksPrinter->pStmt_Declare(Object(PhpParser\\Node\\Stmt\\Declare_))\r\n#2 /home/axp/work/php/soft-mocks/src/QA/SoftMocks.php(63): QA\\SoftMocksPrinter->p(Object(PhpParser\\Node\\Stmt\\Declare_))\r\n#3 /home/axp/work/php/soft-mocks/src/QA/SoftMocks.php(142): QA\\SoftMocksPrinter->pStmts(Array)\r\n#4 /home/axp/work/php/soft-mocks/src/QA/SoftMocks.php(94): QA\\SoftMocksPrinter->pStmt_ClassMethod(Object(PhpParser\\Node\\Stmt\\ClassMethod))\r\n#5 /home/axp/work/php/soft-mocks/src/QA/SoftMocks.php(63): QA\\SoftMocksPrinter->p(Object(PhpParser\\Node\\Stmt\\ClassMethod))\r\n#6 /home/axp/work/php/soft-mocks/src/QA/SoftMocks.php(30 in /home/axp/work/php/soft-mocks/src/QA/SoftMocks.php on line 45\r\n```","created_at":"2016-03-17T07:04:58Z","updated_at":"2016-04-12T09:51:51Z","closed_at":"2016-04-12T09:51:51Z","merged_at":null,"merge_commit_sha":"dca11840d1e8e5e2e4998cdb77f27c6dcfec46ef","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/badoo/soft-mocks/pulls/4/commits","review_comments_url":"https://api.github.com/repos/badoo/soft-mocks/pulls/4/comments","review_comment_url":"https://api.github.com/repos/badoo/soft-mocks/pulls/comments{/number}","comments_url":"https://api.github.com/repos/badoo/soft-mocks/issues/4/comments","statuses_url":"https://api.github.com/repos/badoo/soft-mocks/statuses/b98cca17ffbfb17e7d68ae9d7f5d3029ce1662b5","head":{"label":"axxapy:bug_declare_badoo_master","ref":"bug_declare_badoo_master","sha":"b98cca17ffbfb17e7d68ae9d7f5d3029ce1662b5","user":{"login":"axxapy","id":3088476,"avatar_url":"https://avatars.githubusercontent.com/u/3088476?v=3","gravatar_id":"","url":"https://api.github.com/users/axxapy","html_url":"https://github.com/axxapy","followers_url":"https://api.github.com/users/axxapy/followers","following_url":"https://api.github.com/users/axxapy/following{/other_user}","gists_url":"https://api.github.com/users/axxapy/gists{/gist_id}","starred_url":"https://api.github.com/users/axxapy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axxapy/subscriptions","organizations_url":"https://api.github.com/users/axxapy/orgs","repos_url":"https://api.github.com/users/axxapy/repos","events_url":"https://api.github.com/users/axxapy/events{/privacy}","received_events_url":"https://api.github.com/users/axxapy/received_events","type":"User","site_admin":false},"repo":{"id":53990167,"name":"soft-mocks","full_name":"axxapy/soft-mocks","owner":{"login":"axxapy","id":3088476,"avatar_url":"https://avatars.githubusercontent.com/u/3088476?v=3","gravatar_id":"","url":"https://api.github.com/users/axxapy","html_url":"https://github.com/axxapy","followers_url":"https://api.github.com/users/axxapy/followers","following_url":"https://api.github.com/users/axxapy/following{/other_user}","gists_url":"https://api.github.com/users/axxapy/gists{/gist_id}","starred_url":"https://api.github.com/users/axxapy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axxapy/subscriptions","organizations_url":"https://api.github.com/users/axxapy/orgs","repos_url":"https://api.github.com/users/axxapy/repos","events_url":"https://api.github.com/users/axxapy/events{/privacy}","received_events_url":"https://api.github.com/users/axxapy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/axxapy/soft-mocks","description":"PHP mocks engine that allows to redefine functions and user methods on-the-fly (provides similar functionality to runkit and uopz extensions)","fork":true,"url":"https://api.github.com/repos/axxapy/soft-mocks","forks_url":"https://api.github.com/repos/axxapy/soft-mocks/forks","keys_url":"https://api.github.com/repos/axxapy/soft-mocks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/axxapy/soft-mocks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/axxapy/soft-mocks/teams","hooks_url":"https://api.github.com/repos/axxapy/soft-mocks/hooks","issue_events_url":"https://api.github.com/repos/axxapy/soft-mocks/issues/events{/number}","events_url":"https://api.github.com/repos/axxapy/soft-mocks/events","assignees_url":"https://api.github.com/repos/axxapy/soft-mocks/assignees{/user}","branches_url":"https://api.github.com/repos/axxapy/soft-mocks/branches{/branch}","tags_url":"https://api.github.com/repos/axxapy/soft-mocks/tags","blobs_url":"https://api.github.com/repos/axxapy/soft-mocks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/axxapy/soft-mocks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/axxapy/soft-mocks/git/refs{/sha}","trees_url":"https://api.github.com/repos/axxapy/soft-mocks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/axxapy/soft-mocks/statuses/{sha}","languages_url":"https://api.github.com/repos/axxapy/soft-mocks/languages","stargazers_url":"https://api.github.com/repos/axxapy/soft-mocks/stargazers","contributors_url":"https://api.github.com/repos/axxapy/soft-mocks/contributors","subscribers_url":"https://api.github.com/repos/axxapy/soft-mocks/subscribers","subscription_url":"https://api.github.com/repos/axxapy/soft-mocks/subscription","commits_url":"https://api.github.com/repos/axxapy/soft-mocks/commits{/sha}","git_commits_url":"https://api.github.com/repos/axxapy/soft-mocks/git/commits{/sha}","comments_url":"https://api.github.com/repos/axxapy/soft-mocks/comments{/number}","issue_comment_url":"https://api.github.com/repos/axxapy/soft-mocks/issues/comments{/number}","contents_url":"https://api.github.com/repos/axxapy/soft-mocks/contents/{+path}","compare_url":"https://api.github.com/repos/axxapy/soft-mocks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/axxapy/soft-mocks/merges","archive_url":"https://api.github.com/repos/axxapy/soft-mocks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/axxapy/soft-mocks/downloads","issues_url":"https://api.github.com/repos/axxapy/soft-mocks/issues{/number}","pulls_url":"https://api.github.com/repos/axxapy/soft-mocks/pulls{/number}","milestones_url":"https://api.github.com/repos/axxapy/soft-mocks/milestones{/number}","notifications_url":"https://api.github.com/repos/axxapy/soft-mocks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/axxapy/soft-mocks/labels{/name}","releases_url":"https://api.github.com/repos/axxapy/soft-mocks/releases{/id}","deployments_url":"https://api.github.com/repos/axxapy/soft-mocks/deployments","created_at":"2016-03-16T01:12:16Z","updated_at":"2016-03-16T01:12:16Z","pushed_at":"2016-03-17T07:12:13Z","git_url":"git://github.com/axxapy/soft-mocks.git","ssh_url":"git@github.com:axxapy/soft-mocks.git","clone_url":"https://github.com/axxapy/soft-mocks.git","svn_url":"https://github.com/axxapy/soft-mocks","homepage":"","size":35,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"badoo:master","ref":"master","sha":"00c3c4ea439b5d80cf25bbfed431b7ac071d480d","user":{"login":"badoo","id":1277442,"avatar_url":"https://avatars.githubusercontent.com/u/1277442?v=3","gravatar_id":"","url":"https://api.github.com/users/badoo","html_url":"https://github.com/badoo","followers_url":"https://api.github.com/users/badoo/followers","following_url":"https://api.github.com/users/badoo/following{/other_user}","gists_url":"https://api.github.com/users/badoo/gists{/gist_id}","starred_url":"https://api.github.com/users/badoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/badoo/subscriptions","organizations_url":"https://api.github.com/users/badoo/orgs","repos_url":"https://api.github.com/users/badoo/repos","events_url":"https://api.github.com/users/badoo/events{/privacy}","received_events_url":"https://api.github.com/users/badoo/received_events","type":"Organization","site_admin":false},"repo":{"id":53654320,"name":"soft-mocks","full_name":"badoo/soft-mocks","owner":{"login":"badoo","id":1277442,"avatar_url":"https://avatars.githubusercontent.com/u/1277442?v=3","gravatar_id":"","url":"https://api.github.com/users/badoo","html_url":"https://github.com/badoo","followers_url":"https://api.github.com/users/badoo/followers","following_url":"https://api.github.com/users/badoo/following{/other_user}","gists_url":"https://api.github.com/users/badoo/gists{/gist_id}","starred_url":"https://api.github.com/users/badoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/badoo/subscriptions","organizations_url":"https://api.github.com/users/badoo/orgs","repos_url":"https://api.github.com/users/badoo/repos","events_url":"https://api.github.com/users/badoo/events{/privacy}","received_events_url":"https://api.github.com/users/badoo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/badoo/soft-mocks","description":"PHP mocks engine that allows to redefine functions and user methods on-the-fly (provides similar functionality to runkit and uopz extensions)","fork":false,"url":"https://api.github.com/repos/badoo/soft-mocks","forks_url":"https://api.github.com/repos/badoo/soft-mocks/forks","keys_url":"https://api.github.com/repos/badoo/soft-mocks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/badoo/soft-mocks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/badoo/soft-mocks/teams","hooks_url":"https://api.github.com/repos/badoo/soft-mocks/hooks","issue_events_url":"https://api.github.com/repos/badoo/soft-mocks/issues/events{/number}","events_url":"https://api.github.com/repos/badoo/soft-mocks/events","assignees_url":"https://api.github.com/repos/badoo/soft-mocks/assignees{/user}","branches_url":"https://api.github.com/repos/badoo/soft-mocks/branches{/branch}","tags_url":"https://api.github.com/repos/badoo/soft-mocks/tags","blobs_url":"https://api.github.com/repos/badoo/soft-mocks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/badoo/soft-mocks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/badoo/soft-mocks/git/refs{/sha}","trees_url":"https://api.github.com/repos/badoo/soft-mocks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/badoo/soft-mocks/statuses/{sha}","languages_url":"https://api.github.com/repos/badoo/soft-mocks/languages","stargazers_url":"https://api.github.com/repos/badoo/soft-mocks/stargazers","contributors_url":"https://api.github.com/repos/badoo/soft-mocks/contributors","subscribers_url":"https://api.github.com/repos/badoo/soft-mocks/subscribers","subscription_url":"https://api.github.com/repos/badoo/soft-mocks/subscription","commits_url":"https://api.github.com/repos/badoo/soft-mocks/commits{/sha}","git_commits_url":"https://api.github.com/repos/badoo/soft-mocks/git/commits{/sha}","comments_url":"https://api.github.com/repos/badoo/soft-mocks/comments{/number}","issue_comment_url":"https://api.github.com/repos/badoo/soft-mocks/issues/comments{/number}","contents_url":"https://api.github.com/repos/badoo/soft-mocks/contents/{+path}","compare_url":"https://api.github.com/repos/badoo/soft-mocks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/badoo/soft-mocks/merges","archive_url":"https://api.github.com/repos/badoo/soft-mocks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/badoo/soft-mocks/downloads","issues_url":"https://api.github.com/repos/badoo/soft-mocks/issues{/number}","pulls_url":"https://api.github.com/repos/badoo/soft-mocks/pulls{/number}","milestones_url":"https://api.github.com/repos/badoo/soft-mocks/milestones{/number}","notifications_url":"https://api.github.com/repos/badoo/soft-mocks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/badoo/soft-mocks/labels{/name}","releases_url":"https://api.github.com/repos/badoo/soft-mocks/releases{/id}","deployments_url":"https://api.github.com/repos/badoo/soft-mocks/deployments","created_at":"2016-03-11T09:08:38Z","updated_at":"2016-04-07T14:29:13Z","pushed_at":"2016-04-04T12:16:12Z","git_url":"git://github.com/badoo/soft-mocks.git","ssh_url":"git@github.com:badoo/soft-mocks.git","clone_url":"https://github.com/badoo/soft-mocks.git","svn_url":"https://github.com/badoo/soft-mocks","homepage":"","size":260,"stargazers_count":122,"watchers_count":122,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":4,"forks":12,"open_issues":4,"watchers":122,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/badoo/soft-mocks/pulls/4"},"html":{"href":"https://github.com/badoo/soft-mocks/pull/4"},"issue":{"href":"https://api.github.com/repos/badoo/soft-mocks/issues/4"},"comments":{"href":"https://api.github.com/repos/badoo/soft-mocks/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/badoo/soft-mocks/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/badoo/soft-mocks/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/badoo/soft-mocks/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/badoo/soft-mocks/statuses/b98cca17ffbfb17e7d68ae9d7f5d3029ce1662b5"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":5,"review_comments":0,"commits":1,"additions":5,"deletions":2,"changed_files":1}}