21 public static function create(
string $type)
23 $knowProvidersMap = self::getKnownProvidersMap();
24 if (!isset($knowProvidersMap[$type]))
29 return new $knowProvidersMap[$type]();
35 private static function getKnownProvidersMap(): array
40 PaySystem\Internals\Analytics\Provider::class,
41 Cashbox\Internals\Analytics\Provider::class,
42 Delivery\Internals\Analytics\Provider::class,
46 foreach ($knownClasses as $knownClass)
48 $result[$knownClass::getCode()] = $knownClass;