*/ private $profiles; /** * Whether active commercial status is required. * * @var bool */ private $requires_active_status; /** * Constructor. * * @param string $id Feature ID. * @param array $profiles Supported profile values. * @param bool $requires_active_status Whether active commercial status is required. */ public function __construct( string $id, array $profiles, bool $requires_active_status = true ) { $this->id = $id; $this->profiles = array_values( array_intersect( $profiles, BuildProfile::get_supported_profiles() ) ); $this->requires_active_status = $requires_active_status; } /** * Get feature ID. */ public function get_id(): string { return $this->id; } /** * Whether the feature allows this profile. * * @param BuildProfile $profile Build profile. */ public function allows_profile( BuildProfile $profile ): bool { return in_array( $profile->get_value(), $this->profiles, true ); } /** * Whether active commercial status is required. */ public function requires_active_status(): bool { return $this->requires_active_status; } }