<?php

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