File tree Expand file tree Collapse file tree 4 files changed +40
-3
lines changed
Expand file tree Collapse file tree 4 files changed +40
-3
lines changed Original file line number Diff line number Diff line change 1+ {
2+ "strategy" : " semver" ,
3+ "major" : 0 ,
4+ "minor" : 7 ,
5+ "patch" : 1 ,
6+ "build" : 0
7+ }
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 33namespace 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 */
833interface 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}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments