It is not required by default when you set the "when" attribute
Fixes #4519: `yii\base\Model::isAttributeRequired()` should check if the `when` option of the validator is set