<?php

namespace RebelCode\Spotlight\Instagram\Modules;

use Dhii\Services\Extensions\ArrayExtension;
use Dhii\Services\Factories\Constructor;
use Dhii\Services\Factories\Value;
use Psr\Container\ContainerInterface;
use RebelCode\Spotlight\Instagram\Config\WpOption;
use RebelCode\Spotlight\Instagram\Module;

class LoggerModule extends Module
{
    const CFG_LOGS = 'logs';

    public function run(ContainerInterface $c)
    {
        return [
            'logger' => new Constructor(),

            'logger/option' => new Value('spotlight/'),
        ];
    }

    public function getFactories()
    {
        return [
            //==========================================================================
            // CONFIG ENTRIES
            //==========================================================================

            // The config entry that stores the logs
            'config/logs' => new Value(new WpOption('sli_logs', [])),
        ];
    }

    public function getExtensions()
    {
        return [
            // Register the config entries
            'config/entries' => new ArrayExtension([
                static::CFG_LOGS => 'config/logs',
            ]),
        ];
    }
}
