- Is teknoo/states-bundle compatible with Laravel?
- No. It is a Symfony bundle that ships a Bundle subclass wired for Symfony's HttpKernel, a DI compiler pass and a configuration tree, and Laravel has no equivalent bundle, container extension or kernel hook. The TPM assessment rates Laravel integration as low as packaged and says the bundle half cannot be reused without reimplementation. Treat any Laravel use as a pattern reference, not a drop-in dependency.
- Can I install teknoo/states-bundle with Composer in a Laravel app?
- You technically can add it, but dependency resolution is a practical blocker: the bundle's constraints are pinned to Symfony generations, so a modern Laravel composer.json will either fail resolution or pull the full Symfony framework stack in alongside Illuminate. That duplicates HTTP kernel and container concepts and creates a large review surface. The assessment recommends not installing this bundle.
- What is the successor to teknoo/states-bundle?
- The repository is archived and explicitly deprecated by the author, who points consumers at teknoo/states 3.1+. The framework-agnostic library implements the State pattern with attribute-driven configuration and is the realistic evaluation unit. The spike question is whether teknoo/states 3.1+ is actively released or also dormant, since a pointer to a dead successor is not a migration.
- What Laravel alternatives exist for state machines?
- Laravel already has idiomatic options: PHP 8.1 backed enums with transition methods, the Illuminate Pipeline component, or an actively maintained package such as Spatie's model-states. Those follow framework conventions, get community patches and need no explanation to a new hire. The assessment's Route B is to adopt the pattern, not the package.
- Does teknoo/states-bundle support PHP 8.1 enums and typed properties?
- The supplied context does not state a PHP version range or enum support, and the assessment lists this as an open spike question. You must confirm what PHP range it supports and whether the generator emits typed properties and 8.1 enums or only pre-8.0 idioms. Do not assume modern PHP output before checking the library.
- How does the code generator affect CI and static analysis?
- Generated classes must pass your PHPStan/Psalm baseline and coding standard, or every regeneration trips CI. The assessment calls this the codegen tax. Also establish whether the generator runs at build time with committed artifacts, which is survivable, or at runtime via reflection and cache, which is not.
- Is teknoo/states-bundle safe to use in production?
- High risk. The repository is archived, so there is no security response path and an archived project cannot ship a CVE fix; anything you depend on there you effectively own. Adoption is effectively zero, with no bug reports, downstream compatibility testing or community corpus, so every issue becomes your own research project. Opportunity without maintenance is a liability.
- How would I integrate teknoo/states into Laravel if I chose Route A?
- Composer require teknoo/states, then write a small Laravel service provider to replace the Symfony compiler pass for state-class discovery. Everything Symfony-specific is reimplemented by you, including discovery and hydration that Symfony provided for free. This is the assessment's Route A and only makes sense after confirming the successor is maintained.
- Is a state machine package worth it versus hand-written code?
- The assessment suggests asking how much of the value is the generator versus the pattern guidance, and whether three hand-written interfaces plus an enum-backed transition table deliver 80 percent of the benefit. The State pattern is small and well understood; codegen buys consistency across many similar state machines, not correctness on the first one. Start with native enums or Spatie's package unless you have many machines.
- What does teknoo/states-bundle actually provide?
- It is a Symfony bundle for declarative states and transitions with guard conditions, object-oriented state pattern classes instead of switch statements, service container integration, and hooks for entry/exit actions and transition callbacks. It targets workflows, orders and document lifecycles in Symfony PHP applications. None of that changes the fact that the bundle layer is Symfony-specific and the repository is deprecated.