<?php

namespace Easymailing\App\Core\Provider;

use Easymailing\App\Core\Application;
use Easymailing\App\Core\Provider\GravityForms\GravityFormsIntegration;

class GravityFormsProvider implements ProviderInterface
{
	private $application;

	public function __construct(Application $application)
	{
		$this->application = $application;
	}

	public function register()
	{
		// desactivado- falta por implementar
//		if (!class_exists('GFForms')) {
//			return;
//		}
//
//		add_action('gform_loaded', function() {
//			$this->registerIntegration();
//		});
	}

	private function registerIntegration()
	{
		require_once __DIR__ . '/GravityForms/GravityFormsIntegration.php';
		// Inicializamos la integración (se usa patrón singleton).
		GravityFormsIntegration::get_instance();
	}

	public static function shouldRegister(): bool
	{
		return true;
	}

}
