Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ae4536f

Browse files
committed
apply some fixes.
1 parent ce540ae commit ae4536f

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/Symfony/Component/Translation/Loader/XliffFileLoader.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ private function extract($resource, MessageCatalogue $catalogue, $domain)
6060
}
6161

6262
$xliffVersion = $this->getVersionNumber($dom);
63-
$this->validateSchema($xliffVersion, $dom, $this->getSchema($xliffVersion, $dom));
63+
$this->validateSchema($xliffVersion, $dom, $this->getSchema($xliffVersion));
6464

6565
if ('1.2' === $xliffVersion) {
6666
$this->extractXliff1($dom, $catalogue, $domain);
@@ -159,6 +159,7 @@ private function utf8ToCharset($content, $encoding = null)
159159
}
160160

161161
/**
162+
* @param string $file
162163
* @param \DOMDocument $dom
163164
* @param string $schema source of the schema
164165
*
@@ -178,10 +179,7 @@ private function validateSchema($file, \DOMDocument $dom, $schema)
178179
libxml_use_internal_errors($internalErrors);
179180
}
180181

181-
/**
182-
* @return string
183-
*/
184-
private function getSchema($xliffVersion, $dom)
182+
private function getSchema($xliffVersion)
185183
{
186184
if ('1.2' === $xliffVersion) {
187185
$schemaSource = file_get_contents(__DIR__.'/schema/dic/xliff-core/xliff-core-1.2-strict.xsd');

src/Symfony/Component/Translation/Tests/Loader/XliffFileLoaderTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ public function testLoadVersion2()
162162

163163
$domains = $catalogue->all();
164164
$this->assertCount(3, $domains['domain1']);
165+
$this->assertContainsOnly('string', $catalogue->all('domain1'));
165166

166167
// Notes aren't assigned to specific segments, but to whole units, so there's no way to do a mapping
167168
$this->assertEmpty($catalogue->getMetadata());

0 commit comments

Comments
 (0)