updated packages

This commit is contained in:
2019-05-18 09:06:43 +00:00
parent 901d16349e
commit e9487fa58a
2025 changed files with 30366 additions and 49653 deletions

View File

@@ -58,7 +58,7 @@ class XliffFileLoader implements LoaderInterface
$xliffVersion = XliffUtils::getVersionNumber($dom);
if ($errors = XliffUtils::validateSchema($dom)) {
throw new InvalidResourceException(sprintf('Invalid resource provided: "%s"; Errors: %s', $xliffVersion, XliffUtils::getErrorsAsString($errors)));
throw new InvalidResourceException(sprintf('Invalid resource provided: "%s"; Errors: %s', $resource, XliffUtils::getErrorsAsString($errors)));
}
if ('1.2' === $xliffVersion) {
@@ -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'];
}