IFormatter
in
Formatter interface for data transformation and display formatting.
This interface defines the contract for all formatters in the Neuron framework. Formatters are responsible for converting raw data into human-readable or standardized formats. They provide a consistent way to transform data for display, export, or standardization purposes.
Common formatter implementations include:
- Currency formatting with locale-specific symbols and precision
- Date/time formatting with various display patterns
- Phone number formatting with regional standards
- Address formatting according to postal standards
Tags
Table of Contents
Methods
- format() : string|null
- Formats the provided data according to the formatter's rules.
Methods
format()
Formats the provided data according to the formatter's rules.
public
format(string $data) : string|null
Parameters
- $data : string
-
The raw data to be formatted
Return values
string|null —The formatted data, or null if formatting fails