type validation adjusted

This one is related with this [issue](https://github.com/yiisoft/yii2/issues/3774) .
Yes, it's better we rename `types` to `extensions`. This requires updating UPGRADE.