Passed
Push — 6.0 ( e6360e...a5ddb0 )
by Olivier
01:38
created

LocalizedObjectWithFormatter::__get()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 1
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace ICanBoogie\CLDR;
4
5
/**
6
 * A localized object with a formatter.
7
 *
8
 * @template TTarget of object
9
 * @template TFormatter of Formatter
10
 *
11
 * @extends LocalizedObject<TTarget>
12
 *
13
 * @property-read TFormatter $formatter The formatter used to format the target object.
14
 *
15
 * @method string format() Formats the instance's target. Although the method is not
16
 * defined by the class, it should be implemented by subclasses.
17
 */
18
abstract class LocalizedObjectWithFormatter extends LocalizedObject
19
{
20
    /**
21
     * @phpstan-param TFormatter $formatter
22
     */
23
    public function __construct(
24
        object $target,
25
        Locale $locale,
26
        public readonly Formatter $formatter,
27
    ) {
28
        parent::__construct($target, $locale);
29
    }
30
}
31