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 5531758
Show file tree
Hide file tree
Showing 2 changed files with 20 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
25 changes: 18 additions & 7 deletions src/Tracing/Serializer/Normalizer/ErrorNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,31 @@

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);
}
}

public function getSupportedTypes(?string $format): array

Check failure on line 32 in src/Tracing/Serializer/Normalizer/ErrorNormalizer.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1)

Method Instrumentation\Tracing\Serializer\Normalizer\ErrorNormalizer::getSupportedTypes() return type has no value type specified in iterable type array.

Check failure on line 32 in src/Tracing/Serializer/Normalizer/ErrorNormalizer.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1)

Method Instrumentation\Tracing\Serializer\Normalizer\ErrorNormalizer::getSupportedTypes() return type has no value type specified in iterable type array.
{
return [
FlattenException::class => __CLASS__ === self::class,
];
}

/**
* @param array<mixed> $context
*
Expand Down Expand Up @@ -52,9 +68,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 5531758

Please sign in to comment.