{"action":"created","comment":{"url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/pulls/comments/57237743","id":57237743,"diff_hunk":"@@ -53,8 +56,13 @@ public function __construct(\\Twig_Environment $twig, LoggerInterface $logger, ar\n         $this->twig = $twig;\n         $this->logger = $logger;\n         $this->visitors = $visitors;\n-        $lexer = new \\PHPParser_Lexer();\n-        $this->phpParser = new \\PHPParser_Parser($lexer);\n+        $lexer = new Lexer();\n+        if(class_exists('PhpParser\\ParserFactory')) {\n+            $factory = new ParserFactory();\n+            $this->phpParser = $factory->create(ParserFactory::PREFER_PHP7,$lexer);\n+        } else {\n+            $this->phpParser = new \\PHPParser_Parser($lexer);\n+        }\n ","path":"Translation/Extractor/FileExtractor.php","position":23,"original_position":23,"commit_id":"2c3208273183a57d96c95e30ec226b305b28c85f","original_commit_id":"2c3208273183a57d96c95e30ec226b305b28c85f","user":{"login":"Nyholm","id":1275206,"avatar_url":"https://avatars.githubusercontent.com/u/1275206?v=3","gravatar_id":"","url":"https://api.github.com/users/Nyholm","html_url":"https://github.com/Nyholm","followers_url":"https://api.github.com/users/Nyholm/followers","following_url":"https://api.github.com/users/Nyholm/following{/other_user}","gists_url":"https://api.github.com/users/Nyholm/gists{/gist_id}","starred_url":"https://api.github.com/users/Nyholm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nyholm/subscriptions","organizations_url":"https://api.github.com/users/Nyholm/orgs","repos_url":"https://api.github.com/users/Nyholm/repos","events_url":"https://api.github.com/users/Nyholm/events{/privacy}","received_events_url":"https://api.github.com/users/Nyholm/received_events","type":"User","site_admin":false},"body":"The seven lines above to create a parser is duplicated at least 4 times in this bundle. May I suggest to add a factory class with one static method that return a parser. \r\n\r\n'PhpParserFactory::create'\r\n","created_at":"2016-03-23T21:10:14Z","updated_at":"2016-03-23T21:10:14Z","html_url":"https://github.com/schmittjoh/JMSTranslationBundle/pull/314#discussion_r57237743","pull_request_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/pulls/314","_links":{"self":{"href":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/pulls/comments/57237743"},"html":{"href":"https://github.com/schmittjoh/JMSTranslationBundle/pull/314#discussion_r57237743"},"pull_request":{"href":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/pulls/314"}}},"pull_request":{"url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/pulls/314","id":63927160,"html_url":"https://github.com/schmittjoh/JMSTranslationBundle/pull/314","diff_url":"https://github.com/schmittjoh/JMSTranslationBundle/pull/314.diff","patch_url":"https://github.com/schmittjoh/JMSTranslationBundle/pull/314.patch","issue_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/issues/314","number":314,"state":"open","locked":false,"title":"update php-parser to either 1.4.1 or 2.x","user":{"login":"gnat42","id":325591,"avatar_url":"https://avatars.githubusercontent.com/u/325591?v=3","gravatar_id":"","url":"https://api.github.com/users/gnat42","html_url":"https://github.com/gnat42","followers_url":"https://api.github.com/users/gnat42/followers","following_url":"https://api.github.com/users/gnat42/following{/other_user}","gists_url":"https://api.github.com/users/gnat42/gists{/gist_id}","starred_url":"https://api.github.com/users/gnat42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gnat42/subscriptions","organizations_url":"https://api.github.com/users/gnat42/orgs","repos_url":"https://api.github.com/users/gnat42/repos","events_url":"https://api.github.com/users/gnat42/events{/privacy}","received_events_url":"https://api.github.com/users/gnat42/received_events","type":"User","site_admin":false},"body":"| Q             | A\r\n| ------------- | ---\r\n| Bug fix?      | yes\r\n| New feature?  | no\r\n| BC breaks?    | no\r\n| Deprecations? | no\r\n| Tests pass?   | yes\r\n| Fixed tickets | #290 \r\n| License       | MIT\r\n\r\n\r\n## Description\r\nThis updates composer.json to allow for php-parser 1.4.1 or 2.0. 2.0 requires php 5.4 and 1.4.1 can be used on php 5.3. We need to maintain both versions until we no longer support a symfony version running on php 5.3.\r\n\r\n## Todos\r\n- [ ] Tests\r\n- [ ] Documentation\r\n- [x] Changelog\r\n","created_at":"2016-03-23T18:05:54Z","updated_at":"2016-03-23T21:10:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e315838c9290988744815c1500df8b3695b1ad66","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/pulls/314/commits","review_comments_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/pulls/314/comments","review_comment_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/issues/314/comments","statuses_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/statuses/2c3208273183a57d96c95e30ec226b305b28c85f","head":{"label":"NobletSolutions:feature-nikicPhpParserVersion","ref":"feature-nikicPhpParserVersion","sha":"2c3208273183a57d96c95e30ec226b305b28c85f","user":{"login":"NobletSolutions","id":14066807,"avatar_url":"https://avatars.githubusercontent.com/u/14066807?v=3","gravatar_id":"","url":"https://api.github.com/users/NobletSolutions","html_url":"https://github.com/NobletSolutions","followers_url":"https://api.github.com/users/NobletSolutions/followers","following_url":"https://api.github.com/users/NobletSolutions/following{/other_user}","gists_url":"https://api.github.com/users/NobletSolutions/gists{/gist_id}","starred_url":"https://api.github.com/users/NobletSolutions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NobletSolutions/subscriptions","organizations_url":"https://api.github.com/users/NobletSolutions/orgs","repos_url":"https://api.github.com/users/NobletSolutions/repos","events_url":"https://api.github.com/users/NobletSolutions/events{/privacy}","received_events_url":"https://api.github.com/users/NobletSolutions/received_events","type":"Organization","site_admin":false},"repo":{"id":52039993,"name":"JMSTranslationBundle","full_name":"NobletSolutions/JMSTranslationBundle","owner":{"login":"NobletSolutions","id":14066807,"avatar_url":"https://avatars.githubusercontent.com/u/14066807?v=3","gravatar_id":"","url":"https://api.github.com/users/NobletSolutions","html_url":"https://github.com/NobletSolutions","followers_url":"https://api.github.com/users/NobletSolutions/followers","following_url":"https://api.github.com/users/NobletSolutions/following{/other_user}","gists_url":"https://api.github.com/users/NobletSolutions/gists{/gist_id}","starred_url":"https://api.github.com/users/NobletSolutions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NobletSolutions/subscriptions","organizations_url":"https://api.github.com/users/NobletSolutions/orgs","repos_url":"https://api.github.com/users/NobletSolutions/repos","events_url":"https://api.github.com/users/NobletSolutions/events{/privacy}","received_events_url":"https://api.github.com/users/NobletSolutions/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NobletSolutions/JMSTranslationBundle","description":"Puts the Symfony2 Translation Component on steroids","fork":true,"url":"https://api.github.com/repos/NobletSolutions/JMSTranslationBundle","forks_url":"https://api.github.com/repos/NobletSolutions/JMSTranslationBundle/forks","keys_url":"https://api.github.com/repos/NobletSolutions/JMSTranslationBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NobletSolutions/JMSTranslationBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NobletSolutions/JMSTranslationBundle/teams","hooks_url":"https://api.github.com/repos/NobletSolutions/JMSTranslationBundle/hooks","issue_events_url":"https://api.github.com/repos/NobletSolutions/JMSTranslationBundle/issues/events{/number}","events_url":"https://api.github.com/repos/NobletSolutions/JMSTranslationBundle/events","assignees_url":"https://api.github.com/repos/NobletSolutions/JMSTranslationBundle/assignees{/user}","branches_url":"https://api.github.com/repos/NobletSolutions/JMSTranslationBundle/branches{/branch}","tags_url":"https://api.github.com/repos/NobletSolutions/JMSTranslationBundle/tags","blobs_url":"https://api.github.com/repos/NobletSolutions/JMSTranslationBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NobletSolutions/JMSTranslationBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NobletSolutions/JMSTranslationBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/NobletSolutions/JMSTranslationBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NobletSolutions/JMSTranslationBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/NobletSolutions/JMSTranslationBundle/languages","stargazers_url":"https://api.github.com/repos/NobletSolutions/JMSTranslationBundle/stargazers","contributors_url":"https://api.github.com/repos/NobletSolutions/JMSTranslationBundle/contributors","subscribers_url":"https://api.github.com/repos/NobletSolutions/JMSTranslationBundle/subscribers","subscription_url":"https://api.github.com/repos/NobletSolutions/JMSTranslationBundle/subscription","commits_url":"https://api.github.com/repos/NobletSolutions/JMSTranslationBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/NobletSolutions/JMSTranslationBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/NobletSolutions/JMSTranslationBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/NobletSolutions/JMSTranslationBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/NobletSolutions/JMSTranslationBundle/contents/{+path}","compare_url":"https://api.github.com/repos/NobletSolutions/JMSTranslationBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NobletSolutions/JMSTranslationBundle/merges","archive_url":"https://api.github.com/repos/NobletSolutions/JMSTranslationBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NobletSolutions/JMSTranslationBundle/downloads","issues_url":"https://api.github.com/repos/NobletSolutions/JMSTranslationBundle/issues{/number}","pulls_url":"https://api.github.com/repos/NobletSolutions/JMSTranslationBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/NobletSolutions/JMSTranslationBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/NobletSolutions/JMSTranslationBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NobletSolutions/JMSTranslationBundle/labels{/name}","releases_url":"https://api.github.com/repos/NobletSolutions/JMSTranslationBundle/releases{/id}","deployments_url":"https://api.github.com/repos/NobletSolutions/JMSTranslationBundle/deployments","created_at":"2016-02-18T21:27:10Z","updated_at":"2016-03-08T00:08:13Z","pushed_at":"2016-03-23T20:25:14Z","git_url":"git://github.com/NobletSolutions/JMSTranslationBundle.git","ssh_url":"git@github.com:NobletSolutions/JMSTranslationBundle.git","clone_url":"https://github.com/NobletSolutions/JMSTranslationBundle.git","svn_url":"https://github.com/NobletSolutions/JMSTranslationBundle","homepage":"http://jmsyst.com/bundles/JMSTranslationBundle","size":634,"stargazers_count":2,"watchers_count":2,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":2,"default_branch":"master"}},"base":{"label":"schmittjoh:master","ref":"master","sha":"f09499f3f0e4d98313fb54f089b464855236ce17","user":{"login":"schmittjoh","id":197017,"avatar_url":"https://avatars.githubusercontent.com/u/197017?v=3","gravatar_id":"","url":"https://api.github.com/users/schmittjoh","html_url":"https://github.com/schmittjoh","followers_url":"https://api.github.com/users/schmittjoh/followers","following_url":"https://api.github.com/users/schmittjoh/following{/other_user}","gists_url":"https://api.github.com/users/schmittjoh/gists{/gist_id}","starred_url":"https://api.github.com/users/schmittjoh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schmittjoh/subscriptions","organizations_url":"https://api.github.com/users/schmittjoh/orgs","repos_url":"https://api.github.com/users/schmittjoh/repos","events_url":"https://api.github.com/users/schmittjoh/events{/privacy}","received_events_url":"https://api.github.com/users/schmittjoh/received_events","type":"User","site_admin":false},"repo":{"id":2453375,"name":"JMSTranslationBundle","full_name":"schmittjoh/JMSTranslationBundle","owner":{"login":"schmittjoh","id":197017,"avatar_url":"https://avatars.githubusercontent.com/u/197017?v=3","gravatar_id":"","url":"https://api.github.com/users/schmittjoh","html_url":"https://github.com/schmittjoh","followers_url":"https://api.github.com/users/schmittjoh/followers","following_url":"https://api.github.com/users/schmittjoh/following{/other_user}","gists_url":"https://api.github.com/users/schmittjoh/gists{/gist_id}","starred_url":"https://api.github.com/users/schmittjoh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schmittjoh/subscriptions","organizations_url":"https://api.github.com/users/schmittjoh/orgs","repos_url":"https://api.github.com/users/schmittjoh/repos","events_url":"https://api.github.com/users/schmittjoh/events{/privacy}","received_events_url":"https://api.github.com/users/schmittjoh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/schmittjoh/JMSTranslationBundle","description":"Puts the Symfony2 Translation Component on steroids","fork":false,"url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle","forks_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/forks","keys_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/teams","hooks_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/hooks","issue_events_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/issues/events{/number}","events_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/events","assignees_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/assignees{/user}","branches_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/branches{/branch}","tags_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/tags","blobs_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/languages","stargazers_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/stargazers","contributors_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/contributors","subscribers_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/subscribers","subscription_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/subscription","commits_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/contents/{+path}","compare_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/merges","archive_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/downloads","issues_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/issues{/number}","pulls_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/labels{/name}","releases_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/releases{/id}","deployments_url":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/deployments","created_at":"2011-09-25T05:16:00Z","updated_at":"2016-03-23T11:13:35Z","pushed_at":"2016-03-23T20:25:15Z","git_url":"git://github.com/schmittjoh/JMSTranslationBundle.git","ssh_url":"git@github.com:schmittjoh/JMSTranslationBundle.git","clone_url":"https://github.com/schmittjoh/JMSTranslationBundle.git","svn_url":"https://github.com/schmittjoh/JMSTranslationBundle","homepage":"http://jmsyst.com/bundles/JMSTranslationBundle","size":884,"stargazers_count":234,"watchers_count":234,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":207,"mirror_url":null,"open_issues_count":122,"forks":207,"open_issues":122,"watchers":234,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/pulls/314"},"html":{"href":"https://github.com/schmittjoh/JMSTranslationBundle/pull/314"},"issue":{"href":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/issues/314"},"comments":{"href":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/issues/314/comments"},"review_comments":{"href":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/pulls/314/comments"},"review_comment":{"href":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/pulls/314/commits"},"statuses":{"href":"https://api.github.com/repos/schmittjoh/JMSTranslationBundle/statuses/2c3208273183a57d96c95e30ec226b305b28c85f"}}}}