<?php
/**
 * Static config provider.
 *
 * @package Ealab\Deployer
 */

namespace Ealab\Deployer\Tracking\Config;

/**
 * Static config provider. Useful for testing or for providing default config.
 *
 * You can either use this class directly (use init['config'] to set the config),
 * or extend it to add your own config.
 */
class StaticConfigProvider extends ConfigProviderBase {
	/**
	 * {@inheritDoc}
	 */
	public function collect(): ?array {
		return $this->config;
	}

	/**
	 * {@inheritDoc}
	 */
	public function init( ConfigProviderManagerBase $config_provider_manager, ?array $options = null ): void {
		parent::init( $config_provider_manager, $options );

		$this->config = $options['config'] ?? null;
	}
}
