Improve parsing of parameters when giving them back

Update some things to php 8
This commit is contained in:
Tim
2022-02-01 21:46:27 +01:00
parent dacf3d6687
commit a2fe3584be
4 changed files with 43 additions and 72 deletions

View File

@ -23,7 +23,7 @@ abstract class BaseController extends AbstractController
$data = [];
foreach ($configuration as $config) {
$name = $config['name'];
$data[$name] = $this->valueParser($config['type'], $param->get($name, false));
$data[$name] = $param->get($name, false);
}
// build the form
@ -55,16 +55,6 @@ abstract class BaseController extends AbstractController
]);
}
private function valueParser($type, $value)
{
switch ($type) {
case CheckboxType::class:
return boolval($value);
default:
return $value;
}
}
/**
* @param $config
* @param FormBuilderInterface $formBuilder