original_string: public static function update_default_models_for_component(string $componentname): array {
  
          $result = [];
  
          foreach (static::load_default_models_for_component($componentname) as $definition) {
              if (!\core_analytics\model::exists(static::get_target($definition['target']))) {
                  $result[] = static::create_declared_model($definition);
              }
          }
  
          return $result;
      }
code: public static function update_default_models_for_component(string $componentname): array {
  
          $result = [];
  
          foreach (static::load_default_models_for_component($componentname) as $definition) {
              if (!\core_analytics\model::exists(static::get_target($definition['target']))) {
                  $result[] = static::create_declared_model($definition);
              }
          }
  
          return $result;
      }
code_tokens: public static function update_default_models_for_component ( string $ componentname ) : array { $ result = [ ] ; foreach ( static :: load_default_models_for_component ( $ componentname ) as $ definition ) { if ( ! \ core_analytics \ model :: exists ( static :: get_target ( $ definition [ 'target' ] ) ) ) { $ result [ ] = static :: create_declared_model ( $ definition ) ; } } return $ result ; }
docstring: Check that all the models declared by the component are up to date.
  
  This is intended to be called during the installation / upgrade to automatically create missing models.
  
  @param string $componentname The name of the component to load models for.
  @return array \core_analytics\model[] List of actually created models.
docstring_tokens: Check that all the models declared by the component are up to date .