From 36a337fcd30ceebdf727d41f6a3b67407c2155a3 Mon Sep 17 00:00:00 2001 From: Allen Benny Date: Fri, 24 Nov 2023 17:54:03 +0530 Subject: [PATCH] Update SiteGenService.php --- includes/Services/SiteGenService.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/includes/Services/SiteGenService.php b/includes/Services/SiteGenService.php index d3d8d4d..c49f298 100644 --- a/includes/Services/SiteGenService.php +++ b/includes/Services/SiteGenService.php @@ -8,18 +8,18 @@ /** * Class SiteGenService * - * Class for handling SiteGen interactions. + * Class for handling SiteGen Interactions. */ class SiteGenService { /** - * Determines whether the given identifier is valid. + * Gets Valid Identifiers. * * @param string $key The identifier to be evaluated. * @return boolean */ - public static function is_identifier( $key ) { - $identifiers = array( + public static function get_identifiers() { + return array( 'siteclassification' => true, 'targetaudience' => true, 'contenttones' => true, @@ -29,8 +29,16 @@ public static function is_identifier( $key ) { 'pluginrecommendation' => true, 'fontpair' => true, ); + } - return isset( $identifiers[ $key ] ); + /** + * Determines whether the given identifier is valid. + * + * @param string $key The identifier to be evaluated. + * @return boolean + */ + public static function is_identifier( $key ) { + return isset( self::get_identifiers()[ $key ] ); } /**