mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-26 00:24:59 +00:00
DX: apply rector rules up to php8.0
This commit is contained in:
@@ -44,27 +44,18 @@ class CustomFieldChoice extends AbstractCustomField
|
||||
|
||||
private $defaultLocales;
|
||||
|
||||
/**
|
||||
* @var TwigEngine
|
||||
*/
|
||||
private $templating;
|
||||
|
||||
/**
|
||||
* @var TranslatableStringHelper Helper that find the string in current locale from an array of translation
|
||||
*/
|
||||
private $translatableStringHelper;
|
||||
|
||||
/**
|
||||
* CustomFieldChoice constructor.
|
||||
*/
|
||||
public function __construct(
|
||||
TranslatorInterface $translator,
|
||||
TwigEngine $templating,
|
||||
TranslatableStringHelper $translatableStringHelper
|
||||
private TwigEngine $templating,
|
||||
/**
|
||||
* @var TranslatableStringHelper Helper that find the string in current locale from an array of translation
|
||||
*/
|
||||
private TranslatableStringHelper $translatableStringHelper
|
||||
) {
|
||||
$this->defaultLocales = $translator->getFallbackLocales();
|
||||
$this->templating = $templating;
|
||||
$this->translatableStringHelper = $translatableStringHelper;
|
||||
}
|
||||
|
||||
public function allowOtherChoice(CustomField $cf)
|
||||
@@ -228,7 +219,7 @@ class CustomFieldChoice extends AbstractCustomField
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isChecked(CustomField $cf, $choiceSlug, $data)
|
||||
public function isChecked(CustomField $cf, $choiceSlug, array|string $data)
|
||||
{
|
||||
if (null === $data) {
|
||||
return false;
|
||||
@@ -330,10 +321,9 @@ class CustomFieldChoice extends AbstractCustomField
|
||||
* deserialized the data from the database to a multiple
|
||||
* field.
|
||||
*
|
||||
* @param mixed $serialized
|
||||
* @param bool $allowOther
|
||||
*/
|
||||
private function deserializeToMultiple($serialized, $allowOther)
|
||||
private function deserializeToMultiple(mixed $serialized, $allowOther)
|
||||
{
|
||||
$value = $this->guessValue($serialized);
|
||||
|
||||
@@ -387,7 +377,7 @@ class CustomFieldChoice extends AbstractCustomField
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
private function guessValue($value)
|
||||
private function guessValue(array|string $value)
|
||||
{
|
||||
if (null === $value) {
|
||||
return null;
|
||||
|
Reference in New Issue
Block a user