DX: apply rector rulesset up to PHP72

This commit is contained in:
2023-03-29 22:32:52 +02:00
parent 64b8ae3df1
commit b9a7530f7a
110 changed files with 194 additions and 229 deletions

View File

@@ -22,7 +22,7 @@ class Configuration implements ConfigurationInterface
{
$treeBuilder = new TreeBuilder('chill_aside_activity');
$treeBuilder->getRootNode('chill_aside_activity')
$treeBuilder->getRootNode()
->children()
->arrayNode('form')
->canBeEnabled()

View File

@@ -95,9 +95,7 @@ final class AsideActivityFormType extends AbstractType
// the datetimetransformer will then handle timezone as GMT
$timezoneUTC = new DateTimeZone('GMT');
/** @var DateTimeImmutable $data */
$data = $formEvent->getData() === null ?
DateTime::createFromFormat('U', '300') :
$formEvent->getData();
$data = $formEvent->getData() ?? DateTime::createFromFormat('U', '300');
$seconds = $data->getTimezone()->getOffset($data);
$data->setTimeZone($timezoneUTC);
$data->add(new DateInterval('PT' . $seconds . 'S'));