{"action":"created","comment":{"url":"https://api.github.com/repos/phpbench/phpbench/pulls/comments/50639529","id":50639529,"diff_hunk":"@@ -0,0 +1,148 @@\n+<?php\n+\n+/*\n+ * This file is part of the PHPBench package\n+ *\n+ * (c) Daniel Leech <daniel@dantleech.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 PhpBench\\Serializer;\n+\n+use PhpBench\\Dom\\SuiteDocument;\n+use PhpBench\\Model\\Benchmark;\n+use PhpBench\\Model\\Subject;\n+use PhpBench\\Model\\Suite;\n+use PhpBench\\Model\\Variant;\n+use PhpBench\\PhpBench;\n+use PhpBench\\Util\\TimeUnit;\n+\n+class XmlEncoder\n+{\n+    public function encode(Suite $suite)\n+    {\n+        $dom = new SuiteDocument();\n+        $rootEl = $dom->createRoot('phpbench');\n+        $rootEl->setAttribute('version', PhpBench::VERSION);","path":"lib/Serializer/XmlEncoder.php","position":28,"original_position":28,"commit_id":"04c31a791017ff6bda761f540e8d5341bc883270","original_commit_id":"04c31a791017ff6bda761f540e8d5341bc883270","user":{"login":"dantleech","id":530801,"avatar_url":"https://avatars.githubusercontent.com/u/530801?v=3","gravatar_id":"","url":"https://api.github.com/users/dantleech","html_url":"https://github.com/dantleech","followers_url":"https://api.github.com/users/dantleech/followers","following_url":"https://api.github.com/users/dantleech/following{/other_user}","gists_url":"https://api.github.com/users/dantleech/gists{/gist_id}","starred_url":"https://api.github.com/users/dantleech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dantleech/subscriptions","organizations_url":"https://api.github.com/users/dantleech/orgs","repos_url":"https://api.github.com/users/dantleech/repos","events_url":"https://api.github.com/users/dantleech/events{/privacy}","received_events_url":"https://api.github.com/users/dantleech/received_events","type":"User","site_admin":false},"body":"+ docs","created_at":"2016-01-24T18:20:43Z","updated_at":"2016-01-24T18:20:43Z","html_url":"https://github.com/phpbench/phpbench/pull/305#discussion_r50639529","pull_request_url":"https://api.github.com/repos/phpbench/phpbench/pulls/305","_links":{"self":{"href":"https://api.github.com/repos/phpbench/phpbench/pulls/comments/50639529"},"html":{"href":"https://github.com/phpbench/phpbench/pull/305#discussion_r50639529"},"pull_request":{"href":"https://api.github.com/repos/phpbench/phpbench/pulls/305"}}},"pull_request":{"url":"https://api.github.com/repos/phpbench/phpbench/pulls/305","id":57009415,"html_url":"https://github.com/phpbench/phpbench/pull/305","diff_url":"https://github.com/phpbench/phpbench/pull/305.diff","patch_url":"https://github.com/phpbench/phpbench/pull/305.patch","issue_url":"https://api.github.com/repos/phpbench/phpbench/issues/305","number":305,"state":"open","locked":false,"title":"Runner to return an object graph instead of an XML document.","user":{"login":"dantleech","id":530801,"avatar_url":"https://avatars.githubusercontent.com/u/530801?v=3","gravatar_id":"","url":"https://api.github.com/users/dantleech","html_url":"https://github.com/dantleech","followers_url":"https://api.github.com/users/dantleech/followers","following_url":"https://api.github.com/users/dantleech/following{/other_user}","gists_url":"https://api.github.com/users/dantleech/gists{/gist_id}","starred_url":"https://api.github.com/users/dantleech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dantleech/subscriptions","organizations_url":"https://api.github.com/users/dantleech/orgs","repos_url":"https://api.github.com/users/dantleech/repos","events_url":"https://api.github.com/users/dantleech/events{/privacy}","received_events_url":"https://api.github.com/users/dantleech/received_events","type":"User","site_admin":false},"body":"This PR refactors the Runner to return an object graph rather than an XML document.\r\n\r\nThe rational is that increasingly there is more logic relying on this XML document and it is often desirable to have object representations for sections of the document (e.g. `Suite` elements) in addition the structure currently is not validated against a schema, so changes to the document structure in one part of the code may not be reflected in tests for another part - \r\n\r\nMore importantly we remove the responsiblity of creating an XML document from the Runner, and delegate instead to a dedicated XML Encoder class, which provides more possibilities.\r\n\r\nThis is a prerequisite to persistant benchmarking results, where the Suite results will need to be rebuilt from multiple sources and the chance of constructing a bad XML document are quite high (without a schema).\r\n\r\n- Creates a `Model` namespace to house the object graph classes.\r\n- Some \"metadata\" classes have been moved here (`Benchmark`, `Subject`)\r\n- `Serializer\\\\XmlEncoder`` introduced.\r\n\r\nNext steps: The Reporting system should accept a `Suite` rather than an XML document - this can be done in another PR, for the minute we just manually convert the suite to XML using the Converter.","created_at":"2016-01-24T18:10:00Z","updated_at":"2016-01-24T18:20:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"af217239847576c0f6afb7eb8a448a3ea0de82fd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/phpbench/phpbench/pulls/305/commits","review_comments_url":"https://api.github.com/repos/phpbench/phpbench/pulls/305/comments","review_comment_url":"https://api.github.com/repos/phpbench/phpbench/pulls/comments{/number}","comments_url":"https://api.github.com/repos/phpbench/phpbench/issues/305/comments","statuses_url":"https://api.github.com/repos/phpbench/phpbench/statuses/04c31a791017ff6bda761f540e8d5341bc883270","head":{"label":"phpbench:suite_model","ref":"suite_model","sha":"04c31a791017ff6bda761f540e8d5341bc883270","user":{"login":"phpbench","id":12785153,"avatar_url":"https://avatars.githubusercontent.com/u/12785153?v=3","gravatar_id":"","url":"https://api.github.com/users/phpbench","html_url":"https://github.com/phpbench","followers_url":"https://api.github.com/users/phpbench/followers","following_url":"https://api.github.com/users/phpbench/following{/other_user}","gists_url":"https://api.github.com/users/phpbench/gists{/gist_id}","starred_url":"https://api.github.com/users/phpbench/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phpbench/subscriptions","organizations_url":"https://api.github.com/users/phpbench/orgs","repos_url":"https://api.github.com/users/phpbench/repos","events_url":"https://api.github.com/users/phpbench/events{/privacy}","received_events_url":"https://api.github.com/users/phpbench/received_events","type":"Organization","site_admin":false},"repo":{"id":34982189,"name":"phpbench","full_name":"phpbench/phpbench","owner":{"login":"phpbench","id":12785153,"avatar_url":"https://avatars.githubusercontent.com/u/12785153?v=3","gravatar_id":"","url":"https://api.github.com/users/phpbench","html_url":"https://github.com/phpbench","followers_url":"https://api.github.com/users/phpbench/followers","following_url":"https://api.github.com/users/phpbench/following{/other_user}","gists_url":"https://api.github.com/users/phpbench/gists{/gist_id}","starred_url":"https://api.github.com/users/phpbench/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phpbench/subscriptions","organizations_url":"https://api.github.com/users/phpbench/orgs","repos_url":"https://api.github.com/users/phpbench/repos","events_url":"https://api.github.com/users/phpbench/events{/privacy}","received_events_url":"https://api.github.com/users/phpbench/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/phpbench/phpbench","description":"PHP Benchmarking framework","fork":false,"url":"https://api.github.com/repos/phpbench/phpbench","forks_url":"https://api.github.com/repos/phpbench/phpbench/forks","keys_url":"https://api.github.com/repos/phpbench/phpbench/keys{/key_id}","collaborators_url":"https://api.github.com/repos/phpbench/phpbench/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/phpbench/phpbench/teams","hooks_url":"https://api.github.com/repos/phpbench/phpbench/hooks","issue_events_url":"https://api.github.com/repos/phpbench/phpbench/issues/events{/number}","events_url":"https://api.github.com/repos/phpbench/phpbench/events","assignees_url":"https://api.github.com/repos/phpbench/phpbench/assignees{/user}","branches_url":"https://api.github.com/repos/phpbench/phpbench/branches{/branch}","tags_url":"https://api.github.com/repos/phpbench/phpbench/tags","blobs_url":"https://api.github.com/repos/phpbench/phpbench/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/phpbench/phpbench/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/phpbench/phpbench/git/refs{/sha}","trees_url":"https://api.github.com/repos/phpbench/phpbench/git/trees{/sha}","statuses_url":"https://api.github.com/repos/phpbench/phpbench/statuses/{sha}","languages_url":"https://api.github.com/repos/phpbench/phpbench/languages","stargazers_url":"https://api.github.com/repos/phpbench/phpbench/stargazers","contributors_url":"https://api.github.com/repos/phpbench/phpbench/contributors","subscribers_url":"https://api.github.com/repos/phpbench/phpbench/subscribers","subscription_url":"https://api.github.com/repos/phpbench/phpbench/subscription","commits_url":"https://api.github.com/repos/phpbench/phpbench/commits{/sha}","git_commits_url":"https://api.github.com/repos/phpbench/phpbench/git/commits{/sha}","comments_url":"https://api.github.com/repos/phpbench/phpbench/comments{/number}","issue_comment_url":"https://api.github.com/repos/phpbench/phpbench/issues/comments{/number}","contents_url":"https://api.github.com/repos/phpbench/phpbench/contents/{+path}","compare_url":"https://api.github.com/repos/phpbench/phpbench/compare/{base}...{head}","merges_url":"https://api.github.com/repos/phpbench/phpbench/merges","archive_url":"https://api.github.com/repos/phpbench/phpbench/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/phpbench/phpbench/downloads","issues_url":"https://api.github.com/repos/phpbench/phpbench/issues{/number}","pulls_url":"https://api.github.com/repos/phpbench/phpbench/pulls{/number}","milestones_url":"https://api.github.com/repos/phpbench/phpbench/milestones{/number}","notifications_url":"https://api.github.com/repos/phpbench/phpbench/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/phpbench/phpbench/labels{/name}","releases_url":"https://api.github.com/repos/phpbench/phpbench/releases{/id}","deployments_url":"https://api.github.com/repos/phpbench/phpbench/deployments","created_at":"2015-05-03T10:34:08Z","updated_at":"2016-01-13T14:01:10Z","pushed_at":"2016-01-24T18:13:06Z","git_url":"git://github.com/phpbench/phpbench.git","ssh_url":"git@github.com:phpbench/phpbench.git","clone_url":"https://github.com/phpbench/phpbench.git","svn_url":"https://github.com/phpbench/phpbench","homepage":null,"size":1520,"stargazers_count":293,"watchers_count":293,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":35,"forks":10,"open_issues":35,"watchers":293,"default_branch":"master"}},"base":{"label":"phpbench:master","ref":"master","sha":"b543daf53042d7192ca217c7429970cc3c7c1081","user":{"login":"phpbench","id":12785153,"avatar_url":"https://avatars.githubusercontent.com/u/12785153?v=3","gravatar_id":"","url":"https://api.github.com/users/phpbench","html_url":"https://github.com/phpbench","followers_url":"https://api.github.com/users/phpbench/followers","following_url":"https://api.github.com/users/phpbench/following{/other_user}","gists_url":"https://api.github.com/users/phpbench/gists{/gist_id}","starred_url":"https://api.github.com/users/phpbench/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phpbench/subscriptions","organizations_url":"https://api.github.com/users/phpbench/orgs","repos_url":"https://api.github.com/users/phpbench/repos","events_url":"https://api.github.com/users/phpbench/events{/privacy}","received_events_url":"https://api.github.com/users/phpbench/received_events","type":"Organization","site_admin":false},"repo":{"id":34982189,"name":"phpbench","full_name":"phpbench/phpbench","owner":{"login":"phpbench","id":12785153,"avatar_url":"https://avatars.githubusercontent.com/u/12785153?v=3","gravatar_id":"","url":"https://api.github.com/users/phpbench","html_url":"https://github.com/phpbench","followers_url":"https://api.github.com/users/phpbench/followers","following_url":"https://api.github.com/users/phpbench/following{/other_user}","gists_url":"https://api.github.com/users/phpbench/gists{/gist_id}","starred_url":"https://api.github.com/users/phpbench/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phpbench/subscriptions","organizations_url":"https://api.github.com/users/phpbench/orgs","repos_url":"https://api.github.com/users/phpbench/repos","events_url":"https://api.github.com/users/phpbench/events{/privacy}","received_events_url":"https://api.github.com/users/phpbench/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/phpbench/phpbench","description":"PHP Benchmarking framework","fork":false,"url":"https://api.github.com/repos/phpbench/phpbench","forks_url":"https://api.github.com/repos/phpbench/phpbench/forks","keys_url":"https://api.github.com/repos/phpbench/phpbench/keys{/key_id}","collaborators_url":"https://api.github.com/repos/phpbench/phpbench/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/phpbench/phpbench/teams","hooks_url":"https://api.github.com/repos/phpbench/phpbench/hooks","issue_events_url":"https://api.github.com/repos/phpbench/phpbench/issues/events{/number}","events_url":"https://api.github.com/repos/phpbench/phpbench/events","assignees_url":"https://api.github.com/repos/phpbench/phpbench/assignees{/user}","branches_url":"https://api.github.com/repos/phpbench/phpbench/branches{/branch}","tags_url":"https://api.github.com/repos/phpbench/phpbench/tags","blobs_url":"https://api.github.com/repos/phpbench/phpbench/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/phpbench/phpbench/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/phpbench/phpbench/git/refs{/sha}","trees_url":"https://api.github.com/repos/phpbench/phpbench/git/trees{/sha}","statuses_url":"https://api.github.com/repos/phpbench/phpbench/statuses/{sha}","languages_url":"https://api.github.com/repos/phpbench/phpbench/languages","stargazers_url":"https://api.github.com/repos/phpbench/phpbench/stargazers","contributors_url":"https://api.github.com/repos/phpbench/phpbench/contributors","subscribers_url":"https://api.github.com/repos/phpbench/phpbench/subscribers","subscription_url":"https://api.github.com/repos/phpbench/phpbench/subscription","commits_url":"https://api.github.com/repos/phpbench/phpbench/commits{/sha}","git_commits_url":"https://api.github.com/repos/phpbench/phpbench/git/commits{/sha}","comments_url":"https://api.github.com/repos/phpbench/phpbench/comments{/number}","issue_comment_url":"https://api.github.com/repos/phpbench/phpbench/issues/comments{/number}","contents_url":"https://api.github.com/repos/phpbench/phpbench/contents/{+path}","compare_url":"https://api.github.com/repos/phpbench/phpbench/compare/{base}...{head}","merges_url":"https://api.github.com/repos/phpbench/phpbench/merges","archive_url":"https://api.github.com/repos/phpbench/phpbench/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/phpbench/phpbench/downloads","issues_url":"https://api.github.com/repos/phpbench/phpbench/issues{/number}","pulls_url":"https://api.github.com/repos/phpbench/phpbench/pulls{/number}","milestones_url":"https://api.github.com/repos/phpbench/phpbench/milestones{/number}","notifications_url":"https://api.github.com/repos/phpbench/phpbench/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/phpbench/phpbench/labels{/name}","releases_url":"https://api.github.com/repos/phpbench/phpbench/releases{/id}","deployments_url":"https://api.github.com/repos/phpbench/phpbench/deployments","created_at":"2015-05-03T10:34:08Z","updated_at":"2016-01-13T14:01:10Z","pushed_at":"2016-01-24T18:13:06Z","git_url":"git://github.com/phpbench/phpbench.git","ssh_url":"git@github.com:phpbench/phpbench.git","clone_url":"https://github.com/phpbench/phpbench.git","svn_url":"https://github.com/phpbench/phpbench","homepage":null,"size":1520,"stargazers_count":293,"watchers_count":293,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":35,"forks":10,"open_issues":35,"watchers":293,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/phpbench/phpbench/pulls/305"},"html":{"href":"https://github.com/phpbench/phpbench/pull/305"},"issue":{"href":"https://api.github.com/repos/phpbench/phpbench/issues/305"},"comments":{"href":"https://api.github.com/repos/phpbench/phpbench/issues/305/comments"},"review_comments":{"href":"https://api.github.com/repos/phpbench/phpbench/pulls/305/comments"},"review_comment":{"href":"https://api.github.com/repos/phpbench/phpbench/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/phpbench/phpbench/pulls/305/commits"},"statuses":{"href":"https://api.github.com/repos/phpbench/phpbench/statuses/04c31a791017ff6bda761f540e8d5341bc883270"}}}}