Skip to content

ClockServiceProvider

github-actions edited this page Apr 7, 2026 · 1 revision

Service provider for registering Symfony Clock services in the Fast Forward Container.

This class SHALL expose factories and extensions for clock-related services, including PSR-20 and Symfony Clock implementations, using the Fast Forward Container conventions.


  • Full name: \FastForward\Clock\ServiceProvider\ClockServiceProvider
  • This class is marked as final and can't be subclassed
  • This class implements: ServiceProviderInterface
  • This class is a Final class

See Also:

Methods

getFactories

Returns the service factories exposed by this package.

public getFactories(): array<string,callable>

The returned array SHALL map service names (class strings) to callables or factory objects that create the corresponding service instances. This includes:

  • DateTimeZone::class: Provides a DateTimeZone instance using DateTimeZoneFactory.
  • ClockInterface::class and SymfonyClockInterface::class: Aliases to NativeClock.
  • NativeClock, MockClock, MonotonicClock: Instantiated via InvokableFactory with appropriate arguments.

Return Value:

associative array of service factories

See Also:


getExtensions

Returns the service extensions exposed by this package.

public getExtensions(): array<string,callable>

The returned array SHALL map service names (class strings) to callables that extend or decorate existing services. This implementation returns an empty array, as no extensions are provided by default.

Return Value:

associative array of service extensions (empty by default)

See Also:


Clone this wiki locally