mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
Fix implicit variable creation.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\ThirdPartyBundle\Serializer\Normalizer;
|
||||
|
||||
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
||||
@@ -20,23 +22,24 @@ class ThirdPartyNormalizer implements NormalizerInterface, NormalizerAwareInterf
|
||||
$this->thirdPartyRender = $thirdPartyRender;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ThirdParty $thirdParty
|
||||
*/
|
||||
public function normalize($thirdParty, string $format = null, array $context = [])
|
||||
{
|
||||
/** @var $thirdParty ThirdParty */
|
||||
$data['type'] = 'thirdparty';
|
||||
$data['text'] = $this->thirdPartyRender->renderString($thirdParty, []);
|
||||
$data['id'] = $thirdParty->getId();
|
||||
$data['kind'] = $thirdParty->getKind();
|
||||
$data['address'] = $this->normalizer->normalize($thirdParty->getAddress(), $format,
|
||||
[ 'address_rendering' => 'short' ]);
|
||||
$data['phonenumber'] = $thirdParty->getTelephone();
|
||||
$data['email'] = $thirdParty->getEmail();
|
||||
$data['isChild'] = $thirdParty->isChild();
|
||||
$data['parent'] = $this->normalizer->normalize($thirdParty->getParent(), $format, $context);
|
||||
$data['civility'] = $this->normalizer->normalize($thirdParty->getCivility(), $format, $context);
|
||||
$data['contactDataAnonymous'] = $thirdParty->isContactDataAnonymous();
|
||||
|
||||
return $data;
|
||||
return [
|
||||
'type' => 'thirdparty',
|
||||
'text' => $this->thirdPartyRender->renderString($thirdParty, []),
|
||||
'id' => $thirdParty->getId(),
|
||||
'kind' => $thirdParty->getKind(),
|
||||
'address' => $this->normalizer->normalize($thirdParty->getAddress(), $format, [ 'address_rendering' => 'short' ]),
|
||||
'phonenumber' => $thirdParty->getTelephone(),
|
||||
'email' => $thirdParty->getEmail(),
|
||||
'isChild' => $thirdParty->isChild(),
|
||||
'parent' => $this->normalizer->normalize($thirdParty->getParent(), $format, $context),
|
||||
'civility' => $this->normalizer->normalize($thirdParty->getCivility(), $format, $context),
|
||||
'contactDataAnonymous' => $thirdParty->isContactDataAnonymous(),
|
||||
];
|
||||
}
|
||||
|
||||
public function supportsNormalization($data, string $format = null)
|
||||
|
Reference in New Issue
Block a user