Repository navigation
Contributors cannot verify changes to the framework bridges #169
Description
As a contributor to the PHP API client, I want changes to the Laravel and Symfony bridges to be verifiable before they are merged, so that I can tell whether my change works instead of finding out from a user's broken application.
Use case scenarios
A green build that proves nothing
Mira sends her first pull request to the client. It touches src/Bridge/SymfonyBundle.php, changing how the client is registered with the container. She runs make test locally and pushes; CI reports success. Nothing in that result relates to her change: the bundle has no tests, and phpstan.neon.dist excludes src/Bridge/ from analysis, so neither the test run nor the static analysis ever looked at the file she edited. She has no way to find out whether the DI wiring she wrote is correct, short of building a Symfony application by hand and trying it. She expected the project's own checks to tell her.
A review with nothing to lean on
Jonas reviews that pull request. For any other file in src/ he can read the accompanying test, check that PHPStan runs at level max over it, and see the diff in coverage. For the bridge he has none of that — he is left reading the DI calls and deciding from memory whether setDefinition() with an inline Definition argument behaves the way the author assumes. He approves or blocks on judgement alone, on the two files in the project where he has the least support.
No answer to "which version does this support?"
Jonas wants to add a test for the Symfony bundle and needs to know what to test against. The suggest section of composer.json names symfony/dependency-injection and symfony/http-kernel but gives no version constraint for either, and nothing else in the repository states a supported range. The bridges are documented as a supported feature in the README and in examples/cookbook/09-symfony.php, so users reasonably assume some range is supported — but there is nothing to write a test matrix against.
Agreed Solution & Architecture Decision
To keep maintenance simple while keeping downstream release archives lightweight, we will keep the framework bridges inside this repository rather than splitting them into separate repos.
- Distribution Footprint (
.gitattributes): Addexport-ignorerules fortests/,.github/,docs/, and tooling configs to keepcomposer require zammad/zammad-api-client-phpminimal. - In-Repo Integration Testing: Require framework components in
require-devand build dedicated integration tests undertests/Bridge/Symfony/(using a minimalTestKernel). - Static Analysis & CI: Remove static analysis exclusions (
phpstan.neon.dist) forsrc/Bridge/and test against supported Symfony versions in CI.
Acceptance criteria
- A change that breaks the Symfony bridge's container wiring causes CI to fail.
- Verifying the bridge does not require a running Zammad instance — it exercises DI wiring, not HTTP.
- Static analysis covers the Symfony bridge at the same level as the rest of
src/.- The
excludePathsentry for it inphpstan.neon.distis removed.
- The
- The Symfony bundle's compile-time failure on a missing token can be fixed with confidence that the replacement wiring actually works.
- The coverage report no longer counts the bridges as a gap that nobody is able to close.
- The Symfony versions the bridge supports are stated in
composer.json(suggest/require-dev) and tested in CI. - A follow-up issue exists for the Laravel bridge, covering the same outcomes.
Implementation Tasks
- Package Footprint: Add
.gitattributesto excludetests/,.github/, docs, and dev configs from Composer archives. - Dev Dependencies: Add
symfony/dependency-injectionandsymfony/http-kernel(supported versions) torequire-devincomposer.json. - Static Analysis: Remove
src/Bridge/exclusion fromphpstan.neon.distand ensure PHPStan runs cleanly at Level Max. - Testing: Implement
tests/Bridge/Symfony/TestKernel.phpand integration tests asserting observable container behavior (service registration, lazy definitions, alias resolution). - Fix Regression: Resolve the missing-token compile-time failure using lazy definitions.
- CI Matrix: Update GitHub Actions matrix to run bridge tests against supported Symfony versions.
- Laravel Follow-up: Create a tracking issue for the Laravel bridge.
Contributions are very welcome! If you would like to help resolve this issue, please leave a comment below before opening a PR.
Activity
Auth: trim credentials; withdraw unbacked deprecation notices
Auth: trim credentials; withdraw unbacked deprecation notices
Auth: trim credentials; withdraw unbacked deprecation notices
Auth: trim credentials; withdraw unbacked deprecation notices
Auth: trim credentials; withdraw unbacked deprecation notices
chii0815 commentedon Oct 30, 2026
Just move the bridges to another repo and add PHPUnit for these repos and create some Github Actions.
It would also help with the install process as the dev could do
composer req zammad/zammad-api-bundlethe bundle would then depent onzammad/zammad-api-clientand symfony flex would configure the symfony instance correctly. this could also be done in github actions for this separate repo so it could be tested like any other symfony bundle. As for how to manage to inform the dev what your min symfony version is: This is handled by composer and symfony flex while installing the bundle. Just configure composer to"require": { "php": ">=8.2", "symfony/framework-bundle": "^7.4 || ^8.0" },that would result in an info for the dev that his version is not supported if this version is older than this.
As 7.4.22 is the current LTSR and 8.1.10 is the current stable this would work on any newer symfony instances,
Symfony Best Practices for Reusable Bundes
As my current employer uses an old symfony app on version 4.4.x and the old zammad-api-client with an wrapper and we want to redo this app, I am interested in the symfony bundle and will try to create one if I got the time for it.
For testing the zammad_client inside the bundle or /and the lib you could provide an mock-server. Twitch did the same for their api. If this is done correctly it should be possible to use this in Github Actions.
derpixler commentedon Nov 1, 2026
Thanks for raising this issue!
We’ve updated the issue description above to reflect our decision on this topic. In short, we plan to keep the Symfony bundle within this repository while avoiding extra overhead and keeping release sizes minimal:
.gitattributes): Addexport-ignorerules fortests/,.github/, docs, and tooling configs so Composer releases remain strictly limited to production code.tests/Bridge/Symfony/to ensure full test coverage and static analysis (PHPStan).Contributions are very welcome! If anyone would like to take this on and submit a PR with the
.gitattributesconfiguration and theTestKernelsetup, feel free to drop a comment here and open a PR!Issue changes