<?php
/**
 * PHP DI Container config.
 *
 * @package Super_Advent_Calendar
 * @author  Verdant Studio
 * @since   1.0.0
 */

/**
 * Exit when accessed directly.
 */
if ( ! defined( 'ABSPATH' )) {
	exit;
}

use SuperAdventCalendar\Controllers\ApiController;
use SuperAdventCalendar\Controllers\ShortcodeController;
use SuperAdventCalendar\Interfaces\Controllers\ApiControllerInterface;
use SuperAdventCalendar\Interfaces\Controllers\ShortcodeControllerInterface;
use SuperAdventCalendar\Interfaces\Providers\AppServiceProviderInterface;
use SuperAdventCalendar\Interfaces\Services\LifeCycleServiceInterface;
use SuperAdventCalendar\Interfaces\Services\ResourceServiceInterface;
use SuperAdventCalendar\Providers\AppServiceProvider;
use SuperAdventCalendar\Services\LifeCycleService;
use SuperAdventCalendar\Services\ResourceService;

return array(
	// Controllers.
	ApiControllerInterface::class       => function ( $c ) {
		return new ApiController();
	},
	ShortcodeControllerInterface::class => function ( $c ) {
		return new ShortcodeController();
	},

	// Providers.
	AppServiceProviderInterface::class  => function ( $c ) {
		return new AppServiceProvider(
			$c->get( ApiControllerInterface::class ),
			$c->get( LifeCycleServiceInterface::class ),
			$c->get( ResourceServiceInterface::class ),
			$c->get( ShortcodeControllerInterface::class )
		);
	},

	// Services.
	LifeCycleServiceInterface::class    => function ( $c ) {
		return new LifeCycleService();
	},
	ResourceServiceInterface::class     => function ( $c ) {
		return new ResourceService();
	},
);
