{"action":"created","issue":{"url":"https://api.github.com/repos/tanakahisateru/pinoco/issues/71","repository_url":"https://api.github.com/repos/tanakahisateru/pinoco","labels_url":"https://api.github.com/repos/tanakahisateru/pinoco/issues/71/labels{/name}","comments_url":"https://api.github.com/repos/tanakahisateru/pinoco/issues/71/comments","events_url":"https://api.github.com/repos/tanakahisateru/pinoco/issues/71/events","html_url":"https://github.com/tanakahisateru/pinoco/pull/71","id":190008247,"number":71,"title":"EmptyValidator update  to trim values.","user":{"login":"itigoppo","id":1428989,"avatar_url":"https://avatars.githubusercontent.com/u/1428989?v=3","gravatar_id":"","url":"https://api.github.com/users/itigoppo","html_url":"https://github.com/itigoppo","followers_url":"https://api.github.com/users/itigoppo/followers","following_url":"https://api.github.com/users/itigoppo/following{/other_user}","gists_url":"https://api.github.com/users/itigoppo/gists{/gist_id}","starred_url":"https://api.github.com/users/itigoppo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/itigoppo/subscriptions","organizations_url":"https://api.github.com/users/itigoppo/orgs","repos_url":"https://api.github.com/users/itigoppo/repos","events_url":"https://api.github.com/users/itigoppo/events{/privacy}","received_events_url":"https://api.github.com/users/itigoppo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-17T10:40:56Z","updated_at":"2016-11-18T07:24:38Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/tanakahisateru/pinoco/pulls/71","html_url":"https://github.com/tanakahisateru/pinoco/pull/71","diff_url":"https://github.com/tanakahisateru/pinoco/pull/71.diff","patch_url":"https://github.com/tanakahisateru/pinoco/pull/71.patch"},"body":"EmptyValidator update  to trim values."},"comment":{"url":"https://api.github.com/repos/tanakahisateru/pinoco/issues/comments/261466086","html_url":"https://github.com/tanakahisateru/pinoco/pull/71#issuecomment-261466086","issue_url":"https://api.github.com/repos/tanakahisateru/pinoco/issues/71","id":261466086,"user":{"login":"tanakahisateru","id":403893,"avatar_url":"https://avatars.githubusercontent.com/u/403893?v=3","gravatar_id":"","url":"https://api.github.com/users/tanakahisateru","html_url":"https://github.com/tanakahisateru","followers_url":"https://api.github.com/users/tanakahisateru/followers","following_url":"https://api.github.com/users/tanakahisateru/following{/other_user}","gists_url":"https://api.github.com/users/tanakahisateru/gists{/gist_id}","starred_url":"https://api.github.com/users/tanakahisateru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tanakahisateru/subscriptions","organizations_url":"https://api.github.com/users/tanakahisateru/orgs","repos_url":"https://api.github.com/users/tanakahisateru/repos","events_url":"https://api.github.com/users/tanakahisateru/events{/privacy}","received_events_url":"https://api.github.com/users/tanakahisateru/received_events","type":"User","site_admin":false},"created_at":"2016-11-18T07:24:38Z","updated_at":"2016-11-18T07:24:38Z","body":"Pinoco allows overriding built-in rules.\r\n\r\n```php\r\n$emptyCheck = function ($exists, $value) {\r\n    if (!$exists || $value === null) { return true; }\r\n    if ($value === \"0\" || $value === 0 || $value === false || $value === array()) {\r\n        return false;\r\n    }\r\n    if (is_string($value)) {\r\n        $value = trim(mb_convert_kana($value, \"s\", 'UTF-8'));\r\n    }\r\n    return empty($value);\r\n};\r\n\r\n$notEmptyCheck = function ($exists, $value) use ($emptyCheck) {\r\n    return !$emptyCheck($exists, $value);\r\n};\r\n\r\n$validator->defineValidityTest('empty', $emptyCheck, \"Leave empty.\", true);\r\n$validator->defineValidityTest('not-empty', $notEmptyCheck, \"Required.\", true);\r\n```"}}
{"actor":{"display_login":"tanakahisateru"}}