Issues (662)

src/Supplemental/Plurals/OperandsCache.php (1 issue)

1
<?php
2
3
namespace ICanBoogie\CLDR\Supplemental\Plurals;
4
5
/**
6
 * @internal
7
 */
8
final class OperandsCache
9
{
10
    /**
11
     * @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...
12
     * @param callable():Operands $new
13
     */
14
    public static function get(float|int|string $number, callable $new): Operands
15
    {
16
        static $instances;
17
18
        $key = "number-$number";
19
20
        return $instances[$key] ??= $new();
21
    }
22
}
23