mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
DX: fix contravariant type-hinting on ThirdPartyNormalizer
This commit is contained in:
@@ -15,6 +15,7 @@ use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
||||
use Chill\ThirdPartyBundle\Entity\ThirdPartyCategory;
|
||||
use Chill\ThirdPartyBundle\Templating\Entity\ThirdPartyRender;
|
||||
use Symfony\Component\Serializer\Exception\UnexpectedValueException;
|
||||
use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface;
|
||||
use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait;
|
||||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
|
||||
@@ -35,12 +36,12 @@ class ThirdPartyNormalizer implements NormalizerAwareInterface, NormalizerInterf
|
||||
$this->translatableStringHelper = $translatableStringHelper;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ThirdParty $thirdParty
|
||||
* @param string|null $format
|
||||
*/
|
||||
public function normalize($thirdParty, $format = null, array $context = [])
|
||||
{
|
||||
if (!$thirdParty instanceof ThirdParty) {
|
||||
throw new UnexpectedValueException();
|
||||
}
|
||||
|
||||
return [
|
||||
'type' => 'thirdparty',
|
||||
'firstname' => $thirdParty->getFirstname(),
|
||||
|
Reference in New Issue
Block a user