Formatters
in package
Formatters class.
Allows formatter classes to be registered. Formatters are exposed to extensions via the ExtendSchema class.
Table of Contents
- $formatters : array<string|int, mixed>
- Holds an array of formatter class instances.
- __get() : FormatterInterface
- Get a new instance of a formatter class.
- register() : mixed
- Register a formatter class for usage.
Properties
$formatters
Holds an array of formatter class instances.
private
array<string|int, mixed>
$formatters
= []
Methods
__get()
Get a new instance of a formatter class.
public
__get(string $name) : FormatterInterface
Parameters
- $name : string
-
Name of the formatter.
Tags
Return values
FormatterInterface — Formatter class instance.register()
Register a formatter class for usage.
public
register(string $name, string $class) : mixed
Parameters
- $name : string
-
Name of the formatter.
- $class : string
-
A formatter class name.