From 36445bee8c72ce7306a28a5fd9ca2b1e0544c0da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Parafi=C5=84ski?= Date: Tue, 17 Mar 2020 17:21:53 +0100 Subject: [PATCH 1/3] Fixed object instead of string error introduced by strict_types --- Translation/Loader/Symfony/XliffLoader.php | 2 +- Translation/Loader/XliffLoader.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Translation/Loader/Symfony/XliffLoader.php b/Translation/Loader/Symfony/XliffLoader.php index 8d4836fb..ac414f1c 100644 --- a/Translation/Loader/Symfony/XliffLoader.php +++ b/Translation/Loader/Symfony/XliffLoader.php @@ -42,7 +42,7 @@ class XliffLoader implements LoaderInterface public function load($resource, $locale, $domain = 'messages') { $previous = libxml_use_internal_errors(true); - if (false === $xml = simplexml_load_file($resource)) { + if (false === $xml = simplexml_load_file((string)$resource)) { libxml_use_internal_errors($previous); $error = libxml_get_last_error(); diff --git a/Translation/Loader/XliffLoader.php b/Translation/Loader/XliffLoader.php index b6148bc9..60fa3aba 100644 --- a/Translation/Loader/XliffLoader.php +++ b/Translation/Loader/XliffLoader.php @@ -37,7 +37,7 @@ class XliffLoader implements LoaderInterface public function load($resource, $locale, $domain = 'messages') { $previous = libxml_use_internal_errors(true); - if (false === $doc = simplexml_load_file($resource)) { + if (false === $doc = simplexml_load_file((string)$resource)) { libxml_use_internal_errors($previous); $libxmlError = libxml_get_last_error(); From 524c44c7c62baf8d817cbf292c6e57287deeec29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Parafi=C5=84ski?= Date: Tue, 17 Mar 2020 17:33:11 +0100 Subject: [PATCH 2/3] Fixed code style --- Translation/Loader/Symfony/XliffLoader.php | 2 +- Translation/Loader/XliffLoader.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Translation/Loader/Symfony/XliffLoader.php b/Translation/Loader/Symfony/XliffLoader.php index ac414f1c..a33af1a2 100644 --- a/Translation/Loader/Symfony/XliffLoader.php +++ b/Translation/Loader/Symfony/XliffLoader.php @@ -42,7 +42,7 @@ class XliffLoader implements LoaderInterface public function load($resource, $locale, $domain = 'messages') { $previous = libxml_use_internal_errors(true); - if (false === $xml = simplexml_load_file((string)$resource)) { + if (false === $xml = simplexml_load_file((string) $resource)) { libxml_use_internal_errors($previous); $error = libxml_get_last_error(); diff --git a/Translation/Loader/XliffLoader.php b/Translation/Loader/XliffLoader.php index 60fa3aba..73664d36 100644 --- a/Translation/Loader/XliffLoader.php +++ b/Translation/Loader/XliffLoader.php @@ -37,7 +37,7 @@ class XliffLoader implements LoaderInterface public function load($resource, $locale, $domain = 'messages') { $previous = libxml_use_internal_errors(true); - if (false === $doc = simplexml_load_file((string)$resource)) { + if (false === $doc = simplexml_load_file((string) $resource)) { libxml_use_internal_errors($previous); $libxmlError = libxml_get_last_error(); From 590ec3dd07167f5b7ebc4820e01eaa920887fd23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Parafi=C5=84ski?= Date: Tue, 17 Mar 2020 18:05:31 +0100 Subject: [PATCH 3/3] Added casting when building new FileResource from SplFile --- Translation/Loader/Symfony/XliffLoader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Translation/Loader/Symfony/XliffLoader.php b/Translation/Loader/Symfony/XliffLoader.php index a33af1a2..7cd12205 100644 --- a/Translation/Loader/Symfony/XliffLoader.php +++ b/Translation/Loader/Symfony/XliffLoader.php @@ -61,7 +61,7 @@ public function load($resource, $locale, $domain = 'messages') $catalogue->set($id, (string) $translation->target, $domain); } - $catalogue->addResource(new FileResource($resource)); + $catalogue->addResource(new FileResource((string) $resource)); return $catalogue; }