Skip to content

Commit

Permalink
Merge pull request #533 from ViniTou/fixed-strict-types-for-file-reso…
Browse files Browse the repository at this point in the history
…urce

Fixed object instead of string error introduced by strict_types
  • Loading branch information
goetas authored Mar 17, 2020
2 parents 9c48e69 + 590ec3d commit 4cf57e8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Translation/Loader/Symfony/XliffLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion Translation/Loader/XliffLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 4cf57e8

Please sign in to comment.