{"action":"created","issue":{"url":"https://api.github.com/repos/Respect/Validation/issues/173","labels_url":"https://api.github.com/repos/Respect/Validation/issues/173/labels{/name}","comments_url":"https://api.github.com/repos/Respect/Validation/issues/173/comments","events_url":"https://api.github.com/repos/Respect/Validation/issues/173/events","html_url":"https://github.com/Respect/Validation/pull/173","id":32765904,"number":173,"title":"notEmpty fix","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/BC%20Break","name":"BC Break","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/Respect/Validation/milestones/4","html_url":"https://github.com/Respect/Validation/milestones/Backlog","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":13,"closed_issues":8,"state":"open","created_at":"2014-02-16T19:28:45Z","updated_at":"2015-02-19T21:42:49Z","due_on":null,"closed_at":null},"comments":30,"created_at":"2014-05-04T10:28:18Z","updated_at":"2015-06-03T16:30:22Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Respect/Validation/pulls/173","html_url":"https://github.com/Respect/Validation/pull/173","diff_url":"https://github.com/Respect/Validation/pull/173.diff","patch_url":"https://github.com/Respect/Validation/pull/173.patch"},"body":"For strings only: notEmpty now means \"there was content supplied\", rather than \"the content was not empty according to the php empty function\".\r\n\r\nEffect: notEmpty no longer validates to false when string \"0\" is supplied.\r\n\r\nThis make more sense when validating HTML forms.\r\n\r\nRelated issue: https://github.com/Respect/Validation/issues/154\r\n\r\n## Backward Compatibility Break\r\n\r\nCurrently the `notEmpty` rule works like:\r\n\r\n```php\r\nv::int()->notEmpty()->validate(0); //false\r\nv::int()->notEmpty()->validate(\"0\"); //false\r\n```\r\n\r\nIf this PR is accepted:\r\n\r\n```php\r\nv::int()->notEmpty()->validate(0); //false\r\nv::int()->notEmpty()->validate(\"0\"); //true <-- BC Break\r\n```\r\n\r\n## Missing on this PR\r\n\r\nIf this PR gets accepted by other members, it still misses some stuff which I will point out just for the sake of not trusting my memory:\r\n\r\n- [ ] Test to ensure current behavior.\r\n- [ ] Test checking behavior using different types (string, int, float, boolean) to check for empty values.\r\n- [ ] Change on README.\r\n- [ ] Better short commit message (Ex: \"NotEmpty returns true to 0 (zero) for strings.\")."},"comment":{"url":"https://api.github.com/repos/Respect/Validation/issues/comments/108512207","html_url":"https://github.com/Respect/Validation/pull/173#issuecomment-108512207","issue_url":"https://api.github.com/repos/Respect/Validation/issues/173","id":108512207,"user":{"login":"bmorg","id":842699,"avatar_url":"https://avatars.githubusercontent.com/u/842699?v=3","gravatar_id":"","url":"https://api.github.com/users/bmorg","html_url":"https://github.com/bmorg","followers_url":"https://api.github.com/users/bmorg/followers","following_url":"https://api.github.com/users/bmorg/following{/other_user}","gists_url":"https://api.github.com/users/bmorg/gists{/gist_id}","starred_url":"https://api.github.com/users/bmorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmorg/subscriptions","organizations_url":"https://api.github.com/users/bmorg/orgs","repos_url":"https://api.github.com/users/bmorg/repos","events_url":"https://api.github.com/users/bmorg/events{/privacy}","received_events_url":"https://api.github.com/users/bmorg/received_events","type":"User","site_admin":false},"created_at":"2015-06-03T16:30:22Z","updated_at":"2015-06-03T16:30:22Z","body":"@henriquemoody What would the three validators return for an integer value of -1?"}}