<?php
/**
 * Module Service Provider
 *
 * Registers modules in the container
 *
 * @package NemtlyBooking
 * @since   PBOOKING_SINCE
 */

namespace NemtlyBooking\Providers;

use NemtlyBooking\Core\Service_Provider;
use NemtlyBooking\Core\Container;
use NemtlyBooking\Modules\Event\Event_Module;
use NemtlyBooking\Modules\Booking\Booking_Module;

/**
 * Module Service Provider class
 *
 * @since PBOOKING_SINCE
 */
class Module_Service_Provider extends Service_Provider {

    /**
     * Register modules
     *
     * @since PBOOKING_SINCE
     *
     * @param Container $container The dependency injection container.
     */
    public function register( Container $container ) {
        // Event Module
        $container->register(
            'event_module',
            function ( $container ) {
                return new Event_Module( $container );
            }
        );

        // Booking Module
        $container->register(
            'booking_module',
            function ( $container ) {
                return new Booking_Module( $container );
            }
        );

        $this->mark_registered();
    }
}
