Skip to content

Commit 1ec0242

Browse files
committed
minor cleanup
1 parent 1524697 commit 1ec0242

File tree

4 files changed

+40
-3
lines changed

4 files changed

+40
-3
lines changed

.version.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"strategy": "semver",
3+
"major": 0,
4+
"minor": 7,
5+
"patch": 1,
6+
"build": 0
7+
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Build Status](https://app.travis-ci.com/Neuron-PHP/formatting.svg?token=F8zCwpT7x7Res7J2N4vF&branch=master)](https://app.travis-ci.com/Neuron-PHP/formatting)
1+
[![CI](https://github.com/Neuron-PHP/formatting/actions/workflows/ci.yml/badge.svg)](https://github.com/Neuron-PHP/formatting/actions)
22

33
# Neuron-PHP Formatting
44

src/Formatters/IFormatter.php

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,40 @@
33
namespace Neuron\Formatters;
44

55
/**
6-
* Formatter interface.
6+
* Formatter interface for data transformation and display formatting.
7+
*
8+
* This interface defines the contract for all formatters in the Neuron framework.
9+
* Formatters are responsible for converting raw data into human-readable or
10+
* standardized formats. They provide a consistent way to transform data for
11+
* display, export, or standardization purposes.
12+
*
13+
* Common formatter implementations include:
14+
* - Currency formatting with locale-specific symbols and precision
15+
* - Date/time formatting with various display patterns
16+
* - Phone number formatting with regional standards
17+
* - Address formatting according to postal standards
18+
*
19+
* @package Neuron\Formatters
20+
*
21+
* @example
22+
* ```php
23+
* class CurrencyFormatter implements IFormatter
24+
* {
25+
* public function format(string $data): ?string
26+
* {
27+
* $amount = floatval($data);
28+
* return '$' . number_format($amount, 2);
29+
* }
30+
* }
31+
* ```
732
*/
833
interface IFormatter
934
{
35+
/**
36+
* Formats the provided data according to the formatter's rules.
37+
*
38+
* @param string $Data The raw data to be formatted
39+
* @return string|null The formatted data, or null if formatting fails
40+
*/
1041
public function format( string $Data ) : ?string;
1142
}

version.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)