{"action":"created","comment":{"url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/pulls/comments/69107827","id":69107827,"diff_hunk":"@@ -28,11 +28,7 @@ public function __construct($sExpected, $sFound, $sMatchType = 'literal', $iLine\n \t\t\t$sMessage = trim(\"$sExpected $sFound\");\n \t\t}\n \n-\t\tif (!empty($iLineNo)) {\n-\t\t\t$sMessage .= \" [line no: $iLineNo]\";\n-\t\t}\n-\n-\t\tparent::__construct($sMessage);\n+\t\tparent::__construct($sMessage, $iLineNo);\n \t}\n \n \tpublic function getLineNo() {","path":"lib/Sabberworm/CSS/Parsing/UnexpectedTokenException.php","position":null,"original_position":21,"commit_id":"63386df4963b88f4bd8ba7b975330505f37d2cf4","original_commit_id":"24bb6717582d6be4f5572ba7d5deb68abbcae275","user":{"login":"sidkshatriya","id":638477,"avatar_url":"https://avatars.githubusercontent.com/u/638477?v=3","gravatar_id":"","url":"https://api.github.com/users/sidkshatriya","html_url":"https://github.com/sidkshatriya","followers_url":"https://api.github.com/users/sidkshatriya/followers","following_url":"https://api.github.com/users/sidkshatriya/following{/other_user}","gists_url":"https://api.github.com/users/sidkshatriya/gists{/gist_id}","starred_url":"https://api.github.com/users/sidkshatriya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sidkshatriya/subscriptions","organizations_url":"https://api.github.com/users/sidkshatriya/orgs","repos_url":"https://api.github.com/users/sidkshatriya/repos","events_url":"https://api.github.com/users/sidkshatriya/events{/privacy}","received_events_url":"https://api.github.com/users/sidkshatriya/received_events","type":"User","site_admin":false},"body":"@sabberworm Good catch! Done!","created_at":"2016-06-30T10:19:50Z","updated_at":"2016-06-30T10:19:50Z","html_url":"https://github.com/sabberworm/PHP-CSS-Parser/pull/105#discussion_r69107827","pull_request_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/pulls/105","_links":{"self":{"href":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/pulls/comments/69107827"},"html":{"href":"https://github.com/sabberworm/PHP-CSS-Parser/pull/105#discussion_r69107827"},"pull_request":{"href":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/pulls/105"}}},"pull_request":{"url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/pulls/105","id":75668750,"html_url":"https://github.com/sabberworm/PHP-CSS-Parser/pull/105","diff_url":"https://github.com/sabberworm/PHP-CSS-Parser/pull/105.diff","patch_url":"https://github.com/sabberworm/PHP-CSS-Parser/pull/105.patch","issue_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/issues/105","number":105,"state":"open","locked":false,"title":"Add line number support in the sabberworm CSS parser","user":{"login":"sidkshatriya","id":638477,"avatar_url":"https://avatars.githubusercontent.com/u/638477?v=3","gravatar_id":"","url":"https://api.github.com/users/sidkshatriya","html_url":"https://github.com/sidkshatriya","followers_url":"https://api.github.com/users/sidkshatriya/followers","following_url":"https://api.github.com/users/sidkshatriya/following{/other_user}","gists_url":"https://api.github.com/users/sidkshatriya/gists{/gist_id}","starred_url":"https://api.github.com/users/sidkshatriya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sidkshatriya/subscriptions","organizations_url":"https://api.github.com/users/sidkshatriya/orgs","repos_url":"https://api.github.com/users/sidkshatriya/repos","events_url":"https://api.github.com/users/sidkshatriya/events{/privacy}","received_events_url":"https://api.github.com/users/sidkshatriya/received_events","type":"User","site_admin":false},"body":"AMP HTML is a restricted subset of HTML (See https://www.ampproject.org/ for more details) and the AMP PHP Library provide validation and HTML to AMP HTML conversion utilities. We're using the `masterminds/html5-php` library to parse HTML5 and we're using `sabberworm/php-css-parser` to parse the CSS in the [AMP PHP Library](https://github.com/Lullabot/amp-library)\r\n\r\nAfter parsing the CSS parse we report any problems in the CSS (for e.g. `!important` is disallowed in the AMP dialect of HTML, we use the `sabberworm` parser to find all the uses of `!important` for instance)\r\n\r\nNow the CSS supplied by the user could be hundreds / thousands of lines long. So its not useful to simply say that `!important` was used and is not allowed. We should be able to say _which line_ the problem occurred.\r\n\r\nThis pull request adds support for line numbers. Here is how we're using this https://github.com/Lullabot/amp-library/pull/80#issuecomment-222695630\r\nNotice the line numbers reported in the validation errors which coming from code submitted in this PR.\r\n\r\nWould greatly appreciate if you had a look and merge it if you believe this feature would be useful. Hopefully the code changes have not missed anything out.\r\n\r\nThanks for this useful library BTW.","created_at":"2016-06-29T15:24:10Z","updated_at":"2016-06-30T10:19:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cf7be94f0688333dbe117a20660fbdd5aa7ec924","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/pulls/105/commits","review_comments_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/pulls/105/comments","review_comment_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/issues/105/comments","statuses_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/statuses/63386df4963b88f4bd8ba7b975330505f37d2cf4","head":{"label":"Lullabot:line-number-support-in-css-objects","ref":"line-number-support-in-css-objects","sha":"63386df4963b88f4bd8ba7b975330505f37d2cf4","user":{"login":"Lullabot","id":321267,"avatar_url":"https://avatars.githubusercontent.com/u/321267?v=3","gravatar_id":"","url":"https://api.github.com/users/Lullabot","html_url":"https://github.com/Lullabot","followers_url":"https://api.github.com/users/Lullabot/followers","following_url":"https://api.github.com/users/Lullabot/following{/other_user}","gists_url":"https://api.github.com/users/Lullabot/gists{/gist_id}","starred_url":"https://api.github.com/users/Lullabot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lullabot/subscriptions","organizations_url":"https://api.github.com/users/Lullabot/orgs","repos_url":"https://api.github.com/users/Lullabot/repos","events_url":"https://api.github.com/users/Lullabot/events{/privacy}","received_events_url":"https://api.github.com/users/Lullabot/received_events","type":"Organization","site_admin":false},"repo":{"id":60062527,"name":"PHP-CSS-Parser","full_name":"Lullabot/PHP-CSS-Parser","owner":{"login":"Lullabot","id":321267,"avatar_url":"https://avatars.githubusercontent.com/u/321267?v=3","gravatar_id":"","url":"https://api.github.com/users/Lullabot","html_url":"https://github.com/Lullabot","followers_url":"https://api.github.com/users/Lullabot/followers","following_url":"https://api.github.com/users/Lullabot/following{/other_user}","gists_url":"https://api.github.com/users/Lullabot/gists{/gist_id}","starred_url":"https://api.github.com/users/Lullabot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lullabot/subscriptions","organizations_url":"https://api.github.com/users/Lullabot/orgs","repos_url":"https://api.github.com/users/Lullabot/repos","events_url":"https://api.github.com/users/Lullabot/events{/privacy}","received_events_url":"https://api.github.com/users/Lullabot/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Lullabot/PHP-CSS-Parser","description":"A Parser for CSS Files written in PHP. Allows extraction of CSS files into a data structure, manipulation of said structure and output as (optimized) CSS","fork":true,"url":"https://api.github.com/repos/Lullabot/PHP-CSS-Parser","forks_url":"https://api.github.com/repos/Lullabot/PHP-CSS-Parser/forks","keys_url":"https://api.github.com/repos/Lullabot/PHP-CSS-Parser/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Lullabot/PHP-CSS-Parser/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Lullabot/PHP-CSS-Parser/teams","hooks_url":"https://api.github.com/repos/Lullabot/PHP-CSS-Parser/hooks","issue_events_url":"https://api.github.com/repos/Lullabot/PHP-CSS-Parser/issues/events{/number}","events_url":"https://api.github.com/repos/Lullabot/PHP-CSS-Parser/events","assignees_url":"https://api.github.com/repos/Lullabot/PHP-CSS-Parser/assignees{/user}","branches_url":"https://api.github.com/repos/Lullabot/PHP-CSS-Parser/branches{/branch}","tags_url":"https://api.github.com/repos/Lullabot/PHP-CSS-Parser/tags","blobs_url":"https://api.github.com/repos/Lullabot/PHP-CSS-Parser/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Lullabot/PHP-CSS-Parser/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Lullabot/PHP-CSS-Parser/git/refs{/sha}","trees_url":"https://api.github.com/repos/Lullabot/PHP-CSS-Parser/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Lullabot/PHP-CSS-Parser/statuses/{sha}","languages_url":"https://api.github.com/repos/Lullabot/PHP-CSS-Parser/languages","stargazers_url":"https://api.github.com/repos/Lullabot/PHP-CSS-Parser/stargazers","contributors_url":"https://api.github.com/repos/Lullabot/PHP-CSS-Parser/contributors","subscribers_url":"https://api.github.com/repos/Lullabot/PHP-CSS-Parser/subscribers","subscription_url":"https://api.github.com/repos/Lullabot/PHP-CSS-Parser/subscription","commits_url":"https://api.github.com/repos/Lullabot/PHP-CSS-Parser/commits{/sha}","git_commits_url":"https://api.github.com/repos/Lullabot/PHP-CSS-Parser/git/commits{/sha}","comments_url":"https://api.github.com/repos/Lullabot/PHP-CSS-Parser/comments{/number}","issue_comment_url":"https://api.github.com/repos/Lullabot/PHP-CSS-Parser/issues/comments{/number}","contents_url":"https://api.github.com/repos/Lullabot/PHP-CSS-Parser/contents/{+path}","compare_url":"https://api.github.com/repos/Lullabot/PHP-CSS-Parser/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Lullabot/PHP-CSS-Parser/merges","archive_url":"https://api.github.com/repos/Lullabot/PHP-CSS-Parser/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Lullabot/PHP-CSS-Parser/downloads","issues_url":"https://api.github.com/repos/Lullabot/PHP-CSS-Parser/issues{/number}","pulls_url":"https://api.github.com/repos/Lullabot/PHP-CSS-Parser/pulls{/number}","milestones_url":"https://api.github.com/repos/Lullabot/PHP-CSS-Parser/milestones{/number}","notifications_url":"https://api.github.com/repos/Lullabot/PHP-CSS-Parser/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Lullabot/PHP-CSS-Parser/labels{/name}","releases_url":"https://api.github.com/repos/Lullabot/PHP-CSS-Parser/releases{/id}","deployments_url":"https://api.github.com/repos/Lullabot/PHP-CSS-Parser/deployments","created_at":"2016-05-31T06:08:11Z","updated_at":"2016-05-31T06:08:13Z","pushed_at":"2016-06-30T10:19:24Z","git_url":"git://github.com/Lullabot/PHP-CSS-Parser.git","ssh_url":"git@github.com:Lullabot/PHP-CSS-Parser.git","clone_url":"https://github.com/Lullabot/PHP-CSS-Parser.git","svn_url":"https://github.com/Lullabot/PHP-CSS-Parser","homepage":"http://www.sabberworm.com/blog/2010/6/10/php-css-parser","size":870,"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":"line-number-support-in-css-objects"}},"base":{"label":"sabberworm:master","ref":"master","sha":"7078b76a9dbf9dcc9ff53b503453e81748471b8f","user":{"login":"sabberworm","id":47652,"avatar_url":"https://avatars.githubusercontent.com/u/47652?v=3","gravatar_id":"","url":"https://api.github.com/users/sabberworm","html_url":"https://github.com/sabberworm","followers_url":"https://api.github.com/users/sabberworm/followers","following_url":"https://api.github.com/users/sabberworm/following{/other_user}","gists_url":"https://api.github.com/users/sabberworm/gists{/gist_id}","starred_url":"https://api.github.com/users/sabberworm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sabberworm/subscriptions","organizations_url":"https://api.github.com/users/sabberworm/orgs","repos_url":"https://api.github.com/users/sabberworm/repos","events_url":"https://api.github.com/users/sabberworm/events{/privacy}","received_events_url":"https://api.github.com/users/sabberworm/received_events","type":"User","site_admin":false},"repo":{"id":858754,"name":"PHP-CSS-Parser","full_name":"sabberworm/PHP-CSS-Parser","owner":{"login":"sabberworm","id":47652,"avatar_url":"https://avatars.githubusercontent.com/u/47652?v=3","gravatar_id":"","url":"https://api.github.com/users/sabberworm","html_url":"https://github.com/sabberworm","followers_url":"https://api.github.com/users/sabberworm/followers","following_url":"https://api.github.com/users/sabberworm/following{/other_user}","gists_url":"https://api.github.com/users/sabberworm/gists{/gist_id}","starred_url":"https://api.github.com/users/sabberworm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sabberworm/subscriptions","organizations_url":"https://api.github.com/users/sabberworm/orgs","repos_url":"https://api.github.com/users/sabberworm/repos","events_url":"https://api.github.com/users/sabberworm/events{/privacy}","received_events_url":"https://api.github.com/users/sabberworm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sabberworm/PHP-CSS-Parser","description":"A Parser for CSS Files written in PHP. Allows extraction of CSS files into a data structure, manipulation of said structure and output as (optimized) CSS","fork":false,"url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser","forks_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/forks","keys_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/teams","hooks_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/hooks","issue_events_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/issues/events{/number}","events_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/events","assignees_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/assignees{/user}","branches_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/branches{/branch}","tags_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/tags","blobs_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/git/refs{/sha}","trees_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/statuses/{sha}","languages_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/languages","stargazers_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/stargazers","contributors_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/contributors","subscribers_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/subscribers","subscription_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/subscription","commits_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/commits{/sha}","git_commits_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/git/commits{/sha}","comments_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/comments{/number}","issue_comment_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/issues/comments{/number}","contents_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/contents/{+path}","compare_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/merges","archive_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/downloads","issues_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/issues{/number}","pulls_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/pulls{/number}","milestones_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/milestones{/number}","notifications_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/labels{/name}","releases_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/releases{/id}","deployments_url":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/deployments","created_at":"2010-08-24T09:39:55Z","updated_at":"2016-06-29T15:37:46Z","pushed_at":"2016-06-30T10:19:25Z","git_url":"git://github.com/sabberworm/PHP-CSS-Parser.git","ssh_url":"git@github.com:sabberworm/PHP-CSS-Parser.git","clone_url":"https://github.com/sabberworm/PHP-CSS-Parser.git","svn_url":"https://github.com/sabberworm/PHP-CSS-Parser","homepage":"http://www.sabberworm.com/blog/2010/6/10/php-css-parser","size":1000,"stargazers_count":315,"watchers_count":315,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":66,"mirror_url":null,"open_issues_count":15,"forks":66,"open_issues":15,"watchers":315,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/pulls/105"},"html":{"href":"https://github.com/sabberworm/PHP-CSS-Parser/pull/105"},"issue":{"href":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/issues/105"},"comments":{"href":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/issues/105/comments"},"review_comments":{"href":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/pulls/105/comments"},"review_comment":{"href":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/pulls/105/commits"},"statuses":{"href":"https://api.github.com/repos/sabberworm/PHP-CSS-Parser/statuses/63386df4963b88f4bd8ba7b975330505f37d2cf4"}}}}
{"actor":{"display_login":"sidkshatriya"}}