Total Complexity | 7 |
Total Lines | 50 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
10 | final class NewsNormalizer implements NewsNormalizerInterface |
||
11 | { |
||
12 | private const NORMALIZED_DATETIME_FORMAT = 'Y-m-d H:i:s'; |
||
13 | |||
14 | private const DEFAULT_MAX_TEXT_LENGTH_CHARS = 1500; |
||
15 | |||
16 | private DateTimeZone $timeZone; |
||
17 | |||
18 | private ?int $maxNewsToFetch; |
||
19 | |||
20 | private int $maxTextLengthChars; |
||
21 | |||
22 | 8 | public function __construct( |
|
30 | 8 | } |
|
31 | |||
32 | 6 | public function normalizeDateTime(DateTimeImmutable $dt): string |
|
33 | { |
||
34 | 6 | $dt->setTimeZone($this->timeZone); |
|
35 | |||
36 | 6 | return $dt->format(self::NORMALIZED_DATETIME_FORMAT); |
|
37 | } |
||
38 | |||
39 | 6 | public function getTimeZoneName(): string |
|
42 | } |
||
43 | |||
44 | 6 | public function normalizeText(string $text): string |
|
51 | } |
||
52 | |||
53 | 8 | public function limitByMaxToFetch(array $info): array |
|
60 | } |
||
61 | } |
||
62 |