ClockServiceProvider

Class
implements ServiceProviderInterface
Read only: Yes Final: Yes

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

Description

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

Tags

Table of Contents

Interfaces

Methods

getExtensions()

Returns the service extensions exposed by this package.

 : array<string, callable>
getFactories()

Returns the service factories exposed by this package.

 : array<string, callable>
Methods

getExtensions()

Public

Returns the service extensions exposed by this package.

public getExtensions() : array<string, callable>

Description

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.

Tags
Return values
array<string, callable>

Description

associative array of service extensions (empty by default)

getFactories()

Public

Returns the service factories exposed by this package.

public getFactories() : array<string, callable>

Description

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.
Tags
Return values
array<string, callable>

Description

associative array of service factories