kdyby/datetime-provider-bundle
A Symfony bundle that integrates kdyby/datetime-provider, giving you DI-managed date/time services so you can inject and control the current time instead of calling new DateTime directly. This makes time-dependent code testable and lets you freeze or mock "now" in your Symfony applications...
Architecture fit — poor. The package is a Symfony bundle (DateTimeProviderBundle), not a Laravel package. It ships a Symfony Bundle class plus a DI compiler pass to register Kdyby\DateTimeProvider\Provider\CurrentProvider and related services into the Symfony container. Laravel has no bundle concept: it would not auto-discover, its Extension/CompilerPass hooks would never fire, and none of its service definitions would land in Laravel's container. Nothing in the repo targets Laravel's ServiceProvider, facades, or config publishing.
Functional overlap is total. What the underlying kdyby/datetime-provider library provides — an injectable DateTimeProvider interface returning "now" so time can be frozen in tests — Laravel already solves natively via Carbon's test clock (Carbon::setTestNow(), Illuminate\Support\Facades\Date::setTestNow()), and ecosystem-standard via psr/clock / symfony/clock. Adopting this package would add a second, parallel time-abstraction to the codebase with no capability gain.
Integration feasibility — low. There is no adapter layer available, and writing one means porting a Symfony compiler pass into a Laravel service provider for a library whose entire public surface is roughly "one interface, two implementations." The integration cost exceeds the cost of reimplementing the abstraction in ~40 lines.
Technical risk — high relative to value.
| Factor | Signal |
|---|---|
| Last release | 2019-12-10 (~6 years stale) |
| Stars / dependents | 6 / 0 — no production validation anywhere |
| License | NOASSERTION — unresolved; legal review required before any use |
| Framework target | Symfony 3/4-era; PHP 7.x assumptions likely |
| Maintenance | Single-maintainer, dormant; no security response path |
The NOASSERTION license alone is a hard gate in most orgs. Combined with zero dependents and no releases since 2019, this fails a basic supply-chain bar.
Key questions for the team:
Carbon::setTestNow() or a PSR-20 Clock binding?new \DateTime() / time() that we're trying to make testable? If so, that's a refactor task, not a dependency decision.NOASSERTION, and is that worth it for a non-Laravel bundle?kdyby/datetime-provider interface as a naming convention?Stack fit: none. PHP version compatibility is the only shared ground; the framework-level contract is Symfony-specific and does not map to Laravel's container lifecycle.
Recommended path: do not install. Replace the intent, not the package.
Psr\Clock\ClockInterface (via symfony/clock or a trivial in-house implementation) as a singleton in AppServiceProvider. For test-time control in an existing Carbon-centric codebase, prefer Date::setTestNow() and avoid a second abstraction.DateTimeProvider shape is genuinely preferred, port it locally: define App\Support\Clock\DateTimeProvider (one now(): DateTimeImmutable method), implement SystemProvider and FrozenProvider, and register the binding in a service provider. This is a small, owned, MIT-clean artifact with no upstream dependency.now(), Carbon::now(), new \DateTime(), and time() usage; inject the clock into services that need deterministic time; leave framework internals alone.Compatibility. The 2019 release predates PHP 8.x and Symfony 5+; if any transitive requirement forces it in, expect composer resolution conflicts against a modern Laravel application. Do not attempt to force-install under --ignore-platform-reqs — that converts a clean refusal into a latent runtime fault.
Sequencing.
now() in domain code.Maintenance. Near-zero if not adopted; if adopted, effectively total — you would own the code the moment you fork it, because upstream has not shipped since 2019 and has no dependents to surface breakage.
Support. No vendor, no maintainer SLA, no CVE process. NOASSERTION licensing means unclear redistribution rights, which is an audit finding waiting to happen.
Scaling. Runtime footprint is trivial (a wrapper around DateTimeImmutable) — scaling is a non-issue. The scaling problem is organizational: every additional time abstraction multiplies the ways tests can be non-deterministic and the ways engineers can disagree about "now."
Failure modes if adopted anyway:
DateTimeProvider binding → runtime BindingResolutionException at first resolution, likely in a request path, not at boot.symfony/dependency-injection compiler-pass API) breaks on a major bump → fatal error during composer update in CI or, worse, in production.Carbon::now(), so frozen-time tests pass for covered services and intermittently fail elsewhere.Ramp-up. Low for the alternative (a clock binding is a well-understood pattern most PHP engineers have seen); high for the package itself, because a new engineer must learn a Symfony-flavored abstraction that exists nowhere else in the stack and is documented only by a 2019 README.
Verdict: Reject. Score 0.06, 6 stars, 0 dependents, dormant since 2019, unresolved license, and a framework mismatch against Laravel all point the same way. The underlying need — injectable, freezable time — is real and should be met with psr/clock or Carbon's test clock, both of which are already in or adjacent to the stack.
How can I help you explore Laravel packages today?