type validation adjusted

This one is related with this [issue](https://github.com/yiisoft/yii2/issues/3774) .
I'm fine with extracting type comparison into methods because there is possibility that you may need to override them to customize the behavior. But turning a simple comparison into a method doesn't make the code easier to read and is meaningless.