1 | <?php |
||
11 | class StatsFormatter { |
||
12 | |||
13 | /** |
||
14 | * Stats as plain string |
||
15 | */ |
||
16 | const FORMAT_PLAIN = 'plain'; |
||
17 | |||
18 | /** |
||
19 | * Stats as JSON output |
||
20 | */ |
||
21 | const FORMAT_JSON = 'json'; |
||
22 | |||
23 | /** |
||
24 | * Stats as HTML list output |
||
25 | */ |
||
26 | const FORMAT_HTML = 'html'; |
||
27 | |||
28 | /** |
||
29 | * @since 2.5 |
||
30 | * |
||
31 | * @param array $stats |
||
32 | * @param string|null $format |
||
33 | * |
||
34 | * @return string|array |
||
35 | */ |
||
36 | public static function format( array $stats, $format = null ) { |
||
81 | |||
82 | /** |
||
83 | * @since 2.5 |
||
84 | * |
||
85 | * @param array $stats |
||
86 | * @param string $separator |
||
87 | * |
||
88 | * @return array |
||
89 | */ |
||
90 | public static function getStatsFromFlatKey( array $stats, $separator = '.' ) { |
||
105 | |||
106 | // http://stackoverflow.com/questions/10123604/multstatsdIdimensional-array-from-string |
||
107 | private static function stringToArray( $separator, $path, $value ) { |
||
124 | |||
125 | } |
||
126 |