{"action":"created","issue":{"url":"https://api.github.com/repos/siriusphp/validation/issues/31","labels_url":"https://api.github.com/repos/siriusphp/validation/issues/31/labels{/name}","comments_url":"https://api.github.com/repos/siriusphp/validation/issues/31/comments","events_url":"https://api.github.com/repos/siriusphp/validation/issues/31/events","html_url":"https://github.com/siriusphp/validation/pull/31","id":92546091,"number":31,"title":"Add AbstractRule::getOption()","user":{"login":"kenjis","id":87955,"avatar_url":"https://avatars.githubusercontent.com/u/87955?v=3","gravatar_id":"","url":"https://api.github.com/users/kenjis","html_url":"https://github.com/kenjis","followers_url":"https://api.github.com/users/kenjis/followers","following_url":"https://api.github.com/users/kenjis/following{/other_user}","gists_url":"https://api.github.com/users/kenjis/gists{/gist_id}","starred_url":"https://api.github.com/users/kenjis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kenjis/subscriptions","organizations_url":"https://api.github.com/users/kenjis/orgs","repos_url":"https://api.github.com/users/kenjis/repos","events_url":"https://api.github.com/users/kenjis/events{/privacy}","received_events_url":"https://api.github.com/users/kenjis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-02T04:36:26Z","updated_at":"2015-07-08T02:58:33Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/siriusphp/validation/pulls/31","html_url":"https://github.com/siriusphp/validation/pull/31","diff_url":"https://github.com/siriusphp/validation/pull/31.diff","patch_url":"https://github.com/siriusphp/validation/pull/31.patch"},"body":"I want to add *fatal* rule that stops application.\r\n\r\nFor example, if I validate data on client side, normal users never send invalid data.\r\nIf invalid data comes, it must be an attack. \r\n\r\nThere is no reason to continue processing for attackers. So if a *fatal* rule fails,\r\nI want to stop application immediately.\r\n\r\nIf there is `getOption()`, I can implement like this.\r\n\r\nSet a fatal rule (`'fatal' => true`):\r\n~~~php\r\n$validator->add('field', 'maxlength', ['max' => 3, 'fatal' => true]);\r\n~~~\r\n\r\nCheck fatal rule:\r\n~~~php\r\nif ($rule->getOption('fatal')) {\r\n    throw RuntimeException($rule->getMessage());\r\n}\r\n~~~\r\n"},"comment":{"url":"https://api.github.com/repos/siriusphp/validation/issues/comments/119406167","html_url":"https://github.com/siriusphp/validation/pull/31#issuecomment-119406167","issue_url":"https://api.github.com/repos/siriusphp/validation/issues/31","id":119406167,"user":{"login":"kenjis","id":87955,"avatar_url":"https://avatars.githubusercontent.com/u/87955?v=3","gravatar_id":"","url":"https://api.github.com/users/kenjis","html_url":"https://github.com/kenjis","followers_url":"https://api.github.com/users/kenjis/followers","following_url":"https://api.github.com/users/kenjis/following{/other_user}","gists_url":"https://api.github.com/users/kenjis/gists{/gist_id}","starred_url":"https://api.github.com/users/kenjis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kenjis/subscriptions","organizations_url":"https://api.github.com/users/kenjis/orgs","repos_url":"https://api.github.com/users/kenjis/repos","events_url":"https://api.github.com/users/kenjis/events{/privacy}","received_events_url":"https://api.github.com/users/kenjis/received_events","type":"User","site_admin":false},"created_at":"2015-07-08T02:58:33Z","updated_at":"2015-07-08T02:58:33Z","body":"I know you don't like the idea *fatal* rule, but\r\n\r\n1 -> You say about mistake of normal users. I say about an attack from attackers. It is true to tell attack or not is difficult, but we don't have to discuss how to tell. It is just developers choice.\r\n2 -> Rare is not never.\r\n3 -> Not a must. Of course, it is better fatal rules are processed first.\r\n\r\nAnd this PR is not to add fatal rule, just to add `getOption()`.  Fatal rule is just an explanation why I want to  `getOption()`.\r\n"}}