class FeatureSet (View source)

FeatureSet detects and exposes available features in the current environment (32- or 64-bit, available dependencies, etc.)

Methods

__construct(bool $useGuids = false, bool $force32Bit = false, bool $forceNoBigNumber = false, bool $ignoreSystemNode = false, bool $enablePecl = false)

Constructs a FeatureSet for use by a UuidFactory to determine or set features available to the environment

getBuilder()

Returns the builder configured for this environment

getCodec()

Returns the UUID UUID coder-decoder configured for this environment

getNodeProvider()

Returns the system node ID provider configured for this environment

getNumberConverter()

Returns the number converter configured for this environment

getRandomGenerator()

Returns the random UUID generator configured for this environment

getTimeGenerator()

Returns the time-based UUID generator configured for this environment

setTimeProvider(TimeProviderInterface $timeProvider)

Sets the time provider for use in this environment

buildCodec(bool $useGuids = false)

Determines which UUID coder-decoder to use and returns the configured codec for this environment

buildNodeProvider()

Determines which system node ID provider to use and returns the configured system node ID provider for this environment

buildNumberConverter()

Determines which number converter to use and returns the configured number converter for this environment

buildRandomGenerator()

Determines which random UUID generator to use and returns the configured random UUID generator for this environment

buildTimeGenerator(TimeProviderInterface $timeProvider)

Determines which time-based UUID generator to use and returns the configured time-based UUID generator for this environment

buildTimeConverter()

Determines which time converter to use and returns the configured time converter for this environment

buildUuidBuilder()

Determines which UUID builder to use and returns the configured UUID builder for this environment

bool
hasBigNumber()

Returns true if the system has Moontoast\Math\BigNumber

bool
is64BitSystem()

Returns true if the system is 64-bit, false otherwise

Details

__construct(bool $useGuids = false, bool $force32Bit = false, bool $forceNoBigNumber = false, bool $ignoreSystemNode = false, bool $enablePecl = false)

Constructs a FeatureSet for use by a UuidFactory to determine or set features available to the environment

Parameters

bool $useGuids Whether to build UUIDs using the GuidStringCodec
bool $force32Bit Whether to force the use of 32-bit functionality (primarily for testing purposes)
bool $forceNoBigNumber Whether to disable the use of moontoast/math BigNumber (primarily for testing purposes)
bool $ignoreSystemNode Whether to disable attempts to check for the system host ID (primarily for testing purposes)
bool $enablePecl Whether to enable the use of the PeclUuidTimeGenerator to generate version 1 UUIDs

UuidBuilderInterface getBuilder()

Returns the builder configured for this environment

Return Value

UuidBuilderInterface

CodecInterface getCodec()

Returns the UUID UUID coder-decoder configured for this environment

Return Value

CodecInterface

NodeProviderInterface getNodeProvider()

Returns the system node ID provider configured for this environment

Return Value

NodeProviderInterface

NumberConverterInterface getNumberConverter()

Returns the number converter configured for this environment

RandomGeneratorInterface getRandomGenerator()

Returns the random UUID generator configured for this environment

TimeGeneratorInterface getTimeGenerator()

Returns the time-based UUID generator configured for this environment

Return Value

TimeGeneratorInterface

setTimeProvider(TimeProviderInterface $timeProvider)

Sets the time provider for use in this environment

Parameters

TimeProviderInterface $timeProvider

protected CodecInterface buildCodec(bool $useGuids = false)

Determines which UUID coder-decoder to use and returns the configured codec for this environment

Parameters

bool $useGuids Whether to build UUIDs using the GuidStringCodec

Return Value

CodecInterface

protected NodeProviderInterface buildNodeProvider()

Determines which system node ID provider to use and returns the configured system node ID provider for this environment

Return Value

NodeProviderInterface

protected NumberConverterInterface buildNumberConverter()

Determines which number converter to use and returns the configured number converter for this environment

protected RandomGeneratorInterface buildRandomGenerator()

Determines which random UUID generator to use and returns the configured random UUID generator for this environment

protected TimeGeneratorInterface buildTimeGenerator(TimeProviderInterface $timeProvider)

Determines which time-based UUID generator to use and returns the configured time-based UUID generator for this environment

Parameters

TimeProviderInterface $timeProvider

Return Value

TimeGeneratorInterface

protected TimeConverterInterface buildTimeConverter()

Determines which time converter to use and returns the configured time converter for this environment

Return Value

TimeConverterInterface

protected UuidBuilderInterface buildUuidBuilder()

Determines which UUID builder to use and returns the configured UUID builder for this environment

Return Value

UuidBuilderInterface

protected bool hasBigNumber()

Returns true if the system has Moontoast\Math\BigNumber

Return Value

bool

protected bool is64BitSystem()

Returns true if the system is 64-bit, false otherwise

Return Value

bool