{"action":"created","comment":{"url":"https://api.github.com/repos/symfony/symfony/pulls/comments/67464679","id":67464679,"diff_hunk":"@@ -0,0 +1,141 @@\n+<?php\n+/*\n+ * This file is part of the Symfony package.\n+ *\n+ * (c) Fabien Potencier <fabien@symfony.com>\n+ *\n+ * For the full copyright and license information, please view the LICENSE\n+ * file that was distributed with this source code.\n+ */\n+\n+namespace Symfony\\Component\\VarDumper\\Caster;\n+\n+use Symfony\\Component\\VarDumper\\Cloner\\Stub;\n+\n+/**\n+ * Casts XmlReader class to array representation.\n+ *\n+ * @author Baptiste Clavié <clavie.b@gmail.com>\n+ */\n+class XmlReaderCaster\n+{\n+    private static $nodeTypes = array(\n+        \\XmlReader::NONE => 'NONE',\n+        \\XmlReader::ELEMENT => 'ELEMENT',\n+        \\XmlReader::ATTRIBUTE => 'ATTRIBUTE',\n+        \\XmlReader::TEXT => 'TEXT',\n+        \\XmlReader::CDATA => 'CDATA',\n+        \\XmlReader::ENTITY_REF => 'ENTITY_REF',\n+        \\XmlReader::ENTITY => 'ENTITY',\n+        \\XmlReader::PI => 'PI',\n+        \\XmlReader::COMMENT => 'COMMENT',\n+        \\XmlReader::DOC => 'DOC',\n+        \\XmlReader::DOC_TYPE => 'DOC_TYPE',\n+        \\XmlReader::DOC_FRAGMENT => 'DOC_FRAGMENT',\n+        \\XmlReader::NOTATION => 'NOTATION',\n+        \\XmlReader::WHITESPACE => 'WHITESPACE',\n+        \\XmlReader::SIGNIFICANT_WHITESPACE => 'SIGNIFICANT_WHITESPACE',\n+        \\XmlReader::END_ELEMENT => 'END_ELEMENT',\n+        \\XmlReader::END_ENTITY => 'END_ENTITY',\n+        \\XmlReader::XML_DECLARATION => 'XML_DECLARATION',\n+    );\n+\n+    protected static $filteredTypes = array(\n+        \\XmlReader::ATTRIBUTE => true,\n+        \\XmlReader::ENTITY_REF => true,\n+        \\XmlReader::ENTITY => true,\n+        \\XmlReader::PI => true,\n+        \\XmlReader::DOC => true,\n+        \\XmlReader::DOC_TYPE => true,\n+        \\XmlReader::DOC_FRAGMENT => true,\n+        \\XmlReader::NOTATION => true,\n+        \\XmlReader::WHITESPACE => true,\n+        \\XmlReader::SIGNIFICANT_WHITESPACE => true,\n+        \\XmlReader::END_ELEMENT => true,\n+        \\XmlReader::END_ENTITY => true,\n+    );\n+\n+    public static function castXmlReader(\\XmlReader $reader, array $a, Stub $stub, $isNested)\n+    {\n+        $nodeType = new ConstStub(self::$nodeTypes[$reader->nodeType], $reader->nodeType);\n+\n+        $infos = array(\n+            'nodeType' => $nodeType,\n+            Caster::PREFIX_VIRTUAL.'parserProperties' => array(","path":"src/Symfony/Component/VarDumper/Caster/XmlReaderCaster.php","position":64,"original_position":64,"commit_id":"c290aa6cd8432607a7a52fa6f696a6de984713ec","original_commit_id":"c290aa6cd8432607a7a52fa6f696a6de984713ec","user":{"login":"nicolas-grekas","id":243674,"avatar_url":"https://avatars.githubusercontent.com/u/243674?v=3","gravatar_id":"","url":"https://api.github.com/users/nicolas-grekas","html_url":"https://github.com/nicolas-grekas","followers_url":"https://api.github.com/users/nicolas-grekas/followers","following_url":"https://api.github.com/users/nicolas-grekas/following{/other_user}","gists_url":"https://api.github.com/users/nicolas-grekas/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolas-grekas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolas-grekas/subscriptions","organizations_url":"https://api.github.com/users/nicolas-grekas/orgs","repos_url":"https://api.github.com/users/nicolas-grekas/repos","events_url":"https://api.github.com/users/nicolas-grekas/events{/privacy}","received_events_url":"https://api.github.com/users/nicolas-grekas/received_events","type":"User","site_admin":false},"body":"` => new EnumStub(array(`...\r\nmaybe also put this item always last is the list?","created_at":"2016-06-17T06:17:46Z","updated_at":"2016-06-17T06:17:46Z","html_url":"https://github.com/symfony/symfony/pull/18989#discussion_r67464679","pull_request_url":"https://api.github.com/repos/symfony/symfony/pulls/18989","_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments/67464679"},"html":{"href":"https://github.com/symfony/symfony/pull/18989#discussion_r67464679"},"pull_request":{"href":"https://api.github.com/repos/symfony/symfony/pulls/18989"}}},"pull_request":{"url":"https://api.github.com/repos/symfony/symfony/pulls/18989","id":72884657,"html_url":"https://github.com/symfony/symfony/pull/18989","diff_url":"https://github.com/symfony/symfony/pull/18989.diff","patch_url":"https://github.com/symfony/symfony/pull/18989.patch","issue_url":"https://api.github.com/repos/symfony/symfony/issues/18989","number":18989,"state":"open","locked":false,"title":"[Dumper] Add support for XmlReader objets","user":{"login":"Taluu","id":239685,"avatar_url":"https://avatars.githubusercontent.com/u/239685?v=3","gravatar_id":"","url":"https://api.github.com/users/Taluu","html_url":"https://github.com/Taluu","followers_url":"https://api.github.com/users/Taluu/followers","following_url":"https://api.github.com/users/Taluu/following{/other_user}","gists_url":"https://api.github.com/users/Taluu/gists{/gist_id}","starred_url":"https://api.github.com/users/Taluu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Taluu/subscriptions","organizations_url":"https://api.github.com/users/Taluu/orgs","repos_url":"https://api.github.com/users/Taluu/repos","events_url":"https://api.github.com/users/Taluu/events{/privacy}","received_events_url":"https://api.github.com/users/Taluu/received_events","type":"User","site_admin":false},"body":"| Q             | A\r\n| ------------- | ---\r\n| Branch?       | \"master\"\r\n| Bug fix?      | no\r\n| New feature?  | yes\r\n| BC breaks?    | no\r\n| Deprecations? | no\r\n| Tests pass?   | yes\r\n| Fixed tickets | ~\r\n| License       | MIT\r\n| Doc PR        | ~\r\n\r\nAdding support for `XmlReader` objects. The thing is, with the caster as presented here, we may have noises (`#text` elements, whitespaces (significant or not) elements, ...) which may disturb the reading, but I am not sure if I should ignore those or not.\r\n\r\nMoreover, there is only one class, but having different casters could do the trick I guess ? But then we have a lot of noise with empty results if none of the casters are satisfied (unless I missed something, allowing us to completely ignore the current object, in cases such as `XmlReader::WHITESPACE` and `XmlReader::SIGNIFICANT_WHITESPACE`). \r\n\r\nOn attributes, I can either not touch the current state, but then I can only have indexes for attributes and no names (`<foo bar=\"baz\">` would be rendered as `array(0 => 'baz')`), or I can modify the object (rendering `<foo bar=\"baz\">` as `array('bar' => 'baz')`) , but as @stof said, we should not touch it, unless it is not the actual object that is modified ? I do not have enough knowledge on the var dumper to determine that point...\r\n\r\nOpen for suggestions.\r\n\r\n- [x] Add basic XmlReaderCaster\r\n- [x] Add XmlReaderCaster in the default casters\r\n- [x] Add some tests","created_at":"2016-06-07T14:24:38Z","updated_at":"2016-06-17T06:17:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ea3066826d4bf8af847f738f84c6d50e41b1b138","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/symfony/symfony/pulls/18989/commits","review_comments_url":"https://api.github.com/repos/symfony/symfony/pulls/18989/comments","review_comment_url":"https://api.github.com/repos/symfony/symfony/pulls/comments{/number}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/18989/comments","statuses_url":"https://api.github.com/repos/symfony/symfony/statuses/c290aa6cd8432607a7a52fa6f696a6de984713ec","head":{"label":"Taluu:xml-reader-caster","ref":"xml-reader-caster","sha":"c290aa6cd8432607a7a52fa6f696a6de984713ec","user":{"login":"Taluu","id":239685,"avatar_url":"https://avatars.githubusercontent.com/u/239685?v=3","gravatar_id":"","url":"https://api.github.com/users/Taluu","html_url":"https://github.com/Taluu","followers_url":"https://api.github.com/users/Taluu/followers","following_url":"https://api.github.com/users/Taluu/following{/other_user}","gists_url":"https://api.github.com/users/Taluu/gists{/gist_id}","starred_url":"https://api.github.com/users/Taluu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Taluu/subscriptions","organizations_url":"https://api.github.com/users/Taluu/orgs","repos_url":"https://api.github.com/users/Taluu/repos","events_url":"https://api.github.com/users/Taluu/events{/privacy}","received_events_url":"https://api.github.com/users/Taluu/received_events","type":"User","site_admin":false},"repo":{"id":2191230,"name":"symfony","full_name":"Taluu/symfony","owner":{"login":"Taluu","id":239685,"avatar_url":"https://avatars.githubusercontent.com/u/239685?v=3","gravatar_id":"","url":"https://api.github.com/users/Taluu","html_url":"https://github.com/Taluu","followers_url":"https://api.github.com/users/Taluu/followers","following_url":"https://api.github.com/users/Taluu/following{/other_user}","gists_url":"https://api.github.com/users/Taluu/gists{/gist_id}","starred_url":"https://api.github.com/users/Taluu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Taluu/subscriptions","organizations_url":"https://api.github.com/users/Taluu/orgs","repos_url":"https://api.github.com/users/Taluu/repos","events_url":"https://api.github.com/users/Taluu/events{/privacy}","received_events_url":"https://api.github.com/users/Taluu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Taluu/symfony","description":"The Symfony2 PHP framework","fork":true,"url":"https://api.github.com/repos/Taluu/symfony","forks_url":"https://api.github.com/repos/Taluu/symfony/forks","keys_url":"https://api.github.com/repos/Taluu/symfony/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Taluu/symfony/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Taluu/symfony/teams","hooks_url":"https://api.github.com/repos/Taluu/symfony/hooks","issue_events_url":"https://api.github.com/repos/Taluu/symfony/issues/events{/number}","events_url":"https://api.github.com/repos/Taluu/symfony/events","assignees_url":"https://api.github.com/repos/Taluu/symfony/assignees{/user}","branches_url":"https://api.github.com/repos/Taluu/symfony/branches{/branch}","tags_url":"https://api.github.com/repos/Taluu/symfony/tags","blobs_url":"https://api.github.com/repos/Taluu/symfony/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Taluu/symfony/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Taluu/symfony/git/refs{/sha}","trees_url":"https://api.github.com/repos/Taluu/symfony/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Taluu/symfony/statuses/{sha}","languages_url":"https://api.github.com/repos/Taluu/symfony/languages","stargazers_url":"https://api.github.com/repos/Taluu/symfony/stargazers","contributors_url":"https://api.github.com/repos/Taluu/symfony/contributors","subscribers_url":"https://api.github.com/repos/Taluu/symfony/subscribers","subscription_url":"https://api.github.com/repos/Taluu/symfony/subscription","commits_url":"https://api.github.com/repos/Taluu/symfony/commits{/sha}","git_commits_url":"https://api.github.com/repos/Taluu/symfony/git/commits{/sha}","comments_url":"https://api.github.com/repos/Taluu/symfony/comments{/number}","issue_comment_url":"https://api.github.com/repos/Taluu/symfony/issues/comments{/number}","contents_url":"https://api.github.com/repos/Taluu/symfony/contents/{+path}","compare_url":"https://api.github.com/repos/Taluu/symfony/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Taluu/symfony/merges","archive_url":"https://api.github.com/repos/Taluu/symfony/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Taluu/symfony/downloads","issues_url":"https://api.github.com/repos/Taluu/symfony/issues{/number}","pulls_url":"https://api.github.com/repos/Taluu/symfony/pulls{/number}","milestones_url":"https://api.github.com/repos/Taluu/symfony/milestones{/number}","notifications_url":"https://api.github.com/repos/Taluu/symfony/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Taluu/symfony/labels{/name}","releases_url":"https://api.github.com/repos/Taluu/symfony/releases{/id}","deployments_url":"https://api.github.com/repos/Taluu/symfony/deployments","created_at":"2011-08-11T13:20:40Z","updated_at":"2014-03-25T22:04:54Z","pushed_at":"2016-06-16T19:27:23Z","git_url":"git://github.com/Taluu/symfony.git","ssh_url":"git@github.com:Taluu/symfony.git","clone_url":"https://github.com/Taluu/symfony.git","svn_url":"https://github.com/Taluu/symfony","homepage":"symfony.com","size":72437,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":false,"has_downloads":false,"has_wiki":false,"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":"symfony:master","ref":"master","sha":"61e5ddc1060eb56e1a2dba97eceb806613d47733","user":{"login":"symfony","id":143937,"avatar_url":"https://avatars.githubusercontent.com/u/143937?v=3","gravatar_id":"","url":"https://api.github.com/users/symfony","html_url":"https://github.com/symfony","followers_url":"https://api.github.com/users/symfony/followers","following_url":"https://api.github.com/users/symfony/following{/other_user}","gists_url":"https://api.github.com/users/symfony/gists{/gist_id}","starred_url":"https://api.github.com/users/symfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symfony/subscriptions","organizations_url":"https://api.github.com/users/symfony/orgs","repos_url":"https://api.github.com/users/symfony/repos","events_url":"https://api.github.com/users/symfony/events{/privacy}","received_events_url":"https://api.github.com/users/symfony/received_events","type":"Organization","site_admin":false},"repo":{"id":458058,"name":"symfony","full_name":"symfony/symfony","owner":{"login":"symfony","id":143937,"avatar_url":"https://avatars.githubusercontent.com/u/143937?v=3","gravatar_id":"","url":"https://api.github.com/users/symfony","html_url":"https://github.com/symfony","followers_url":"https://api.github.com/users/symfony/followers","following_url":"https://api.github.com/users/symfony/following{/other_user}","gists_url":"https://api.github.com/users/symfony/gists{/gist_id}","starred_url":"https://api.github.com/users/symfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symfony/subscriptions","organizations_url":"https://api.github.com/users/symfony/orgs","repos_url":"https://api.github.com/users/symfony/repos","events_url":"https://api.github.com/users/symfony/events{/privacy}","received_events_url":"https://api.github.com/users/symfony/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/symfony/symfony","description":"The Symfony PHP framework","fork":false,"url":"https://api.github.com/repos/symfony/symfony","forks_url":"https://api.github.com/repos/symfony/symfony/forks","keys_url":"https://api.github.com/repos/symfony/symfony/keys{/key_id}","collaborators_url":"https://api.github.com/repos/symfony/symfony/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/symfony/symfony/teams","hooks_url":"https://api.github.com/repos/symfony/symfony/hooks","issue_events_url":"https://api.github.com/repos/symfony/symfony/issues/events{/number}","events_url":"https://api.github.com/repos/symfony/symfony/events","assignees_url":"https://api.github.com/repos/symfony/symfony/assignees{/user}","branches_url":"https://api.github.com/repos/symfony/symfony/branches{/branch}","tags_url":"https://api.github.com/repos/symfony/symfony/tags","blobs_url":"https://api.github.com/repos/symfony/symfony/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/symfony/symfony/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/symfony/symfony/git/refs{/sha}","trees_url":"https://api.github.com/repos/symfony/symfony/git/trees{/sha}","statuses_url":"https://api.github.com/repos/symfony/symfony/statuses/{sha}","languages_url":"https://api.github.com/repos/symfony/symfony/languages","stargazers_url":"https://api.github.com/repos/symfony/symfony/stargazers","contributors_url":"https://api.github.com/repos/symfony/symfony/contributors","subscribers_url":"https://api.github.com/repos/symfony/symfony/subscribers","subscription_url":"https://api.github.com/repos/symfony/symfony/subscription","commits_url":"https://api.github.com/repos/symfony/symfony/commits{/sha}","git_commits_url":"https://api.github.com/repos/symfony/symfony/git/commits{/sha}","comments_url":"https://api.github.com/repos/symfony/symfony/comments{/number}","issue_comment_url":"https://api.github.com/repos/symfony/symfony/issues/comments{/number}","contents_url":"https://api.github.com/repos/symfony/symfony/contents/{+path}","compare_url":"https://api.github.com/repos/symfony/symfony/compare/{base}...{head}","merges_url":"https://api.github.com/repos/symfony/symfony/merges","archive_url":"https://api.github.com/repos/symfony/symfony/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/symfony/symfony/downloads","issues_url":"https://api.github.com/repos/symfony/symfony/issues{/number}","pulls_url":"https://api.github.com/repos/symfony/symfony/pulls{/number}","milestones_url":"https://api.github.com/repos/symfony/symfony/milestones{/number}","notifications_url":"https://api.github.com/repos/symfony/symfony/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/symfony/symfony/labels{/name}","releases_url":"https://api.github.com/repos/symfony/symfony/releases{/id}","deployments_url":"https://api.github.com/repos/symfony/symfony/deployments","created_at":"2010-01-04T14:21:21Z","updated_at":"2016-06-17T05:24:34Z","pushed_at":"2016-06-16T21:03:58Z","git_url":"git://github.com/symfony/symfony.git","ssh_url":"git@github.com:symfony/symfony.git","clone_url":"https://github.com/symfony/symfony.git","svn_url":"https://github.com/symfony/symfony","homepage":"symfony.com","size":133647,"stargazers_count":12502,"watchers_count":12502,"language":"PHP","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":4881,"mirror_url":null,"open_issues_count":708,"forks":4881,"open_issues":708,"watchers":12502,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/18989"},"html":{"href":"https://github.com/symfony/symfony/pull/18989"},"issue":{"href":"https://api.github.com/repos/symfony/symfony/issues/18989"},"comments":{"href":"https://api.github.com/repos/symfony/symfony/issues/18989/comments"},"review_comments":{"href":"https://api.github.com/repos/symfony/symfony/pulls/18989/comments"},"review_comment":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/symfony/symfony/pulls/18989/commits"},"statuses":{"href":"https://api.github.com/repos/symfony/symfony/statuses/c290aa6cd8432607a7a52fa6f696a6de984713ec"}}}}
{"actor":{"display_login":"nicolas-grekas"}}