feature_id = $feature_id; $this->available = $available; $this->reason = $reason; } /** * Create an available result. * * @param string $feature_id Feature ID. */ public static function available( string $feature_id ): self { return new self( $feature_id, true, self::REASON_AVAILABLE ); } /** * Create an unavailable result. * * @param string $feature_id Feature ID. * @param string $reason Reason code. */ public static function unavailable( string $feature_id, string $reason ): self { return new self( $feature_id, false, $reason ); } /** * Get feature ID. */ public function get_feature_id(): string { return $this->feature_id; } /** * Whether the feature is available. */ public function is_available(): bool { return $this->available; } /** * Get the reason code. */ public function get_reason(): string { return $this->reason; } }