mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-22 23:53:50 +00:00
Merge remote-tracking branch 'origin/master' into issue706_cc_in_workflow-2
This commit is contained in:
@@ -43,11 +43,13 @@ class AddressDataMapper implements DataMapperInterface
|
||||
/** @var FormInterface $form */
|
||||
switch ($key) {
|
||||
case 'streetAddress1':
|
||||
/** @phpstan-ignore-next-line */
|
||||
$form->setData($address->getStreetAddress1());
|
||||
|
||||
break;
|
||||
|
||||
case 'streetAddress2':
|
||||
/** @phpstan-ignore-next-line */
|
||||
$form->setData($address->getStreetAddress2());
|
||||
|
||||
break;
|
||||
@@ -110,11 +112,13 @@ class AddressDataMapper implements DataMapperInterface
|
||||
|
||||
return;
|
||||
}
|
||||
/** @phpstan-ignore-next-line */
|
||||
$address->setStreetAddress1($form->getData());
|
||||
|
||||
break;
|
||||
|
||||
case 'streetAddress2':
|
||||
/** @phpstan-ignore-next-line */
|
||||
$address->setStreetAddress2($form->getData());
|
||||
|
||||
break;
|
||||
|
@@ -24,15 +24,7 @@ class ExportPickCenterDataMapper implements DataMapperInterface
|
||||
{
|
||||
protected RegroupmentRepository $regroupmentRepository;
|
||||
|
||||
/**
|
||||
* @param array|Center[] $data
|
||||
* @param $forms
|
||||
*
|
||||
* @throws Exception
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function mapDataToForms($data, $forms)
|
||||
public function mapDataToForms($data, $forms): void
|
||||
{
|
||||
if (null === $data) {
|
||||
return;
|
||||
@@ -44,7 +36,9 @@ class ExportPickCenterDataMapper implements DataMapperInterface
|
||||
$pickedRegroupment = [];
|
||||
|
||||
foreach ($this->regroupmentRepository->findAll() as $regroupment) {
|
||||
[$contained, $notContained] = $regroupment->getCenters()->partition(static function (Center $center) {
|
||||
/** @phpstan-ignore-next-line */
|
||||
[$contained, $notContained] = $regroupment->getCenters()->partition(static function (Center $center): bool {
|
||||
return false;
|
||||
});
|
||||
|
||||
if (0 === count($notContained)) {
|
||||
@@ -56,13 +50,7 @@ class ExportPickCenterDataMapper implements DataMapperInterface
|
||||
$form['centers']->setData($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param iterable $forms
|
||||
* @param array $data
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function mapFormsToData($forms, &$data)
|
||||
public function mapFormsToData($forms, &$data): void
|
||||
{
|
||||
/** @var array<string, FormInterface> $forms */
|
||||
$forms = iterator_to_array($forms);
|
||||
@@ -74,8 +62,8 @@ class ExportPickCenterDataMapper implements DataMapperInterface
|
||||
}
|
||||
|
||||
if (array_key_exists('regroupment', $forms)) {
|
||||
/** @var Regroupment $regroupment */
|
||||
foreach ($forms['regroupment']->getData() as $regroupment) {
|
||||
/** @var Regroupment $regroupment */
|
||||
foreach ($regroupment->getCenters() as $center) {
|
||||
$centers[spl_object_hash($center)] = $center;
|
||||
}
|
||||
|
@@ -38,7 +38,7 @@ class RollingDateDataMapper implements DataMapperInterface
|
||||
$forms = iterator_to_array($forms);
|
||||
|
||||
$viewData = new RollingDate(
|
||||
$forms['roll']->getData(),
|
||||
($forms['roll']->getData() ?? RollingDate::T_TODAY),
|
||||
$forms['fixedDate']->getData()
|
||||
);
|
||||
}
|
||||
|
@@ -31,8 +31,6 @@ class MultipleObjectsToIdTransformer implements DataTransformerInterface
|
||||
* Transforms a string (id) to an object (item).
|
||||
*
|
||||
* @param mixed $array
|
||||
*
|
||||
* @return ArrayCollection
|
||||
*/
|
||||
public function reverseTransform($array)
|
||||
{
|
||||
@@ -53,10 +51,8 @@ class MultipleObjectsToIdTransformer implements DataTransformerInterface
|
||||
* Transforms an object (use) to a string (id).
|
||||
*
|
||||
* @param array $array
|
||||
*
|
||||
* @return ArrayCollection
|
||||
*/
|
||||
public function transform($array)
|
||||
public function transform($array): array
|
||||
{
|
||||
$ret = [];
|
||||
|
||||
|
Reference in New Issue
Block a user