\Aura\IntlFormatterLocator

A ServiceLocator implementation for loading and retaining formatter objects.

Summary

Methods
Properties
Constants
__construct()
set()
get()
No public properties found
No constants found
No protected methods found
$registry
$converted
N/A
No private methods found
No private properties found
N/A

Properties

$registry

$registry : array

A registry to retain formatter objects.

Type

array

$converted

$converted : array

Tracks whether or not a registry entry has been converted from a callable to a formatter object.

Type

array

Methods

__construct()

__construct(array  $registry = array()) 

Constructor.

Parameters

array $registry

An array of key-value pairs where the key is the formatter name the value is a callable that returns a formatter object.

set()

set(string  $name, callable  $spec) : void

Sets a formatter into the registry by name.

Parameters

string $name

The formatter name.

callable $spec

A callable that returns a formatter object.

get()

get(string  $name) : \Aura\Intl\FormatterInterface

Gets a formatter from the registry by name.

Parameters

string $name

The formatter to retrieve.

Throws

\Aura\Intl\Exception\FormatterNotMapped

Returns

\Aura\Intl\FormatterInterface

A formatter object.