Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
factory.php
1<?php
2
4
10final class Factory
11{
16 public static function make(array $details): BaseConverter
17 {
18 $className = null;
19
20 if (isset($details['country_code']))
21 {
22 switch ($details['country_code'])
23 {
24 case 'ru':
25 $className = RuConverter::class;
26 break;
27 case 'us':
28 $className = UsConverter::class;
29 break;
30 case 'de':
31 $className = DeConverter::class;
32 break;
33 case 'br':
34 $className = BrConverter::class;
35 break;
36 }
37 }
38
39 $className = $className ?? GenericConverter::class;
40
41 return new $className();
42 }
43}