<?php
/**
 * @package   Essentials YOOtheme Pro 2.3.4 build 0217.0955
 * @author    ZOOlanders https://www.zoolanders.com
 * @copyright Copyright (C) Joolanders, SL
 * @license   http://www.gnu.org/licenses/gpl.html GNU/GPL
 */

namespace ZOOlanders\YOOessentials\Source;

use ZOOlanders\YOOessentials\Config\ConfigUpdater;
use ZOOlanders\YOOessentials\UpdateTransform;

return [
    'routes' => [
        ['post', SourceController::REBUILD_SCHEMA_URL, SourceController::class . '@rebuildSchema'],
    ],

    'events' => [
        'source.init' => [
            Listener\RegisterSources::class => ['@handle', 60],
        ],

        'customizer.init' => [
            Listener\LoadCustomizerData::class => ['@handle', 10],
        ],

        'yooessentials.config.load' => [
            Listener\ValidateSources::class => ['@load'],
        ],
    ],

    'loaders' => [
        'yooessentials-sources' => new SourceLoader(),
    ],

    'extend' => [

        ConfigUpdater::class => function (ConfigUpdater $updater) {
            $updater->addGlobals(require __DIR__ . '/updates.php');
        },

        UpdateTransform::class => function (UpdateTransform $update) {
            $update->addGlobals(require __DIR__ . '/updates.php');
        },
    ],

    'services' => [
        SourceService::class => '',
    ],
];
