Summary
Add function versions of all formatters to provide a simpler, more ergonomic API for common formatting tasks.
Usage Example
Instead of writing:
new PlaceholderFormatter(['foo' => true, 'bar' => [1, 2, 3]])->format('{{foo}} must be {{bar|list:or}}')
Users should be able to write:
formatter_placeholder('{{foo}} must be {{bar|list:or}}', ['foo' => true, 'bar' => [1, 2, 3]])
Desired Behavior
Create standalone functions for each formatter type that wrap the existing builder pattern, making the API more concise for common use cases.
Acceptance Criteria
- Add function versions for all formatters
- Functions should accept format string and any scalar value
- Include tests for new functions