diff options
Diffstat (limited to 'vendor/symfony/translation/Loader')
8 files changed, 22 insertions, 22 deletions
diff --git a/vendor/symfony/translation/Loader/ArrayLoader.php b/vendor/symfony/translation/Loader/ArrayLoader.php index 7bbfca68a4..0a6f9f089d 100644 --- a/vendor/symfony/translation/Loader/ArrayLoader.php +++ b/vendor/symfony/translation/Loader/ArrayLoader.php @@ -36,7 +36,7 @@ class ArrayLoader implements LoaderInterface * Flattens an nested array of translations. * * The scheme used is: - * 'key' => array('key2' => array('key3' => 'value')) + * 'key' => ['key2' => ['key3' => 'value']] * Becomes: * 'key.key2.key3' => 'value' * diff --git a/vendor/symfony/translation/Loader/CsvFileLoader.php b/vendor/symfony/translation/Loader/CsvFileLoader.php index 8a763e725d..18cc83ed68 100644 --- a/vendor/symfony/translation/Loader/CsvFileLoader.php +++ b/vendor/symfony/translation/Loader/CsvFileLoader.php @@ -29,7 +29,7 @@ class CsvFileLoader extends FileLoader */ protected function loadResource($resource) { - $messages = array(); + $messages = []; try { $file = new \SplFileObject($resource, 'rb'); diff --git a/vendor/symfony/translation/Loader/FileLoader.php b/vendor/symfony/translation/Loader/FileLoader.php index 9a02f52506..7ec54a3c87 100644 --- a/vendor/symfony/translation/Loader/FileLoader.php +++ b/vendor/symfony/translation/Loader/FileLoader.php @@ -37,7 +37,7 @@ abstract class FileLoader extends ArrayLoader // empty resource if (null === $messages) { - $messages = array(); + $messages = []; } // not an array diff --git a/vendor/symfony/translation/Loader/IcuResFileLoader.php b/vendor/symfony/translation/Loader/IcuResFileLoader.php index 28ace29775..005f26084d 100644 --- a/vendor/symfony/translation/Loader/IcuResFileLoader.php +++ b/vendor/symfony/translation/Loader/IcuResFileLoader.php @@ -75,7 +75,7 @@ class IcuResFileLoader implements LoaderInterface * * @return array the flattened ResourceBundle */ - protected function flatten(\ResourceBundle $rb, array &$messages = array(), $path = null) + protected function flatten(\ResourceBundle $rb, array &$messages = [], $path = null) { foreach ($rb as $key => $value) { $nodePath = $path ? $path.'.'.$key : $key; diff --git a/vendor/symfony/translation/Loader/JsonFileLoader.php b/vendor/symfony/translation/Loader/JsonFileLoader.php index ce4e91ff4f..526721277d 100644 --- a/vendor/symfony/translation/Loader/JsonFileLoader.php +++ b/vendor/symfony/translation/Loader/JsonFileLoader.php @@ -25,7 +25,7 @@ class JsonFileLoader extends FileLoader */ protected function loadResource($resource) { - $messages = array(); + $messages = []; if ($data = file_get_contents($resource)) { $messages = json_decode($data, true); diff --git a/vendor/symfony/translation/Loader/MoFileLoader.php b/vendor/symfony/translation/Loader/MoFileLoader.php index a1d7c4aef5..16a3dfc618 100644 --- a/vendor/symfony/translation/Loader/MoFileLoader.php +++ b/vendor/symfony/translation/Loader/MoFileLoader.php @@ -71,7 +71,7 @@ class MoFileLoader extends FileLoader // offsetHashes $this->readLong($stream, $isBigEndian); - $messages = array(); + $messages = []; for ($i = 0; $i < $count; ++$i) { $pluralId = null; @@ -108,13 +108,13 @@ class MoFileLoader extends FileLoader $translated = explode("\000", $translated); } - $ids = array('singular' => $singularId, 'plural' => $pluralId); + $ids = ['singular' => $singularId, 'plural' => $pluralId]; $item = compact('ids', 'translated'); if (\is_array($item['translated'])) { $messages[$item['ids']['singular']] = stripcslashes($item['translated'][0]); if (isset($item['ids']['plural'])) { - $plurals = array(); + $plurals = []; foreach ($item['translated'] as $plural => $translated) { $plurals[] = sprintf('{%d} %s', $plural, $translated); } diff --git a/vendor/symfony/translation/Loader/PoFileLoader.php b/vendor/symfony/translation/Loader/PoFileLoader.php index 066168dc71..1412a786a7 100644 --- a/vendor/symfony/translation/Loader/PoFileLoader.php +++ b/vendor/symfony/translation/Loader/PoFileLoader.php @@ -64,14 +64,14 @@ class PoFileLoader extends FileLoader { $stream = fopen($resource, 'r'); - $defaults = array( - 'ids' => array(), + $defaults = [ + 'ids' => [], 'translated' => null, - ); + ]; - $messages = array(); + $messages = []; $item = $defaults; - $flags = array(); + $flags = []; while ($line = fgets($stream)) { $line = trim($line); @@ -82,7 +82,7 @@ class PoFileLoader extends FileLoader $this->addMessage($messages, $item); } $item = $defaults; - $flags = array(); + $flags = []; } elseif ('#,' === substr($line, 0, 2)) { $flags = array_map('trim', explode(',', substr($line, 2))); } elseif ('msgid "' === substr($line, 0, 7)) { diff --git a/vendor/symfony/translation/Loader/XliffFileLoader.php b/vendor/symfony/translation/Loader/XliffFileLoader.php index 1106ec65f0..99306b86b1 100644 --- a/vendor/symfony/translation/Loader/XliffFileLoader.php +++ b/vendor/symfony/translation/Loader/XliffFileLoader.php @@ -97,13 +97,13 @@ class XliffFileLoader implements LoaderInterface $catalogue->set((string) $source, $target, $domain); - $metadata = array(); + $metadata = []; if ($notes = $this->parseNotesMetadata($translation->note, $encoding)) { $metadata['notes'] = $notes; } if (isset($translation->target) && $translation->target->attributes()) { - $metadata['target-attributes'] = array(); + $metadata['target-attributes'] = []; foreach ($translation->target->attributes() as $key => $value) { $metadata['target-attributes'][$key] = (string) $value; } @@ -134,18 +134,18 @@ class XliffFileLoader implements LoaderInterface $catalogue->set((string) $source, $target, $domain); - $metadata = array(); + $metadata = []; if (isset($segment->target) && $segment->target->attributes()) { - $metadata['target-attributes'] = array(); + $metadata['target-attributes'] = []; foreach ($segment->target->attributes() as $key => $value) { $metadata['target-attributes'][$key] = (string) $value; } } if (isset($unit->notes)) { - $metadata['notes'] = array(); + $metadata['notes'] = []; foreach ($unit->notes->note as $noteNode) { - $note = array(); + $note = []; foreach ($noteNode->attributes() as $key => $value) { $note[$key] = (string) $value; } @@ -173,7 +173,7 @@ class XliffFileLoader implements LoaderInterface private function parseNotesMetadata(\SimpleXMLElement $noteElement = null, string $encoding = null): array { - $notes = array(); + $notes = []; if (null === $noteElement) { return $notes; @@ -182,7 +182,7 @@ class XliffFileLoader implements LoaderInterface /** @var \SimpleXMLElement $xmlNote */ foreach ($noteElement as $xmlNote) { $noteAttributes = $xmlNote->attributes(); - $note = array('content' => $this->utf8ToCharset((string) $xmlNote, $encoding)); + $note = ['content' => $this->utf8ToCharset((string) $xmlNote, $encoding)]; if (isset($noteAttributes['priority'])) { $note['priority'] = (int) $noteAttributes['priority']; } |
