diff --git a/src/Symfony/Component/Translation/Loader/XliffFileLoader.php b/src/Symfony/Component/Translation/Loader/XliffFileLoader.php index 1e7617a3c7..468408dea4 100644 --- a/src/Symfony/Component/Translation/Loader/XliffFileLoader.php +++ b/src/Symfony/Component/Translation/Loader/XliffFileLoader.php @@ -60,7 +60,7 @@ class XliffFileLoader implements LoaderInterface } $xliffVersion = $this->getVersionNumber($dom); - $this->validateSchema($xliffVersion, $dom, $this->getSchema($xliffVersion, $dom)); + $this->validateSchema($xliffVersion, $dom, $this->getSchema($xliffVersion)); if ('1.2' === $xliffVersion) { $this->extractXliff1($dom, $catalogue, $domain); @@ -159,6 +159,7 @@ class XliffFileLoader implements LoaderInterface } /** + * @param string $file * @param \DOMDocument $dom * @param string $schema source of the schema * @@ -178,10 +179,7 @@ class XliffFileLoader implements LoaderInterface libxml_use_internal_errors($internalErrors); } - /** - * @return string - */ - private function getSchema($xliffVersion, $dom) + private function getSchema($xliffVersion) { if ('1.2' === $xliffVersion) { $schemaSource = file_get_contents(__DIR__.'/schema/dic/xliff-core/xliff-core-1.2-strict.xsd'); diff --git a/src/Symfony/Component/Translation/Tests/Loader/XliffFileLoaderTest.php b/src/Symfony/Component/Translation/Tests/Loader/XliffFileLoaderTest.php index c7632d597f..e4dc8e0ec1 100644 --- a/src/Symfony/Component/Translation/Tests/Loader/XliffFileLoaderTest.php +++ b/src/Symfony/Component/Translation/Tests/Loader/XliffFileLoaderTest.php @@ -162,6 +162,7 @@ class XliffFileLoaderTest extends \PHPUnit_Framework_TestCase $domains = $catalogue->all(); $this->assertCount(3, $domains['domain1']); + $this->assertContainsOnly('string', $catalogue->all('domain1')); // Notes aren't assigned to specific segments, but to whole units, so there's no way to do a mapping $this->assertEmpty($catalogue->getMetadata());