Skip to content

Commit

Permalink
chore: remove Symfony 6.3 deprecation messages
Browse files Browse the repository at this point in the history
  • Loading branch information
cyve committed Sep 11, 2023
1 parent f71d21a commit 9a282ff
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/Semantics/OperationName/RoutePath/RouteCacheWarmer.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ public function __construct(private RouterInterface $router)
{
}

public function isOptional()
public function isOptional(): bool
{
return true;
}

public function warmUp(string $cacheDir)
public function warmUp(string $cacheDir): array
{
$routes = [];
foreach ($this->router->getRouteCollection() as $name => $route) {
Expand Down
28 changes: 21 additions & 7 deletions src/Tracing/Serializer/Normalizer/ErrorNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,34 @@

use Instrumentation\Tracing\TraceUrlGeneratorInterface;
use OpenTelemetry\SDK\Trace\Span;
use Symfony\Component\Serializer\Normalizer\CacheableSupportsMethodInterface;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
use Symfony\Component\Serializer\SerializerAwareInterface;
use Symfony\Component\Serializer\SerializerInterface;

class ErrorNormalizer implements NormalizerInterface, CacheableSupportsMethodInterface
class ErrorNormalizer implements NormalizerInterface, SerializerAwareInterface
{
public function __construct(private NormalizerInterface $decorated, private bool $addUrl = false, private ?TraceUrlGeneratorInterface $traceUrlGenerator = null)
{
}

public function setSerializer(SerializerInterface $serializer)
{
if ($this->decorated instanceof SerializerAwareInterface) {
$this->decorated->setSerializer($serializer);
}
}

/**
* @return array<class-string, bool>
*/
public function getSupportedTypes(?string $format): array
{
return [
FlattenException::class => __CLASS__ === self::class,
];
}

/**
* @param array<mixed> $context
*
Expand Down Expand Up @@ -52,9 +71,4 @@ public function supportsNormalization($data, string $format = null, array $conte
// @phpstan-ignore-next-line
return $this->decorated->supportsNormalization($data, $format, $context);
}

public function hasCacheableSupportsMethod(): bool
{
return $this->decorated instanceof CacheableSupportsMethodInterface && $this->decorated->hasCacheableSupportsMethod();
}
}

0 comments on commit 9a282ff

Please sign in to comment.