<?php

// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedNamespaceFound -- APD is the established namespace shared with the Pro add-on and retained for backward compatibility.
namespace APD\Operations;

use APD\Container;
use APD\Contracts\ServiceProviderInterface;

defined('ABSPATH') || exit;

class OperationsServiceProvider implements ServiceProviderInterface
{
    public function __construct(private readonly Container $container)
    {
    }

    public function register() : void
    {
        $this->container->set(OperationalMonitor::class, fn() => new OperationalMonitor());
    }

    public function boot() : void
    {
        $this->container->get(OperationalMonitor::class)->register();

        if (defined('WP_CLI') && WP_CLI && class_exists('\WP_CLI')) {
            \WP_CLI::add_command('asuka production-preflight', new ProductionCliCommand());
        }
    }
}
