claudsonm/cep-promise-php
Resolve Brazilian postal codes (CEP) asynchronously with a promise-based API, querying multiple providers and returning normalized address data. Ideal for Laravel and PHP apps that need reliable, fallback-ready CEP lookups.
Architecture fit
CepPromise::fetch($cep, ?array $providerClasses) fans out to one or more Brazilian postal-code (CEP) lookup providers and normalises their responses. This is a good architectural fit for a service-layer dependency behind a domain-level PostalCodeResolver interface — it does not impose Eloquent models, migrations, or config sprawl, so it can sit at the edge of the application rather than in the core.Integration feasibility
toArray() fix on CepPromiseException is directly relevant to us: exception serialisation into logs, API error payloads, or job failure records is a common integration point, and a toArray() that throws when a provider error is not the expected subclass would have produced secondary failures during incident debugging. Worth noting as a real, if narrow, reliability win.Technical risk
^1.0 with a permissive lockfile could resolve into a version that no longer installs. Mitigation is straightforward — pin the constraint and rely on the lockfile — but it must be explicit, not assumed.fetch fails open or closed determines our error contract.#17 and Portuguese-language release notes suggest a small, single-maintainer project. Bus factor is a genuine concern for a dependency in a customer-facing address flow.Key questions
fetch parameter a list of FQCN strings, interface implementations, or container bindings — and can we pass our own decorator for caching/telemetry?CepPromiseException, or can provider-level exceptions escape fetch?Stack fit
"php": "^8.0", "guzzlehttp/guzzle": "^7.2" in our root composer.json so the resolver cannot drift backwards.Migration path
Compatibility
toArray() fix is behaviour-changing for anyone who was catching and serialising the exception. Audit any log formatter or error-response mapper that touches CepPromiseException and verify the output shape is unchanged for the happy path.Sequencing
~1.2.0 (not ^1.0) and confirm the PHP/Guzzle platform matrix against every runtime we deploy.fetch with an explicit single-provider list to validate the new parameter's semantics — argument type, ordering, failure behaviour — before designing around it.PostalCodeResolver interface and bind it in the container, so no domain code names the package directly.Maintenance
Support
Scaling
Failure modes
toArray() could throw when an error element was not a CepPromiseProviderException, turning an error-handling path into a second error. This is exactly the class of defect that makes incidents worse; its fix is a reason to take this release rather than defer it.Ramp-up
How can I help you explore Laravel packages today?