wintercms / wn-translate-plugin

Translate plugin for Winter CMS
MIT License
14 stars 18 forks source link

Add addTranslatableAttributes() method to TranslatableBehavior #42

Closed mjauvin closed 2 years ago

mjauvin commented 2 years ago
LukeTowers commented 2 years ago

@mjauvin can you add a unit test for the different methods of calling that new method?

$model->addTranslatable('single_attribute');
$model->addTranslatable('attribute1', 'attribute2');
$model->addTranslatable(['attribute1', 'attribute2']);

Also we might have to do the union type as mixed in the type hint and the union type in the docblock if we want this plugin to still support v1.1 of Winter like you were mentioning on Discord. Otherwise this will have to be a new major version where we drop v1.1 of Winter.

mjauvin commented 2 years ago

@mjauvin can you add a unit test for the different methods of calling that new method?

$model->addTranslatable('single_attribute');
$model->addTranslatable('attribute1', 'attribute2');
$model->addTranslatable(['attribute1', 'attribute2']);

Will do.

Also we might have to do the union type as mixed in the type hint and the union type in the docblock if we want this plugin to still support v1.1 of Winter like you were mentioning on Discord. Otherwise this will have to be a new major version where we drop v1.1 of Winter.

AFAIK "mixed" is not supported in PHP 7.4