tbn/getter-trait-bundle
tbn/getter-trait-bundle provides reusable PHP traits for adding getter methods to your classes. It reduces boilerplate, keeps property access consistent, and works smoothly in Laravel or standalone PHP projects.
What it appears to be: tbn/getter-trait-bundle is a Symfony bundle (the -bundle suffix and tbn vendor namespace indicate Symfony, not Laravel) that ships PHP traits intended to supply getter methods to classes — most plausibly entity/DTO/value-object classes. Assessment below is based on package metadata and naming conventions; source review is a prerequisite before any adoption decision, since documentation and community signal are effectively absent.
Architecture fit: Low architectural weight by design. Traits are compile-time inclusions with no container services, no kernel event listeners assumed, and no persistence coupling. That makes it a leaf dependency in the domain layer rather than an infrastructure concern — attractive from a coupling standpoint. However, the fit is conditional on the consuming application being Symfony. If the target stack is Laravel, a Symfony bundle is a stack mismatch: bundles depend on symfony/http-kernel and the bundle registration lifecycle, which Laravel does not provide. In a Laravel context, only the underlying trait files could be copied out, at which point you are maintaining a fork rather than consuming a package.
Integration feasibility: Mechanically trivial — composer require, register the bundle in config/bundles.php (likely no Flex recipe given the adoption level), and use the trait in target classes. Blast radius is opt-in per class, which is the strongest argument in its favor: adoption can be trialed on a single DTO and reverted with one line. The real feasibility question is not "can we install it" but "does it behave correctly inside our existing serialization and ORM pipeline."
Technical risk: High, and concentrated in maintenance rather than runtime. Two stars and zero dependents means no production validation signal, no third-party bug reports, and no ecosystem pressure to keep it current with Symfony majors. Single-maintainer bus factor of one. Specific technical unknowns: whether getters are generated via reflection at runtime or resolved statically; interaction with typed/readonly properties under PHP 8.1+; collision behavior when a class already declares a getter; compatibility with Symfony's PropertyAccess, ObjectNormalizer, and Doctrine hydration, all of which probe accessors reflectively and can be sensitive to magic __call-based implementations. Supply-chain risk is low in absolute terms (small surface, MIT, no network or filesystem code expected) but non-zero given an unvetted maintainer.
Key questions to resolve before commitment:
composer.json, and is the 2025-09-19 release a compatibility bump or a feature release?__call, or rely on reflection? This determines static-analysis and IDE support.readonly?Stack fit: Approved only for Symfony applications on a PHP version explicitly covered by the package's constraints. For Laravel or framework-agnostic PHP codebases, treat this as source material, not a dependency — vendor the trait files with attribution and own them internally. That converts an unmaintained dependency into ~50 lines of code you control, which is almost certainly the correct trade for a package of this size.
Migration path: Effectively zero-risk. Adoption is additive (use SomeGetterTrait;), carries no schema, config, or data migration, and rollback is deletion of the trait usage plus composer remove. No forward migration burden is created — the codebase remains valid without the package.
Compatibility: Verify in a scratch Symfony app before touching production code. Run composer why-not against the target framework version, then exercise the trait against a representative entity through the serializer and Doctrine to confirm accessor discovery still works. Run PHPStan or Psalm at the project's existing level to confirm the trait does not degrade static analysis — this is the most likely failure point.
Sequencing:
__call).Maintenance: The dominant cost. With two stars and zero dependents, expect to be the de facto maintainer. Budget for a source audit at each Symfony major upgrade and a contingency plan to fork. The effective cost per line of value delivered is poor — this package replaces boilerplate getters, work that modern IDEs and PHP 8 constructor promotion largely eliminate already.
Support: No community, no issue history of substance, no Stack Overflow corpus. Support means reading source. Acceptable only if the team has a PHP developer comfortable with traits and Symfony bundle internals; unacceptable if the team will file tickets into a void.
Scaling: Runtime impact is likely negligible if traits are compile-time includes. If getters resolve through __call or reflection on every invocation, there is a per-call cost that will show up in hot paths (serialization of large collections, API list endpoints). Benchmark before wide adoption; do not assume.
Failure modes, ranked:
ObjectNormalizer, altering API response shape. Detected only by contract tests.Ramp-up: Near zero for anyone who knows PHP traits — one trait import, no configuration, no runtime concept to learn. The real ramp-up cost is organizational: someone must own the decision to depend on an unmaintained package, document why, and monitor it. Assign that owner explicitly or the dependency will drift unmanaged.
TPM recommendation: Do not adopt as a runtime dependency. Either vendor the trait source internally (preserving the MIT notice) or, more likely, close the requirement — PHP 8 constructor promotion and IDE generation already solve the stated problem with zero dependency risk. The package is technically harmless and architecturally clean, but its adoption signal is too thin to justify a supply-chain commitment for boilerplate elimination.
How can I help you explore Laravel packages today?