Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
normalizer.php
1<?
3
9class Normalizer implements INormalizer
10{
12 protected $normalizers = [];
13
18 public function __construct(array $normalizers)
19 {
20 foreach($normalizers as $normalizer)
21 {
22 $this->addNormalizer($normalizer);
23 }
24 }
25
29 protected function addNormalizer(INormalizer $normalizer)
30 {
31 $this->normalizers[] = $normalizer;
32 }
33
38 public function normalize($string)
39 {
40 $result = $string;
41
43 foreach($this->normalizers as $normalizer)
44 {
45 $result = $normalizer->normalize($result);
46 }
47
48 return $result;
49 }
50}
addNormalizer(INormalizer $normalizer)