{"action":"created","issue":{"url":"https://api.github.com/repos/Respect/Validation/issues/174","labels_url":"https://api.github.com/repos/Respect/Validation/issues/174/labels{/name}","comments_url":"https://api.github.com/repos/Respect/Validation/issues/174/comments","events_url":"https://api.github.com/repos/Respect/Validation/issues/174/events","html_url":"https://github.com/Respect/Validation/issues/174","id":32766104,"number":174,"title":"Feature request: not() on individual validator","user":{"login":"flip111","id":2244480,"avatar_url":"https://avatars.githubusercontent.com/u/2244480?v=3","gravatar_id":"","url":"https://api.github.com/users/flip111","html_url":"https://github.com/flip111","followers_url":"https://api.github.com/users/flip111/followers","following_url":"https://api.github.com/users/flip111/following{/other_user}","gists_url":"https://api.github.com/users/flip111/gists{/gist_id}","starred_url":"https://api.github.com/users/flip111/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flip111/subscriptions","organizations_url":"https://api.github.com/users/flip111/orgs","repos_url":"https://api.github.com/users/flip111/repos","events_url":"https://api.github.com/users/flip111/events{/privacy}","received_events_url":"https://api.github.com/users/flip111/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Respect/Validation/labels/Support","name":"Support","color":"02d7e1"}],"state":"open","locked":false,"assignee":{"login":"augustohp","id":188613,"avatar_url":"https://avatars.githubusercontent.com/u/188613?v=3","gravatar_id":"","url":"https://api.github.com/users/augustohp","html_url":"https://github.com/augustohp","followers_url":"https://api.github.com/users/augustohp/followers","following_url":"https://api.github.com/users/augustohp/following{/other_user}","gists_url":"https://api.github.com/users/augustohp/gists{/gist_id}","starred_url":"https://api.github.com/users/augustohp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/augustohp/subscriptions","organizations_url":"https://api.github.com/users/augustohp/orgs","repos_url":"https://api.github.com/users/augustohp/repos","events_url":"https://api.github.com/users/augustohp/events{/privacy}","received_events_url":"https://api.github.com/users/augustohp/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/Respect/Validation/milestones/4","labels_url":"https://api.github.com/repos/Respect/Validation/milestones/4/labels","id":570934,"number":4,"title":"Backlog","description":null,"creator":{"login":"augustohp","id":188613,"avatar_url":"https://avatars.githubusercontent.com/u/188613?v=3","gravatar_id":"","url":"https://api.github.com/users/augustohp","html_url":"https://github.com/augustohp","followers_url":"https://api.github.com/users/augustohp/followers","following_url":"https://api.github.com/users/augustohp/following{/other_user}","gists_url":"https://api.github.com/users/augustohp/gists{/gist_id}","starred_url":"https://api.github.com/users/augustohp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/augustohp/subscriptions","organizations_url":"https://api.github.com/users/augustohp/orgs","repos_url":"https://api.github.com/users/augustohp/repos","events_url":"https://api.github.com/users/augustohp/events{/privacy}","received_events_url":"https://api.github.com/users/augustohp/received_events","type":"User","site_admin":false},"open_issues":19,"closed_issues":5,"state":"open","created_at":"2014-02-16T19:28:45Z","updated_at":"2015-01-14T21:35:39Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2014-05-04T10:41:15Z","updated_at":"2015-01-19T20:56:57Z","closed_at":null,"body":"If you want to validate something is not `\"\"` (an empty striing) and is an integer then you have to write:\r\n\r\n```\r\ntry {\r\n\tv::not(v::equals(''))->setName('test')->assert('0');\r\n\tv::int()->setName('test')->assert('0');\r\n} catch (\\InvalidArgumentException $e) {\r\n\techo $e->getFullMessage();\r\n}\r\n```\r\nNote: `int()` doesn't check for empty string values\r\n\r\n\r\nBecause the `not()` affects the entire chain. If it were possible to put `not()` on a single validator one could write:\r\n\r\n```\r\ntry {\r\n\tv::not(v::equals(''))->int()->setName('test')->assert('0');\r\n} catch (\\InvalidArgumentException $e) {\r\n\techo $e->getFullMessage();\r\n}\r\n```\r\n\r\nBut this throw the following error: `Fatal error: Call to undefined method Respect\\Validation\\Rules\\Not::int()`"},"comment":{"url":"https://api.github.com/repos/Respect/Validation/issues/comments/70559189","html_url":"https://github.com/Respect/Validation/issues/174#issuecomment-70559189","issue_url":"https://api.github.com/repos/Respect/Validation/issues/174","id":70559189,"user":{"login":"henriquemoody","id":154023,"avatar_url":"https://avatars.githubusercontent.com/u/154023?v=3","gravatar_id":"","url":"https://api.github.com/users/henriquemoody","html_url":"https://github.com/henriquemoody","followers_url":"https://api.github.com/users/henriquemoody/followers","following_url":"https://api.github.com/users/henriquemoody/following{/other_user}","gists_url":"https://api.github.com/users/henriquemoody/gists{/gist_id}","starred_url":"https://api.github.com/users/henriquemoody/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henriquemoody/subscriptions","organizations_url":"https://api.github.com/users/henriquemoody/orgs","repos_url":"https://api.github.com/users/henriquemoody/repos","events_url":"https://api.github.com/users/henriquemoody/events{/privacy}","received_events_url":"https://api.github.com/users/henriquemoody/received_events","type":"User","site_admin":false},"created_at":"2015-01-19T20:56:57Z","updated_at":"2015-01-19T20:56:57Z","body":"This is happening because the `not()` shortcut which was [described](https://github.com/Respect/Validation/blob/master/library/Validator.php#L152-L154) by @alganet in #241"}}