toro/api-bundle
A Symfony bundle that integrates the Toro API framework into your application, wiring services and configuration so you can define, expose, and manage API endpoints using standard Symfony bundle conventions.
This is a low-traffic, single-maintainer Symfony bundle (ToroApiBundle) whose last tagged release is from July 2017 — before Symfony 4. Treat it as a legacy integration bundle, not a maintained SDK.
First steps:
Inspect before installing. Since there is no documentation surface (0 stars, 0 dependents), open the repo and look in this order:
composer.json → required Symfony version, PHP version, and any API client dependency it wraps.DependencyInjection/ → confirm the extension alias (toro_api, config keys, and service IDs it registers).Resources/config/services.yml → the actual services you will autowire or pull from the container.Controller/ or Api/ → whether it ships HTTP endpoints or just a client wrapper.Install into the correct Symfony version. The bundle predates Symfony 4 flex recipes, so expect to register it manually:
// app/AppKernel.php (Symfony 2.8/3.x)
new Toro\ApiBundle\ToroApiBundle(),
For Symfony 4+ you will likely need config/bundles.php plus a config/packages/toro_api.yaml file — and you may need to test whether the container extension still compiles against the modern symfony/dependency-injection.
Find the first entry point. The first use case is almost always “call the Toro API through the injected client service rather than writing a raw Guzzle call.” Grep for the service that implements the client interface and inject it:
public function __construct(ToroApiClient $client) { $this->client = $client; }
Smoke-test against a sandbox before wiring it into a controller. Given the release age, verify the transport (likely Guzzle 5/6) still resolves with your installed Guzzle version.
Inject the client, don't new it. The bundle exists to centralise auth, base URI, and error mapping. Pull the registered service from the container and inject an interface where one exists.
Wrap calls in a thin domain service. Because the bundle is unmaintained, isolate it behind your own ToroGateway class so a future swap doesn't ripple through controllers:
final class ToroGateway
{
public function __construct(private ToroApiClient $client) {}
public function createOrder(array $payload): OrderResult
{
return OrderResult::fromResponse($this->client->post('/orders', $payload));
}
}
Configuration via the bundle extension. Put credentials in config/packages/toro_api.yaml (or app/config/config.yml on older Symfony), reference env vars, and let the Configuration.php file validate required keys. If the bundle's Configuration class is thin, add your own validation in a compiler pass.
Request/response DTOs. Old API bundles typically return associative arrays from Guzzle. Map them into typed DTOs at the boundary so you regain IDE completion and refactorability.
Event/exception mapping. Route the bundle's exceptions through Symfony's kernel.exception listener to produce consistent HTTP responses — do not leak raw Guzzle exception messages to API consumers.
Testing pattern. Mock the client interface in unit tests, and use a recorded HTTP fixture (vcr-style) for the bundle's real transport to catch breaking API changes during test runs.
Integration with console commands. For batch sync jobs (e.g., nightly reconciliation), consume the same injected client from a command; the bundle already holds auth config, so avoid duplicating credentials.
composer why-not before committing.setFactory, app/console, and AppKernel idioms; plan for a manual registration shim or a fork.~5.0 or ~6.0), you may get conflicting guzzlehttp/psr7 requirements. Use Composer's replace/conflict or a composer update --with-dependencies dry run to confirm.DependencyInjection/Configuration.php line-by-line — key names (toro_api.api_key, toro_api.base_url?) are the only source of truth, and typos surface as silent null clients rather than errors.ApiException, losing HTTP status codes. Parse getPrevious()/response status yourself and log the raw body before re-throwing.$container->getDefinition('toro.api.client') args in a test container; enable Guzzle's debug handler via a config flag if exposed; log outgoing payloads with a subscriber rather than editing vendored code.Configuration class in a fork, (c) add a compiler pass for custom headers. Forking is a legitimate strategy here given the maintenance state — vendor-patch and track the diff.Bottom line: usable as a reference implementation for the Toro API's expected request shapes, but treat it as a starting point you own and will maintain — vendor it (or fork it) and wrap it, rather than depending on it directly.
How can I help you explore Laravel packages today?