{"action":"created","comment":{"url":"https://api.github.com/repos/zendframework/zend-code/pulls/comments/49121417","id":49121417,"diff_hunk":"@@ -0,0 +1,118 @@\n+# Upgrade\n+\n+All changes required for users to upgrade to newer versions of this library will be documented or referenced here.\n+\n+## 2.* -> 3.0.0\n+\n+### `string`, `int`, `float`, `bool` are no longer ignored\n+\n+In 2.x, a `Zend\\Code\\Generator\\ParameterGenerator` with name `foo` and type \n+`string`, `int`, `float` or `bool` simply generated code `\"$foo\"`:\n+\n+```php\n+$generator = new \\Zend\\Code\\ParameterGenerator('foo');\n+\n+$generator->setType('string');\n+\n+echo $generator->generate(); // \"$foo\"\n+```\n+\n+In 3.x, this code will instead produce `\"string $foo\"`.\n+If you generate code that should run in PHP 5.x, it is advisable to strip\n+`string`, `int`, `float` and `bool` from type definitions passed to\n+`Zend\\Code\\ParameterGenerator` instances.","path":"UPGRADE.md","position":23,"original_position":23,"commit_id":"ae152d00fe30d71023566f218125d67944b49430","original_commit_id":"ae152d00fe30d71023566f218125d67944b49430","user":{"login":"weierophinney","id":25943,"avatar_url":"https://avatars.githubusercontent.com/u/25943?v=3","gravatar_id":"","url":"https://api.github.com/users/weierophinney","html_url":"https://github.com/weierophinney","followers_url":"https://api.github.com/users/weierophinney/followers","following_url":"https://api.github.com/users/weierophinney/following{/other_user}","gists_url":"https://api.github.com/users/weierophinney/gists{/gist_id}","starred_url":"https://api.github.com/users/weierophinney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weierophinney/subscriptions","organizations_url":"https://api.github.com/users/weierophinney/orgs","repos_url":"https://api.github.com/users/weierophinney/repos","events_url":"https://api.github.com/users/weierophinney/events{/privacy}","received_events_url":"https://api.github.com/users/weierophinney/received_events","type":"User","site_admin":false},"body":"Can you indicate how one would do this, please?","created_at":"2016-01-07T20:25:52Z","updated_at":"2016-01-07T20:25:52Z","html_url":"https://github.com/zendframework/zend-code/pull/30#discussion_r49121417","pull_request_url":"https://api.github.com/repos/zendframework/zend-code/pulls/30","_links":{"self":{"href":"https://api.github.com/repos/zendframework/zend-code/pulls/comments/49121417"},"html":{"href":"https://github.com/zendframework/zend-code/pull/30#discussion_r49121417"},"pull_request":{"href":"https://api.github.com/repos/zendframework/zend-code/pulls/30"}}},"pull_request":{"url":"https://api.github.com/repos/zendframework/zend-code/pulls/30","id":54934898,"html_url":"https://github.com/zendframework/zend-code/pull/30","diff_url":"https://github.com/zendframework/zend-code/pull/30.diff","patch_url":"https://github.com/zendframework/zend-code/pull/30.patch","issue_url":"https://api.github.com/repos/zendframework/zend-code/issues/30","number":30,"state":"open","locked":false,"title":"[3.0] #29 - PHP7 compliance","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},"body":"This is a first draft that requires a look by @weierophinney.\r\n\r\nSee #29\r\n\r\n## Features\r\n\r\nThis patch introduces a few features that are very much required in order to use `Zend\\Code` in PHP7 (currently generates broken garbage, which is what forced me to write the patch in first place).\r\n\r\n * by-ref method return support (ported from ProxyManager)\r\n * variadic support\r\n * scalar type hint support (this required a BC break, documented below)\r\n * return type hint support\r\n\r\n## BC Breaks\r\n\r\nThis patch introduces a couple of BC Breaks:\r\n\r\n * `Zend\\Code\\Reflection\\ParameterReflection#getType()` required a rename, since it clashes with the newly introduced [`ReflectionParameter#getType()`](http://php.net/manual/en/reflectionparameter.gettype.php)\r\n * `Zend\\Code\\Generator\\ParameterGenerator#setType()` now expects users to pass in the type without prefixing it with `\\\\`\r\n * `Zend\\Code\\Generator\\ParameterGenerator#getType()` now returns the types without the prefixing `\\\\`\r\n * `Zend\\Code\\Generator\\ParameterGenerator#generate()` now generates types with a prefixing `\\\\` when a class is given: all classes should be provided via fully qualified class name. Passing in a name prefixed with `\\\\` is supported, but when asking for a type, a string without the prefixing `\\\\` will be retrieved.\r\n * `Zend\\Code\\Generator\\ParameterGenerator` now doesn't consider `int`, `string`, `float`, `bool` as special types, and doesn't omit them from generated signatures anymore. Note: while this is broken as heck, people may have relied on it, and the BC break is subtle, but required\r\n * `Zend\\Code\\Generator\\ParameterGenerator#$type` is now a `Zend\\Code\\Generator\\TypeGenerator` (stringable, but not a string)\r\n * `protected static Zend\\Code\\Generator\\ParameterGenerator::$simple` was dropped\r\n\r\n## TODO\r\n\r\n * [x] document BC breaks\r\n\r\n## Notes\r\n\r\nCommits are not to be squashed, as I'm detailing progress in each commit, especially around edge cases. ","created_at":"2016-01-03T23:32:19Z","updated_at":"2016-01-07T20:25:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a346aa308c42d1dd854a92129807f6adcb7b9509","assignee":{"login":"weierophinney","id":25943,"avatar_url":"https://avatars.githubusercontent.com/u/25943?v=3","gravatar_id":"","url":"https://api.github.com/users/weierophinney","html_url":"https://github.com/weierophinney","followers_url":"https://api.github.com/users/weierophinney/followers","following_url":"https://api.github.com/users/weierophinney/following{/other_user}","gists_url":"https://api.github.com/users/weierophinney/gists{/gist_id}","starred_url":"https://api.github.com/users/weierophinney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weierophinney/subscriptions","organizations_url":"https://api.github.com/users/weierophinney/orgs","repos_url":"https://api.github.com/users/weierophinney/repos","events_url":"https://api.github.com/users/weierophinney/events{/privacy}","received_events_url":"https://api.github.com/users/weierophinney/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/zendframework/zend-code/milestones/2","html_url":"https://github.com/zendframework/zend-code/milestones/3.0.0","labels_url":"https://api.github.com/repos/zendframework/zend-code/milestones/2/labels","id":1137629,"number":2,"title":"3.0.0","description":"next backward compatibility break release","creator":{"login":"Maks3w","id":1301698,"avatar_url":"https://avatars.githubusercontent.com/u/1301698?v=3","gravatar_id":"","url":"https://api.github.com/users/Maks3w","html_url":"https://github.com/Maks3w","followers_url":"https://api.github.com/users/Maks3w/followers","following_url":"https://api.github.com/users/Maks3w/following{/other_user}","gists_url":"https://api.github.com/users/Maks3w/gists{/gist_id}","starred_url":"https://api.github.com/users/Maks3w/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Maks3w/subscriptions","organizations_url":"https://api.github.com/users/Maks3w/orgs","repos_url":"https://api.github.com/users/Maks3w/repos","events_url":"https://api.github.com/users/Maks3w/events{/privacy}","received_events_url":"https://api.github.com/users/Maks3w/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":0,"state":"open","created_at":"2015-05-28T09:27:53Z","updated_at":"2016-01-03T23:32:19Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/zendframework/zend-code/pulls/30/commits","review_comments_url":"https://api.github.com/repos/zendframework/zend-code/pulls/30/comments","review_comment_url":"https://api.github.com/repos/zendframework/zend-code/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zendframework/zend-code/issues/30/comments","statuses_url":"https://api.github.com/repos/zendframework/zend-code/statuses/ae152d00fe30d71023566f218125d67944b49430","head":{"label":"Ocramius:feature/php7-compliance","ref":"feature/php7-compliance","sha":"ae152d00fe30d71023566f218125d67944b49430","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},"repo":{"id":39473019,"name":"zend-code","full_name":"Ocramius/zend-code","owner":{"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},"private":false,"html_url":"https://github.com/Ocramius/zend-code","description":"","fork":true,"url":"https://api.github.com/repos/Ocramius/zend-code","forks_url":"https://api.github.com/repos/Ocramius/zend-code/forks","keys_url":"https://api.github.com/repos/Ocramius/zend-code/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ocramius/zend-code/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ocramius/zend-code/teams","hooks_url":"https://api.github.com/repos/Ocramius/zend-code/hooks","issue_events_url":"https://api.github.com/repos/Ocramius/zend-code/issues/events{/number}","events_url":"https://api.github.com/repos/Ocramius/zend-code/events","assignees_url":"https://api.github.com/repos/Ocramius/zend-code/assignees{/user}","branches_url":"https://api.github.com/repos/Ocramius/zend-code/branches{/branch}","tags_url":"https://api.github.com/repos/Ocramius/zend-code/tags","blobs_url":"https://api.github.com/repos/Ocramius/zend-code/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ocramius/zend-code/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ocramius/zend-code/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ocramius/zend-code/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ocramius/zend-code/statuses/{sha}","languages_url":"https://api.github.com/repos/Ocramius/zend-code/languages","stargazers_url":"https://api.github.com/repos/Ocramius/zend-code/stargazers","contributors_url":"https://api.github.com/repos/Ocramius/zend-code/contributors","subscribers_url":"https://api.github.com/repos/Ocramius/zend-code/subscribers","subscription_url":"https://api.github.com/repos/Ocramius/zend-code/subscription","commits_url":"https://api.github.com/repos/Ocramius/zend-code/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ocramius/zend-code/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ocramius/zend-code/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ocramius/zend-code/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ocramius/zend-code/contents/{+path}","compare_url":"https://api.github.com/repos/Ocramius/zend-code/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ocramius/zend-code/merges","archive_url":"https://api.github.com/repos/Ocramius/zend-code/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ocramius/zend-code/downloads","issues_url":"https://api.github.com/repos/Ocramius/zend-code/issues{/number}","pulls_url":"https://api.github.com/repos/Ocramius/zend-code/pulls{/number}","milestones_url":"https://api.github.com/repos/Ocramius/zend-code/milestones{/number}","notifications_url":"https://api.github.com/repos/Ocramius/zend-code/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ocramius/zend-code/labels{/name}","releases_url":"https://api.github.com/repos/Ocramius/zend-code/releases{/id}","created_at":"2015-07-21T22:30:00Z","updated_at":"2015-11-05T15:50:21Z","pushed_at":"2016-01-05T07:19:28Z","git_url":"git://github.com/Ocramius/zend-code.git","ssh_url":"git@github.com:Ocramius/zend-code.git","clone_url":"https://github.com/Ocramius/zend-code.git","svn_url":"https://github.com/Ocramius/zend-code","homepage":null,"size":3277,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"master"}},"base":{"label":"zendframework:develop","ref":"develop","sha":"c2b6cfdbf960ee11dd7476f9ac65ca3687b1fd42","user":{"login":"zendframework","id":296074,"avatar_url":"https://avatars.githubusercontent.com/u/296074?v=3","gravatar_id":"","url":"https://api.github.com/users/zendframework","html_url":"https://github.com/zendframework","followers_url":"https://api.github.com/users/zendframework/followers","following_url":"https://api.github.com/users/zendframework/following{/other_user}","gists_url":"https://api.github.com/users/zendframework/gists{/gist_id}","starred_url":"https://api.github.com/users/zendframework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendframework/subscriptions","organizations_url":"https://api.github.com/users/zendframework/orgs","repos_url":"https://api.github.com/users/zendframework/repos","events_url":"https://api.github.com/users/zendframework/events{/privacy}","received_events_url":"https://api.github.com/users/zendframework/received_events","type":"Organization","site_admin":false},"repo":{"id":35617117,"name":"zend-code","full_name":"zendframework/zend-code","owner":{"login":"zendframework","id":296074,"avatar_url":"https://avatars.githubusercontent.com/u/296074?v=3","gravatar_id":"","url":"https://api.github.com/users/zendframework","html_url":"https://github.com/zendframework","followers_url":"https://api.github.com/users/zendframework/followers","following_url":"https://api.github.com/users/zendframework/following{/other_user}","gists_url":"https://api.github.com/users/zendframework/gists{/gist_id}","starred_url":"https://api.github.com/users/zendframework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendframework/subscriptions","organizations_url":"https://api.github.com/users/zendframework/orgs","repos_url":"https://api.github.com/users/zendframework/repos","events_url":"https://api.github.com/users/zendframework/events{/privacy}","received_events_url":"https://api.github.com/users/zendframework/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zendframework/zend-code","description":"","fork":false,"url":"https://api.github.com/repos/zendframework/zend-code","forks_url":"https://api.github.com/repos/zendframework/zend-code/forks","keys_url":"https://api.github.com/repos/zendframework/zend-code/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zendframework/zend-code/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zendframework/zend-code/teams","hooks_url":"https://api.github.com/repos/zendframework/zend-code/hooks","issue_events_url":"https://api.github.com/repos/zendframework/zend-code/issues/events{/number}","events_url":"https://api.github.com/repos/zendframework/zend-code/events","assignees_url":"https://api.github.com/repos/zendframework/zend-code/assignees{/user}","branches_url":"https://api.github.com/repos/zendframework/zend-code/branches{/branch}","tags_url":"https://api.github.com/repos/zendframework/zend-code/tags","blobs_url":"https://api.github.com/repos/zendframework/zend-code/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zendframework/zend-code/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zendframework/zend-code/git/refs{/sha}","trees_url":"https://api.github.com/repos/zendframework/zend-code/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zendframework/zend-code/statuses/{sha}","languages_url":"https://api.github.com/repos/zendframework/zend-code/languages","stargazers_url":"https://api.github.com/repos/zendframework/zend-code/stargazers","contributors_url":"https://api.github.com/repos/zendframework/zend-code/contributors","subscribers_url":"https://api.github.com/repos/zendframework/zend-code/subscribers","subscription_url":"https://api.github.com/repos/zendframework/zend-code/subscription","commits_url":"https://api.github.com/repos/zendframework/zend-code/commits{/sha}","git_commits_url":"https://api.github.com/repos/zendframework/zend-code/git/commits{/sha}","comments_url":"https://api.github.com/repos/zendframework/zend-code/comments{/number}","issue_comment_url":"https://api.github.com/repos/zendframework/zend-code/issues/comments{/number}","contents_url":"https://api.github.com/repos/zendframework/zend-code/contents/{+path}","compare_url":"https://api.github.com/repos/zendframework/zend-code/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zendframework/zend-code/merges","archive_url":"https://api.github.com/repos/zendframework/zend-code/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zendframework/zend-code/downloads","issues_url":"https://api.github.com/repos/zendframework/zend-code/issues{/number}","pulls_url":"https://api.github.com/repos/zendframework/zend-code/pulls{/number}","milestones_url":"https://api.github.com/repos/zendframework/zend-code/milestones{/number}","notifications_url":"https://api.github.com/repos/zendframework/zend-code/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zendframework/zend-code/labels{/name}","releases_url":"https://api.github.com/repos/zendframework/zend-code/releases{/id}","created_at":"2015-05-14T14:52:42Z","updated_at":"2015-12-28T23:43:46Z","pushed_at":"2016-01-05T07:19:32Z","git_url":"git://github.com/zendframework/zend-code.git","ssh_url":"git@github.com:zendframework/zend-code.git","clone_url":"https://github.com/zendframework/zend-code.git","svn_url":"https://github.com/zendframework/zend-code","homepage":null,"size":3328,"stargazers_count":17,"watchers_count":17,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":10,"forks":21,"open_issues":10,"watchers":17,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zendframework/zend-code/pulls/30"},"html":{"href":"https://github.com/zendframework/zend-code/pull/30"},"issue":{"href":"https://api.github.com/repos/zendframework/zend-code/issues/30"},"comments":{"href":"https://api.github.com/repos/zendframework/zend-code/issues/30/comments"},"review_comments":{"href":"https://api.github.com/repos/zendframework/zend-code/pulls/30/comments"},"review_comment":{"href":"https://api.github.com/repos/zendframework/zend-code/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zendframework/zend-code/pulls/30/commits"},"statuses":{"href":"https://api.github.com/repos/zendframework/zend-code/statuses/ae152d00fe30d71023566f218125d67944b49430"}}}}