RelationCache   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A get() 0 5 1
1
<?php
2
3
namespace ICanBoogie\CLDR\Supplemental\Plurals;
4
5
/**
6
 * @internal
7
 */
8
final class RelationCache
9
{
10
    /**
11
     * @param callable():Relation $new
12
     */
13
    public static function get(string $relation, callable $new): Relation
14
    {
15
        static $instances;
16
17
        return $instances[$relation] ??= $new();
18
    }
19
}
20