<?php
/**
 * Profile extension registry.
 *
 * @package EntryFoundry
 */

namespace EntryFoundry\Core\Services\Extension;

// phpcs:disable Squiz.Commenting, Generic.Commenting.DocComment

final class ProfileRegistry {
	/** @var array<string,array<string,mixed>> */
	private $profiles = array();
	/** @param array<string,mixed> $profile */
	public function register( array $profile ): void {
		if ( ! empty( $profile['id'] ) ) {
			$this->profiles[ preg_replace( '/[^a-z0-9_-]/', '', strtolower( $profile['id'] ) ) ] = $profile; }
	}
	/** @return array<string,array<string,mixed>> */
	public function all(): array {
		return $this->profiles; }
}
