type validation adjusted

This one is related with this [issue](https://github.com/yiisoft/yii2/issues/3774) .
This is case-sensitive comparison, different from original implementation.