Passed
Push — 6.0 ( 4ac4e1...87e1d7 )
by Olivier
01:56
created

NumberFormatterLocalized   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 3
dl 0
loc 12
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A format() 0 5 1
1
<?php
2
3
namespace ICanBoogie\CLDR\Numbers;
4
5
use ICanBoogie\CLDR\Core\Formatter;
6
use ICanBoogie\CLDR\Core\LocalizedObject;
7
8
/**
9
 * Formats numbers using locale conventions.
10
 *
11
 * @extends LocalizedObject<NumberFormatter>
12
 */
13
class NumberFormatterLocalized extends LocalizedObject implements Formatter
14
{
15
    /**
16
     * Formats a number.
17
     *
18
     * @param float|int|numeric-string $number
0 ignored issues
show
Documentation Bug introduced by
The doc comment float|int|numeric-string at position 4 could not be parsed: Unknown type name 'numeric-string' at position 4 in float|int|numeric-string.
Loading history...
19
     */
20
    public function format(float|int|string $number, string $pattern = null): string
21
    {
22
        $numbers = $this->locale->numbers;
23
24
        return $this->target->format($number, $pattern ?? $numbers->standard_decimal_format, $numbers->symbols);
25
    }
26
}
27