File: /wordpress/plugins/wp-cloud-client/1.1.0/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 );
}
}