Fix type-hinting of DocGenObjectNormalizer and related

This commit is contained in:
2023-11-21 13:37:23 +01:00
parent c855d0badc
commit 63124f8f92
2 changed files with 10 additions and 6 deletions

View File

@@ -11,14 +11,14 @@ declare(strict_types=1);
namespace Chill\DocGeneratorBundle\Serializer\Helper;
use Symfony\Component\Serializer\Mapping\ClassMetadata;
use Symfony\Component\Serializer\Mapping\ClassMetadataInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
class NormalizeNullValueHelper
{
public function __construct(private readonly NormalizerInterface $normalizer, private readonly ?string $discriminatorType = null, private readonly ?string $discriminatorValue = null) {}
public function normalize(array $attributes, string $format = 'docgen', ?array $context = [], ClassMetadata $classMetadata = null)
public function normalize(array $attributes, string $format = 'docgen', ?array $context = [], ClassMetadataInterface $classMetadata = null)
{
$data = [];
$data['isNull'] = true;
@@ -44,7 +44,7 @@ class NormalizeNullValueHelper
return $data;
}
private function getContextForAttribute(string $key, array $initialContext, ?ClassMetadata $classMetadata): array
private function getContextForAttribute(string $key, array $initialContext, ?ClassMetadataInterface $classMetadata): array
{
if (null === $classMetadata) {
return $initialContext;