Skip to content
Snippets Groups Projects
Commit 17ae193d authored by Jose Antonio Reyero del Prado's avatar Jose Antonio Reyero del Prado
Browse files

Fixed coding standards.

parent 9dd9663d
Branches
Tags 11.0.0-alpha1
1 merge request!12121Important patch updates:
......@@ -61,7 +61,7 @@ public static function getFileExtension() {
* The only tag custom tag supported by default is the '!translate' tag.
*
* @param mixed $data
* Parsed yaml data
* Parsed YAML data.
* @param callable[] $tag_callbacks
* Optional callbacks for tag value, indexed by tag.
*
......
......@@ -104,7 +104,7 @@ public function collectValue(string $name, DataDefinitionInterface $definition,
// Run localization before calling final method.
$arguments = array_map(function ($value) {
return is_object($value) && $value instanceof \Stringable ? (string)$value : $value;
return is_object($value) && $value instanceof \Stringable ? (string) $value : $value;
}, $arguments);
return $this->io->$method(...$arguments);
......
......@@ -3,7 +3,6 @@
namespace Drupal\Core\StringTranslation;
use Drupal\Component\Serialization\Exception\InvalidDataTypeException;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Symfony\Component\Yaml\Tag\TaggedValue;
/**
......@@ -28,22 +27,23 @@ class YamlTagTranslator {
* as the '$options' parameter for the translation.
*
* @see t()
*
*
* @param \Symfony\Component\Yaml\Tag\TaggedValue $tagged_value
* The tagged value object.
* @param array $options
* Extra options to pass to the translation.
*
*
* @return \Drupal\Core\StringTranslation\TranslatableMarkup
* The translatable string object.
*/
public static function translateTaggedValue(TaggedValue $tagged_value, $options = []){
public static function translateTaggedValue(TaggedValue $tagged_value, $options = []) {
$value = $tagged_value->getValue();
if (is_array($value) && isset($value['string'])) {
$string = $value['string'];
unset($value['string']);
$options += $value;
} elseif (is_string($value)) {
}
elseif (is_string($value)) {
$string = $value;
}
else {
......@@ -53,9 +53,4 @@ public static function translateTaggedValue(TaggedValue $tagged_value, $options
return new TranslatableMarkup($string, [], $options);
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment