Skip to content

feat: adds Symfony 8 support - #2

Merged
Muneer-Shafi merged 7 commits into
mainfrom
feat/symfony-8-support
Nov 11, 2026
Merged

Muneer-Shafi merged 7 commits into
mainfrom
feat/symfony-8-support

Conversation

@Muneer-Shafi

Copy link
Copy Markdown
Contributor

Summary

  • Makes the SDK installable in Symfony 8 apps (PHP 8.4+), with PSR-7 v2 and Guzzle 8, while keeping support for Symfony 6.4 and 7.x on PHP 8.2+.
  • Raises the minimum guzzlehttp/psr7 to 2.12.3 because earlier releases have security advisories, and changes the Composer license from unlicense to MIT to match the LICENSE file.
  • Sends DateTimeImmutable values, such as those from Symfony Clock, as ISO 8601 dates instead of objects.
  • Reports OIDC login failures as ApiException with the server's reason, and renews the token a minute before it expires.
  • Adds 20 unit tests and a GitHub Actions workflow covering PHP 8.2–8.5, with highest and lowest dependencies. It replaces the Travis config.
  • Fixes the README install and usage examples, adds a Symfony service configuration, and documents the missing Peppol endpoints and models.

Test plan

  • composer test passes on PHP 8.2 with lowest dependencies (Symfony 6.4), on PHP 8.2 and 8.3 (Symfony 7.4), and on PHP 8.4 and 8.5 (Symfony 8.1, Guzzle 8).
  • In a Symfony 8.1 app using the README service configuration, on PHP 8.4 and 8.5:
    • Login works.
    • Sync and async MeApi::getUser calls work.
    • Requests carry the Subscription-Key and Bearer headers.
  • The CI workflow passes on this PR.
  • Login and one API call work against the real PSB test environment. Not yet done, because no credentials were available.

Deferred (separate tickets needed)

Async calls with emulated async clients: the generated *Async() methods fail when the client only wraps synchronous responses in httplug promises (e.g. php-http/mock-client). Symfony's HttplugClient and the Guzzle adapter work. The bug is in code produced by OpenAPI Generator.

Code style in generated files: 33 generated files don't pass the PHP-CS-Fixer ruleset, as before this change, so CI does not run a style check yet.

The package could not be installed in a Symfony 8 app: symfony/clock was
capped at ^7.2 and psr/http-message at ^1.0, while Guzzle 8 and
guzzlehttp/psr7 3.x require PSR-7 v2. guzzlehttp/psr7 is raised to 2.12.3
because earlier releases have published security advisories.
Only \DateTime was recognised, so immutable dates (as returned by Symfony
Clock) were sent as an object of their internal properties.
…ason

Wrong credentials surfaced as a vague "missing access token" error and
network failures leaked client-specific exceptions. Tokens are now renewed
a minute before expiry so requests don't reach the API with a dead token.
The existing generated tests are empty placeholders, so nothing guarded the
hand-patched code or the Symfony HttpClient integration.
The Travis config targeted PHP 7.4 and no longer ran. The new workflow tests
PHP 8.2-8.5 with highest dependencies and PHP 8.2 with lowest. Hand-maintained
files are excluded from SDK regeneration so they aren't overwritten.
The package name and the getting-started example were wrong, and seven
Peppol endpoints and six models were missing from the reference.
@Muneer-Shafi

Copy link
Copy Markdown
Contributor Author

@faizanakram99 please merge this

@Muneer-Shafi
Muneer-Shafi merged commit acac07e into main Nov 11, 2026
5 checks passed
@Muneer-Shafi
Muneer-Shafi deleted the feat/symfony-8-support branch November 11, 2026 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant