answear/speedy-pickup-point-bundle
HttpKernel or facade abstraction, but Symfony 8’s stricter typing may introduce edge cases (e.g., Attribute annotations, stricter PSR-15 middleware).FindOffice, GetAllPostcodesRequest) remains Laravel-friendly, but Symfony 8’s dependency injection (DI) changes (e.g., Autowire improvements) may require adjustments to Laravel’s service binding.HttpKernel) may lag behind Symfony 8. Requires explicit dependency:
composer require symfony/http-kernel:^8.0 symfony/dependency-injection:^8.0
ContainerBuilder may complicate manual DI setup in Laravel.| Risk Area | Updated Assessment |
|---|---|
| Symfony-Laravel Gap | High → Critical (Symfony 8’s DI/PSR-15 changes may break Laravel integrations). |
| API Stability | Medium (Speedy.bg API changes still a risk; no bundle-specific changes). |
| Error Handling | Low (Guzzle 7 + Symfony 8’s improved error handling). |
| Testing | Medium (Symfony 8’s stricter typing may expose edge cases; mocking Speedy.bg API is critical). |
| Performance | Low (unchanged; caching still recommended). |
symfony/http-kernel:^8.0 in Laravel’s ecosystem.Attribute annotations for commands (if using facade abstraction).// app/Providers/AppServiceProvider.php
public function register()
{
$this->app->singleton('speedy.client', function () {
return new \Answear\SpeedyBundle\Client(
new \Answear\SpeedyBundle\Config\SpeedyConfig(
env('SPEEDY_USERNAME'),
env('SPEEDY_PASSWORD'),
env('SPEEDY_PRIVATE_KEY')
)
);
});
}
// app/Services/SpeedyClient.php
class SpeedyClient {
public function __construct(private HttpClient $httpClient) {}
public function findOffice(string $postcode): array {
$response = $this->httpClient->post('https://api.speedy.bg/...', [
'json' => ['postcode' => $postcode],
'auth' => [env('SPEEDY_USERNAME'), env('SPEEDY_PASSWORD')],
]);
return json_decode($response->getBody(), true);
}
}
symfony/http-client:^8.0 (if using Option 1) or guzzlehttp/guzzle:^7.0 (Option 2).symfony/http-kernel:^8.0 in a staging environment with Laravel.Client:
// app/Services/SpeedyService.php
class SpeedyService {
public function __construct(private ClientInterface $speedyClient) {}
public function findOffice(string $postcode) {
return $this->speedyClient->execute(new FindOfficeCommand($postcode));
}
}
.env for Symfony 8’s stricter config:
SPEEDY_USERNAME=your_username
SPEEDY_PASSWORD=your_password
SPEEDY_PRIVATE_KEY=your_key
SPEEDY_LANGUAGE=bg # Symfony 8 enforces strict typing for enums
HttpClient mocking:
$this->get(HttpClient::class)->shouldReceive('post')
->once()
->andReturn(new Response(200, [], json_encode(['offices' => [...]))));
Client, ensure middleware (e.g., retries) are PSR-15 compliant.Attribute for annotations (e.g., @Route). Laravel may require polyfills.composer require guzzlehttp/guzzle:^7.0 # Option 2 (recommended)
# OR
composer require symfony/http-client:^8.0 symfony/dependency-injection:^8.0 # Option 1 (risky)
.env and bind the service in Laravel’s container.ContainerBuilder API, PSR-15) may require manual patches in Laravel.symfony/* dependencies to avoid auto-updates until Laravel fully supports Symfony 8.Monolog 3+):
$logger = new \Symfony\Contracts\Service\ServiceSubscriberInterface();
\Log::debug('Speedy API Call', ['data' => $request->getBody()]);
Problem details), but Laravel’s exception handler may need adjustments:
catch (\Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface $e) {
\Log::error('Speedy API Error', ['status' => $e->getResponse()->getStatusCode()]);
throw new \RuntimeException('Logistics service unavailable.');
}
HttpClient includes built-in retry logic. Configure in Laravel:
$client = new \Symfony\Contracts\HttpClient\HttpClient(
new \Sym
How can I help you explore Laravel packages today?