Improve parsing of parameters when giving them back
Update some things to php 8
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user