<?php

/**
 * Abstract CloudXM Plugin Bootstrap Base Class
 *
 * Provides common plugin bootstrap functionality for CloudXM plugins.
 * This is an abstract base class that plugins extend to implement their
 * specific bootstrap logic. The SDK library itself is not a plugin.
 *
 * @package CloudXM\SDK\Bootstrap
 * @since 1.0.0
 */

namespace CloudXM\SDK\Bootstrap;

use CloudXM\SDK\Contracts\ContainerInterface;
use CloudXM\SDK\Contracts\PluginInterface;
use CloudXM\SDK\Support\HasLogger;

/**
 * Abstract Plugin Bootstrap Base Class
 */
abstract class AbstractPlugin implements PluginInterface
{
    use HasLogger;

    /**
     * Boot the plugin - call from main file on plugins_loaded
     */
    abstract public function boot(): void;

    /**
     * Get the service container
     */
    abstract public function container(): ContainerInterface;

    /**
     * Child plugin supplies list of provider class-names
     */
    abstract public function getProviders(): array;

    /**
     * Check plugin requirements before booting
     */
    abstract public function checkRequirements(): bool;

    /**
     * Get minimum PHP version required
     */
    abstract public function getMinPhpVersion(): string;

    /**
     * Check if a service is available - should be implemented by child classes
     * This method should use dependency injection through the container
     */
    abstract public function hasService(string $service): bool;
}