mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-29 10:05:03 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -12,7 +12,6 @@ declare(strict_types=1);
|
||||
namespace Chill\CalendarBundle\Form;
|
||||
|
||||
use Chill\CalendarBundle\Entity\CalendarDoc\CalendarDocEditDTO;
|
||||
use Chill\DocStoreBundle\Form\StoredObjectType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
@@ -21,7 +21,6 @@ use Chill\MainBundle\Form\Type\CommentType;
|
||||
use Chill\MainBundle\Form\Type\PrivateCommentType;
|
||||
use Chill\PersonBundle\Form\DataTransformer\PersonsToIdDataTransformer;
|
||||
use Chill\ThirdPartyBundle\Form\DataTransformer\ThirdPartiesToIdDataTransformer;
|
||||
use DateTimeImmutable;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\CallbackTransformer;
|
||||
@@ -72,42 +71,42 @@ class CalendarType extends AbstractType
|
||||
$builder->add('startDate', HiddenType::class);
|
||||
$builder->get('startDate')
|
||||
->addModelTransformer(new CallbackTransformer(
|
||||
static function (?DateTimeImmutable $dateTimeImmutable): string {
|
||||
static function (?\DateTimeImmutable $dateTimeImmutable): string {
|
||||
if (null !== $dateTimeImmutable) {
|
||||
$res = date_format($dateTimeImmutable, DateTimeImmutable::ATOM);
|
||||
$res = date_format($dateTimeImmutable, \DateTimeImmutable::ATOM);
|
||||
} else {
|
||||
$res = '';
|
||||
}
|
||||
|
||||
return $res;
|
||||
},
|
||||
static function (?string $dateAsString): ?DateTimeImmutable {
|
||||
static function (?string $dateAsString): ?\DateTimeImmutable {
|
||||
if ('' === $dateAsString || null === $dateAsString) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return DateTimeImmutable::createFromFormat(DateTimeImmutable::ATOM, $dateAsString);
|
||||
return \DateTimeImmutable::createFromFormat(\DateTimeImmutable::ATOM, $dateAsString);
|
||||
}
|
||||
));
|
||||
|
||||
$builder->add('endDate', HiddenType::class);
|
||||
$builder->get('endDate')
|
||||
->addModelTransformer(new CallbackTransformer(
|
||||
static function (?DateTimeImmutable $dateTimeImmutable): string {
|
||||
static function (?\DateTimeImmutable $dateTimeImmutable): string {
|
||||
if (null !== $dateTimeImmutable) {
|
||||
$res = date_format($dateTimeImmutable, DateTimeImmutable::ATOM);
|
||||
$res = date_format($dateTimeImmutable, \DateTimeImmutable::ATOM);
|
||||
} else {
|
||||
$res = '';
|
||||
}
|
||||
|
||||
return $res;
|
||||
},
|
||||
static function (?string $dateAsString): ?DateTimeImmutable {
|
||||
static function (?string $dateAsString): ?\DateTimeImmutable {
|
||||
if ('' === $dateAsString || null === $dateAsString) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return DateTimeImmutable::createFromFormat(DateTimeImmutable::ATOM, $dateAsString);
|
||||
return \DateTimeImmutable::createFromFormat(\DateTimeImmutable::ATOM, $dateAsString);
|
||||
}
|
||||
));
|
||||
|
||||
|
Reference in New Issue
Block a user