{"action":"created","issue":{"url":"https://api.github.com/repos/oyejorge/less.php/issues/210","labels_url":"https://api.github.com/repos/oyejorge/less.php/issues/210/labels{/name}","comments_url":"https://api.github.com/repos/oyejorge/less.php/issues/210/comments","events_url":"https://api.github.com/repos/oyejorge/less.php/issues/210/events","html_url":"https://github.com/oyejorge/less.php/pull/210","id":62165219,"number":210,"title":"Throw meaningful errors when encountering invalid color statements","user":{"login":"ravisorg","id":1596725,"avatar_url":"https://avatars.githubusercontent.com/u/1596725?v=3","gravatar_id":"","url":"https://api.github.com/users/ravisorg","html_url":"https://github.com/ravisorg","followers_url":"https://api.github.com/users/ravisorg/followers","following_url":"https://api.github.com/users/ravisorg/following{/other_user}","gists_url":"https://api.github.com/users/ravisorg/gists{/gist_id}","starred_url":"https://api.github.com/users/ravisorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ravisorg/subscriptions","organizations_url":"https://api.github.com/users/ravisorg/orgs","repos_url":"https://api.github.com/users/ravisorg/repos","events_url":"https://api.github.com/users/ravisorg/events{/privacy}","received_events_url":"https://api.github.com/users/ravisorg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-03-16T18:04:19Z","updated_at":"2015-03-16T23:41:39Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/oyejorge/less.php/pulls/210","html_url":"https://github.com/oyejorge/less.php/pull/210","diff_url":"https://github.com/oyejorge/less.php/pull/210.diff","patch_url":"https://github.com/oyejorge/less.php/pull/210.patch"},"body":"Applied the color validation check from Less_Functions::darken to all of the other color modification methods in Less_Functions, making it much easier to debug invalid LESS color statements (Less.php now throws errors on invalid color statements, giving you clues as to what went wrong, instead of just crashing).\r\n\r\nSide note:\r\nPersonally I would have written it as if (!$color instanceof Less_Tree_color) { } instead of placing each of the methods' entire code inside an if statement, but since darken was already done that way I figured it might be the chosen coding style. Feel free to change if desired."},"comment":{"url":"https://api.github.com/repos/oyejorge/less.php/issues/comments/81994031","html_url":"https://github.com/oyejorge/less.php/pull/210#issuecomment-81994031","issue_url":"https://api.github.com/repos/oyejorge/less.php/issues/210","id":81994031,"user":{"login":"seven-phases-max","id":5304376,"avatar_url":"https://avatars.githubusercontent.com/u/5304376?v=3","gravatar_id":"","url":"https://api.github.com/users/seven-phases-max","html_url":"https://github.com/seven-phases-max","followers_url":"https://api.github.com/users/seven-phases-max/followers","following_url":"https://api.github.com/users/seven-phases-max/following{/other_user}","gists_url":"https://api.github.com/users/seven-phases-max/gists{/gist_id}","starred_url":"https://api.github.com/users/seven-phases-max/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seven-phases-max/subscriptions","organizations_url":"https://api.github.com/users/seven-phases-max/orgs","repos_url":"https://api.github.com/users/seven-phases-max/repos","events_url":"https://api.github.com/users/seven-phases-max/events{/privacy}","received_events_url":"https://api.github.com/users/seven-phases-max/received_events","type":"User","site_admin":false},"created_at":"2015-03-16T23:41:39Z","updated_at":"2015-03-16T23:41:39Z","body":">The testcase attempts to run: `saturation([color]);`\r\n\r\nI'm not quite sure what I understand you mean, the tests fail at [`saturate(5%)`](https://github.com/oyejorge/less.php/blob/master/test/Fixtures/lessjs/less/functions.less#L38) (and, yes, this is what is broken by this PR).\r\n`saturation(color)` is tested at [L79](https://github.com/oyejorge/less.php/blob/master/test/Fixtures/lessjs/less/functions.less#L79) and it's OK.\r\nNote these are three different things:\r\n```\r\n1: saturate(5%);      // CSS filter\r\n2: saturate(red, %5); // Less function\r\n3: saturation(red);   // Less function\r\n```"}}