Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
normalizer.php
1<?php
3
5
13class Normalizer implements INormalizer
14{
16 protected $normalizers = [];
17
23 public function __construct(array $normalizers)
24 {
25 foreach($normalizers as $normalizer)
26 {
27 $this->addNormalizer($normalizer);
28 }
29 }
30
35 protected function addNormalizer(INormalizer $normalizer): void
36 {
37 $this->normalizers[] = $normalizer;
38 }
39
44 public function normalize(string $string): string
45 {
46 $result = $string;
47
48 foreach($this->normalizers as $normalizer)
49 {
50 $result = $normalizer->normalize($result);
51 }
52
53 return $result;
54 }
55}