# sequra/4.0.0/src/Services/Platform/class-platform-provider.php

seQura, version 4.0.0. 99 lines.

- Page: https://pluginprobe.com/plugins/sequra/4.0.0/code/src/Services/Platform/class-platform-provider.php
- Raw: https://pluginprobe.com/plugins/sequra/4.0.0/raw/src/Services/Platform/class-platform-provider.php
- Modified: 2025-10-21T08:30:24+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/sequra/4.0.0/code/src/Services/Platform/class-platform-provider.php#L10-L20`.

```php
<?php
/**
 * Platform Provider Interface
 *
 * @package    SeQura/WC
 * @subpackage SeQura/WC/Services
 */

namespace SeQura\WC\Services\Platform;

use SeQura\Core\BusinessLogic\Domain\Order\Models\OrderRequest\Platform;
use SeQura\WC\Services\Constants\Interface_Constants;

/**
 * Provide the current platform
 */
class Platform_Provider implements Interface_Platform_Provider {

	/**
	 * Constants service
	 * 
	 * @var Interface_Constants
	 */
	private $constants;

	/**
	 * Platform instance
	 * 
	 * @var Platform
	 */
	private $platform;

	/**
	 * Constructor
	 */
	public function __construct( Interface_Constants $constants ) {
		$this->constants = $constants;
	}

	/**
	 * Get the current platform
	 */
	public function get(): Platform {
		if ( ! $this->platform ) {
			/**
			 * WooCommerce data
			 *
			 * @var array<string, string>
			 */
			$woo = $this->constants->get_woocommerce_data();
		
			/**
			 * Environment data
			 * 
			 * @var array<string, string>
			 */
			$env = $this->constants->get_environment_data();

			/**
			 * Plugin data
			 * 
			 * @var array<string, string>
			 */
			$sq = $this->constants->get_plugin_data();

			/**
			* Filter the module version to be used in the platform options.
			* 
			* @since 3.0.0
			*/
			$version = \apply_filters(
				'sequra_platform_options_version',
				$sq['Version'] ?? ''
			);
		
			$platform_version = ( $woo['Version'] ?? '' ) . ( isset( $env['wp_version'] ) ? " + WordPress {$env['wp_version']}" : '' );

			/**
			 * Filter the platform options.
			 *
			 * @since 3.0.0
			 */
			$this->platform = \apply_filters(
				'sequra_platform_options',
				new Platform(
					$this->constants->get_integration_name(),
					$platform_version,
					$env['uname'],
					$env['db_name'],
					$env['db_version'],
					$version,
					$env['php_version']
				) 
			);
		}
		return $this->platform;
	}
}

```
