Mercurial > hg > cmmr2012-drupal-site
comparison vendor/symfony/translation/Dumper/XliffFileDumper.php @ 5:12f9dff5fda9 tip
Update to Drupal core 8.7.1
author | Chris Cannam |
---|---|
date | Thu, 09 May 2019 15:34:47 +0100 |
parents | a9cd425dd02b |
children |
comparison
equal
deleted
inserted
replaced
4:a9cd425dd02b | 5:12f9dff5fda9 |
---|---|
25 * {@inheritdoc} | 25 * {@inheritdoc} |
26 */ | 26 */ |
27 public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = []) | 27 public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = []) |
28 { | 28 { |
29 $xliffVersion = '1.2'; | 29 $xliffVersion = '1.2'; |
30 if (array_key_exists('xliff_version', $options)) { | 30 if (\array_key_exists('xliff_version', $options)) { |
31 $xliffVersion = $options['xliff_version']; | 31 $xliffVersion = $options['xliff_version']; |
32 } | 32 } |
33 | 33 |
34 if (array_key_exists('default_locale', $options)) { | 34 if (\array_key_exists('default_locale', $options)) { |
35 $defaultLocale = $options['default_locale']; | 35 $defaultLocale = $options['default_locale']; |
36 } else { | 36 } else { |
37 $defaultLocale = \Locale::getDefault(); | 37 $defaultLocale = \Locale::getDefault(); |
38 } | 38 } |
39 | 39 |
56 } | 56 } |
57 | 57 |
58 private function dumpXliff1($defaultLocale, MessageCatalogue $messages, $domain, array $options = []) | 58 private function dumpXliff1($defaultLocale, MessageCatalogue $messages, $domain, array $options = []) |
59 { | 59 { |
60 $toolInfo = ['tool-id' => 'symfony', 'tool-name' => 'Symfony']; | 60 $toolInfo = ['tool-id' => 'symfony', 'tool-name' => 'Symfony']; |
61 if (array_key_exists('tool_info', $options)) { | 61 if (\array_key_exists('tool_info', $options)) { |
62 $toolInfo = array_merge($toolInfo, $options['tool_info']); | 62 $toolInfo = array_merge($toolInfo, $options['tool_info']); |
63 } | 63 } |
64 | 64 |
65 $dom = new \DOMDocument('1.0', 'utf-8'); | 65 $dom = new \DOMDocument('1.0', 'utf-8'); |
66 $dom->formatOutput = true; | 66 $dom->formatOutput = true; |
193 * | 193 * |
194 * @return bool | 194 * @return bool |
195 */ | 195 */ |
196 private function hasMetadataArrayInfo($key, $metadata = null) | 196 private function hasMetadataArrayInfo($key, $metadata = null) |
197 { | 197 { |
198 return null !== $metadata && array_key_exists($key, $metadata) && ($metadata[$key] instanceof \Traversable || \is_array($metadata[$key])); | 198 return null !== $metadata && \array_key_exists($key, $metadata) && ($metadata[$key] instanceof \Traversable || \is_array($metadata[$key])); |
199 } | 199 } |
200 } | 200 } |