{"action":"created","issue":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/13269","repository_url":"https://api.github.com/repos/yiisoft/yii2","labels_url":"https://api.github.com/repos/yiisoft/yii2/issues/13269/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/13269/comments","events_url":"https://api.github.com/repos/yiisoft/yii2/issues/13269/events","html_url":"https://github.com/yiisoft/yii2/issues/13269","id":197299303,"number":13269,"title":"createValidator, error with $type as array","user":{"login":"XeuRun","id":1073935,"avatar_url":"https://avatars.githubusercontent.com/u/1073935?v=3","gravatar_id":"","url":"https://api.github.com/users/XeuRun","html_url":"https://github.com/XeuRun","followers_url":"https://api.github.com/users/XeuRun/followers","following_url":"https://api.github.com/users/XeuRun/following{/other_user}","gists_url":"https://api.github.com/users/XeuRun/gists{/gist_id}","starred_url":"https://api.github.com/users/XeuRun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/XeuRun/subscriptions","organizations_url":"https://api.github.com/users/XeuRun/orgs","repos_url":"https://api.github.com/users/XeuRun/repos","events_url":"https://api.github.com/users/XeuRun/events{/privacy}","received_events_url":"https://api.github.com/users/XeuRun/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-12-23T01:30:04Z","updated_at":"2016-12-26T09:46:55Z","closed_at":null,"body":"Method createValidator has check\r\n```\r\nif (is_array($type)) {\r\n    $params = array_merge($type, $params);\r\n} else {\r\n    $params['class'] = $type;\r\n}\r\n```\r\n\r\n### What steps will reproduce the problem?\r\n\r\n```\r\npublic function rules()\r\n{\r\n    return [\r\n        [\r\n            'custom_field',\r\n            ['class' => ValuesRemoteValidator::className()],\r\n            'custom_url' => '',\r\n            'custom_fields' => []\r\n        ]\r\n    ];\r\n}\r\n```\r\n\r\n### What is the expected result?\r\n\r\nCreate validator with class ValuesRemoteValidator::className()\r\n\r\n### What do you get instead?\r\n\r\nError, because `$model->hasMethod($type)` accepts a parameter $type as string, and `isset(static::$builtInValidators[$type]))` also cause an error\r\n\r\nhttps://github.com/yiisoft/yii2/blob/2.0.10/framework/validators/Validator.php#L203\r\n\r\n### Additional info\r\n\r\n| Q                          | A\r\n| ------------------- | ---\r\n| Yii version             | 2.0.10\r\n| PHP version          | 7.1.0\r\n| Operating system | Ubuntu 16.04 x64\r\n"},"comment":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/comments/269192679","html_url":"https://github.com/yiisoft/yii2/issues/13269#issuecomment-269192679","issue_url":"https://api.github.com/repos/yiisoft/yii2/issues/13269","id":269192679,"user":{"login":"arogachev","id":8326201,"avatar_url":"https://avatars.githubusercontent.com/u/8326201?v=3","gravatar_id":"","url":"https://api.github.com/users/arogachev","html_url":"https://github.com/arogachev","followers_url":"https://api.github.com/users/arogachev/followers","following_url":"https://api.github.com/users/arogachev/following{/other_user}","gists_url":"https://api.github.com/users/arogachev/gists{/gist_id}","starred_url":"https://api.github.com/users/arogachev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arogachev/subscriptions","organizations_url":"https://api.github.com/users/arogachev/orgs","repos_url":"https://api.github.com/users/arogachev/repos","events_url":"https://api.github.com/users/arogachev/events{/privacy}","received_events_url":"https://api.github.com/users/arogachev/received_events","type":"User","site_admin":false},"created_at":"2016-12-26T09:46:55Z","updated_at":"2016-12-26T09:46:55Z","body":"@XeuRun Sorry, but you wrote that you expect that validator will be created from that config."}}
{"actor":{"display_login":"arogachev"}}