HEX
Server: nginx
System: Linux pool195-106-36.bur.atomicsites.net 6.12.57+deb12-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.57-1~bpo12+1 (2025-11-17) x86_64
User: (0)
PHP: 8.3.32
Disabled: pcntl_fork
Upload Files
File: /wordpress/plugins/wp-cloud-client/1.1.7/src/BusinessProfile/ProfileRepository.php
<?php

declare(strict_types=1);

namespace VPlugins\WPCloudClient\BusinessProfile;

/**
 * Single source of truth for reading and writing business profile data.
 */
final class ProfileRepository {

	private const OPTION_KEY = 'bpr_business_profile';

	/**
	 * Retrieve the business profile data.
	 *
	 * @return array<string, mixed>|null The profile data or null if not set.
	 */
	public function get(): ?array {
		$data = get_option( self::OPTION_KEY, null );

		if ( ! is_array( $data ) || empty( $data ) ) {
			return null;
		}

		return $data;
	}

	/**
	 * Update the business profile data.
	 *
	 * @param array<string, mixed> $data The profile data to store.
	 * @return void
	 */
	public function update( array $data ): void {
		update_option( self::OPTION_KEY, $data );
	}
}