Refactor point value object and add observability

This commit is contained in:
Bernard Ngandu
2025-10-10 14:55:36 +02:00
parent 8a43d3967c
commit 68eb54995f
46 changed files with 3691 additions and 229 deletions
@@ -0,0 +1,18 @@
<?php
declare(strict_types=1);
namespace App\Exception;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Attribute\WithHttpStatus;
use function sprintf;
#[WithHttpStatus(Response::HTTP_UNPROCESSABLE_ENTITY, headers: ['x-error-code' => 'point_too_far'])]
final class PointTooFarException extends \RuntimeException
{
public function __construct(float $maximumDistanceKm)
{
parent::__construct(sprintf('The submitted point must be within %.2fkm of your location.', $maximumDistanceKm));
}
}