<?php

\error_reporting(\E_ALL);
include __DIR__ . '/common.php';
use Ministra\Lib\w13ec15f0067ea75861e61e27c990e4ba\k8281faec2a4a41f470b00112682ddabf;
use Ministra\Lib\w13ec15f0067ea75861e61e27c990e4ba\d3507c2999d38573a0a0c91771d70af2;
use Ministra\Lib\Course\CourseUpdater;
use Ministra\Lib\Course\ProviderFactory;
$options = \Ministra\Lib\w13ec15f0067ea75861e61e27c990e4ba\k8281faec2a4a41f470b00112682ddabf::getSafe('course_providers_options', []);
$providers = \Ministra\Lib\w13ec15f0067ea75861e61e27c990e4ba\k8281faec2a4a41f470b00112682ddabf::get('course_providers_for_update');
foreach ($providers as $name => $currencies) {
    $provider = \Ministra\Lib\Course\ProviderFactory::build($name, [$currencies, \Ministra\Lib\w13ec15f0067ea75861e61e27c990e4ba\d3507c2999d38573a0a0c91771d70af2::getInstance(), \array_key_exists($name, $options) ? $options[$name] : []]);
    if ($provider instanceof \Ministra\Lib\Course\CourseUpdater) {
        $rez = $provider->updateData();
    } else {
        \Ministra\Lib\w13ec15f0067ea75861e61e27c990e4ba\e7c78b97b208e4e1ae814a978ff35f3c(\sprintf('Class "%s" must implement CourseUpdater interface', \get_class($provider)));
    }
    echo \PHP_EOL;
}
