{"action":"created","issue":{"url":"https://api.github.com/repos/Respect/Validation/issues/436","labels_url":"https://api.github.com/repos/Respect/Validation/issues/436/labels{/name}","comments_url":"https://api.github.com/repos/Respect/Validation/issues/436/comments","events_url":"https://api.github.com/repos/Respect/Validation/issues/436/events","html_url":"https://github.com/Respect/Validation/issues/436","id":110404035,"number":436,"title":"Bug oneOf","user":{"login":"silverpark","id":726933,"avatar_url":"https://avatars.githubusercontent.com/u/726933?v=3","gravatar_id":"","url":"https://api.github.com/users/silverpark","html_url":"https://github.com/silverpark","followers_url":"https://api.github.com/users/silverpark/followers","following_url":"https://api.github.com/users/silverpark/following{/other_user}","gists_url":"https://api.github.com/users/silverpark/gists{/gist_id}","starred_url":"https://api.github.com/users/silverpark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silverpark/subscriptions","organizations_url":"https://api.github.com/users/silverpark/orgs","repos_url":"https://api.github.com/users/silverpark/repos","events_url":"https://api.github.com/users/silverpark/events{/privacy}","received_events_url":"https://api.github.com/users/silverpark/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Respect/Validation/labels/Support","name":"Support","color":"02d7e1"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-08T09:13:16Z","updated_at":"2015-10-08T14:29:21Z","closed_at":"2015-10-08T14:20:14Z","body":"Hi,\r\n\r\nI have a new bug about ``oneOf``, simple exemple for found this bug :\r\n```php\r\nv::create()\r\n            ->key(\r\n                'mode',\r\n                v::string()->notEmpty(),\r\n                true\r\n            )\r\n            ->oneOf(\r\n                v::key(\r\n                    'mode',\r\n                    v::contains('email'),\r\n                    true\r\n                )->key('apply_email', v::email(), true),\r\n\r\n                v::key(\r\n                    'mode',\r\n                    v::contains('URL'),\r\n                    true\r\n                )->key('apply_url', v::url(), true)\r\n            )->validate($input);\r\n```\r\n\r\nIf I run validation of :\r\n```php\r\n$input = array(\r\n    \"application\" => array(\r\n        \"mode\" => \"email\",\r\n        \"apply_url\" => \"http://mycompany.com/AM-1234\",\r\n    ),\r\n);\r\n```\r\n\r\nI receive \r\n```\r\n(Key apply_email must be present)\r\n```\r\n\r\nBut If I run validation of :\r\n```php\r\n$input = array(\r\n    \"application\" => array(\r\n        \"mode\" => \"url\",\r\n        \"apply_email\" => \"am-1234@mycompany.com\",\r\n    ),\r\n);\r\n```\r\n\r\nI receive :\r\n```\r\n(\\\"url\\\" must contain the value \\\"email\\\")\r\n```\r\n\r\nIt is normal ? If yes, why ?\r\n"},"comment":{"url":"https://api.github.com/repos/Respect/Validation/issues/comments/146563612","html_url":"https://github.com/Respect/Validation/issues/436#issuecomment-146563612","issue_url":"https://api.github.com/repos/Respect/Validation/issues/436","id":146563612,"user":{"login":"silverpark","id":726933,"avatar_url":"https://avatars.githubusercontent.com/u/726933?v=3","gravatar_id":"","url":"https://api.github.com/users/silverpark","html_url":"https://github.com/silverpark","followers_url":"https://api.github.com/users/silverpark/followers","following_url":"https://api.github.com/users/silverpark/following{/other_user}","gists_url":"https://api.github.com/users/silverpark/gists{/gist_id}","starred_url":"https://api.github.com/users/silverpark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silverpark/subscriptions","organizations_url":"https://api.github.com/users/silverpark/orgs","repos_url":"https://api.github.com/users/silverpark/repos","events_url":"https://api.github.com/users/silverpark/events{/privacy}","received_events_url":"https://api.github.com/users/silverpark/received_events","type":"User","site_admin":false},"created_at":"2015-10-08T14:29:21Z","updated_at":"2015-10-08T14:29:21Z","body":"I have a big contraints of use ``check()`` and ``assert()`` ?\r\n\r\nYou told me #425 : \r\n\r\n- Any way, if you use check() instead of assert() you're gonna get this message but not wall the failures will be shown.\r\n\r\n- Personally I use check() for most cases, because assert() doesn't display a very user friendly message, IMO.\r\n\r\nBut you told me here :\r\n\r\n- Using check() method and it throws the first exception thrown in the stack. See the order:\r\n\r\nHave you a solution for this problem ?\r\n"}}