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

DateTimeFormatId::from()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace ICanBoogie\CLDR\Dates;
4
5
/**
6
 *
7
 * @link https://www.unicode.org/reports/tr35/tr35-72/tr35-dates.html#26-element-datetimeformats
8
 */
9
final class DateTimeFormatId
10
{
11
    public static function from(string $id): self
12
    {
13
        static $instances;
14
15
        return $instances[$id] ??= new self($id);
16
    }
17
18
    private function __construct(
19
        public readonly string $id,
20
    ) {
21
    }
22
}
23