You are here

public static function WebformYaml::tidy in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/Utility/WebformYaml.php \Drupal\webform\Utility\WebformYaml::tidy()

Tidy export YAML includes tweaking array layout and multiline strings.

Parameters

string $yaml: The output generated from \Drupal\Core\Serialization\Yaml::encode.

Return value

string The encoded data.

4 calls to WebformYaml::tidy()
WebformCliService::drush_webform_tidy in src/Commands/WebformCliService.php
Implements drush_hook_COMMAND().
WebformYamlTest::testTidy in tests/src/Unit/Utility/WebformYamlTest.php
Tests WebformYaml tidy with WebformYaml::tidy().
_webform_form_config_single_export_form_update_export in modules/webform_devel/webform_devel.module
Handles switching the export textarea and tidies exported MSK configuration.
_webform_form_config_translate_add_form_alter_yaml_element in includes/webform.translation.inc
Alter translated config entity property.

File

src/Utility/WebformYaml.php, line 95

Class

WebformYaml
Provides YAML tidy function.

Namespace

Drupal\webform\Utility

Code

public static function tidy($yaml) {
  return self::encode(self::decode($yaml));
}