mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-06 14:54:57 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -13,7 +13,6 @@ namespace Chill\MainBundle\Form\DataMapper;
|
||||
|
||||
use Chill\MainBundle\Entity\Address;
|
||||
use Chill\MainBundle\Entity\PostalCode;
|
||||
use Iterator;
|
||||
use Symfony\Component\Form\DataMapperInterface;
|
||||
use Symfony\Component\Form\Exception\UnexpectedTypeException;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
@@ -26,8 +25,8 @@ use Symfony\Component\Form\FormInterface;
|
||||
class AddressDataMapper implements DataMapperInterface
|
||||
{
|
||||
/**
|
||||
* @param Address $address
|
||||
* @param Iterator $forms
|
||||
* @param Address $address
|
||||
* @param \Iterator $forms
|
||||
*/
|
||||
public function mapDataToForms($address, $forms)
|
||||
{
|
||||
@@ -40,16 +39,16 @@ class AddressDataMapper implements DataMapperInterface
|
||||
}
|
||||
|
||||
foreach ($forms as $key => $form) {
|
||||
/** @var FormInterface $form */
|
||||
/* @var FormInterface $form */
|
||||
switch ($key) {
|
||||
case 'streetAddress1':
|
||||
/** @phpstan-ignore-next-line */
|
||||
/* @phpstan-ignore-next-line */
|
||||
$form->setData($address->getStreetAddress1());
|
||||
|
||||
break;
|
||||
|
||||
case 'streetAddress2':
|
||||
/** @phpstan-ignore-next-line */
|
||||
/* @phpstan-ignore-next-line */
|
||||
$form->setData($address->getStreetAddress2());
|
||||
|
||||
break;
|
||||
@@ -76,8 +75,8 @@ class AddressDataMapper implements DataMapperInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Iterator $forms
|
||||
* @param Address $address
|
||||
* @param \Iterator $forms
|
||||
* @param Address $address
|
||||
*/
|
||||
public function mapFormsToData($forms, &$address)
|
||||
{
|
||||
@@ -94,7 +93,7 @@ class AddressDataMapper implements DataMapperInterface
|
||||
}
|
||||
|
||||
foreach ($forms as $key => $form) {
|
||||
/** @var FormInterface $form */
|
||||
/* @var FormInterface $form */
|
||||
switch ($key) {
|
||||
case 'postCode':
|
||||
if (!$form->getData() instanceof PostalCode && !$isNoAddress) {
|
||||
@@ -112,13 +111,13 @@ class AddressDataMapper implements DataMapperInterface
|
||||
|
||||
return;
|
||||
}
|
||||
/** @phpstan-ignore-next-line */
|
||||
/* @phpstan-ignore-next-line */
|
||||
$address->setStreetAddress1($form->getData());
|
||||
|
||||
break;
|
||||
|
||||
case 'streetAddress2':
|
||||
/** @phpstan-ignore-next-line */
|
||||
/* @phpstan-ignore-next-line */
|
||||
$address->setStreetAddress2($form->getData());
|
||||
|
||||
break;
|
||||
|
@@ -11,14 +11,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\MainBundle\Form\DataMapper;
|
||||
|
||||
use Chill\MainBundle\Entity\Center;
|
||||
use Chill\MainBundle\Entity\Regroupment;
|
||||
use Chill\MainBundle\Repository\RegroupmentRepository;
|
||||
use Exception;
|
||||
use Symfony\Component\Form\DataMapperInterface;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
use function array_key_exists;
|
||||
use function count;
|
||||
|
||||
final readonly class ExportPickCenterDataMapper implements DataMapperInterface
|
||||
{
|
||||
@@ -47,7 +42,7 @@ final readonly class ExportPickCenterDataMapper implements DataMapperInterface
|
||||
$centers[spl_object_hash($center)] = $center;
|
||||
}
|
||||
|
||||
if (array_key_exists('regroupment', $forms)) {
|
||||
if (\array_key_exists('regroupment', $forms)) {
|
||||
/** @var Regroupment $regroupment */
|
||||
foreach ($forms['regroupment']->getData() as $regroupment) {
|
||||
foreach ($regroupment->getCenters() as $center) {
|
||||
|
@@ -38,7 +38,7 @@ class RollingDateDataMapper implements DataMapperInterface
|
||||
$forms = iterator_to_array($forms);
|
||||
|
||||
$viewData = new RollingDate(
|
||||
($forms['roll']->getData() ?? RollingDate::T_TODAY),
|
||||
$forms['roll']->getData() ?? RollingDate::T_TODAY,
|
||||
$forms['fixedDate']->getData()
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user