original_string: protected static function get_additional_search_area_categories() {
          $additionalcategories = [];
  
          // Allow plugins to add custom search area categories.
          if ($pluginsfunction = get_plugins_with_function('search_area_categories')) {
              foreach ($pluginsfunction as $plugintype => $plugins) {
                  foreach ($plugins as $pluginfunction) {
                      $plugincategories = $pluginfunction();
                      // We're expecting a list of valid area categories.
                      if (is_array($plugincategories)) {
                          foreach ($plugincategories as $plugincategory) {
                              if (self::is_valid_area_category($plugincategory)) {
                                  $additionalcategories[] = $plugincategory;
                              } else {
                                  throw  new \coding_exception('Invalid search area category!');
                              }
                          }
                      } else {
                          throw  new \coding_exception($pluginfunction . ' should return a list of search area categories!');
                      }
                  }
              }
          }
  
          return $additionalcategories;
      }
code: protected static function get_additional_search_area_categories() {
          $additionalcategories = [];
  
          // Allow plugins to add custom search area categories.
          if ($pluginsfunction = get_plugins_with_function('search_area_categories')) {
              foreach ($pluginsfunction as $plugintype => $plugins) {
                  foreach ($plugins as $pluginfunction) {
                      $plugincategories = $pluginfunction();
                      // We're expecting a list of valid area categories.
                      if (is_array($plugincategories)) {
                          foreach ($plugincategories as $plugincategory) {
                              if (self::is_valid_area_category($plugincategory)) {
                                  $additionalcategories[] = $plugincategory;
                              } else {
                                  throw  new \coding_exception('Invalid search area category!');
                              }
                          }
                      } else {
                          throw  new \coding_exception($pluginfunction . ' should return a list of search area categories!');
                      }
                  }
              }
          }
  
          return $additionalcategories;
      }
code_tokens: protected static function get_additional_search_area_categories ( ) { $ additionalcategories = [ ] ; // Allow plugins to add custom search area categories. if ( $ pluginsfunction = get_plugins_with_function ( 'search_area_categories' ) ) { foreach ( $ pluginsfunction as $ plugintype => $ plugins ) { foreach ( $ plugins as $ pluginfunction ) { $ plugincategories = $ pluginfunction ( ) ; // We're expecting a list of valid area categories. if ( is_array ( $ plugincategories ) ) { foreach ( $ plugincategories as $ plugincategory ) { if ( self :: is_valid_area_category ( $ plugincategory ) ) { $ additionalcategories [ ] = $ plugincategory ; } else { throw new \ coding_exception ( 'Invalid search area category!' ) ; } } } else { throw new \ coding_exception ( $ pluginfunction . ' should return a list of search area categories!' ) ; } } } } return $ additionalcategories ; }
docstring: Gets a list of additional search area categories.
  
  @return \core_search\area_category[]
docstring_tokens: Gets a list of additional search area categories .