type validation adjusted

This one is related with this [issue](https://github.com/yiisoft/yii2/issues/3774) .
it express behavior, also common case for `extract method`, and in previous implementation it was hard to understand code with switch + case where there are a lot of assertions and comparisons. Dont see here any bad things.