LocalizeSeparator.php
25 lines
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace AC\Formatter\Collection; |
| 6 | |
| 7 | use AC\CollectionFormatter; |
| 8 | use AC\Type\Value; |
| 9 | use AC\Type\ValueCollection; |
| 10 | |
| 11 | class LocalizeSeparator implements CollectionFormatter |
| 12 | { |
| 13 | public function format(ValueCollection $collection): Value |
| 14 | { |
| 15 | $values = []; |
| 16 | |
| 17 | foreach ($collection as $_value) { |
| 18 | $values[] = (string)$_value; |
| 19 | } |
| 20 | |
| 21 | return new Value(wp_sprintf('%l', $values)); |
| 22 | } |
| 23 | |
| 24 | } |
| 25 |