Skip to content

Commit b92397c

Browse files
committed
fix: default to FormatPHPReader for the MessageLoader
1 parent 648fc0e commit b92397c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/MessageLoader.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
use FormatPHP\Exception\InvalidMessageShapeException;
2727
use FormatPHP\Exception\LocaleNotFoundException;
2828
use FormatPHP\Exception\UnableToProcessFileException;
29+
use FormatPHP\Format\Reader\FormatPHPReader;
2930
use FormatPHP\Format\ReaderInterface;
3031
use FormatPHP\Intl\Locale;
3132
use FormatPHP\Intl\LocaleInterface;
@@ -55,11 +56,11 @@ final class MessageLoader
5556
public function __construct(
5657
string $messagesDirectory,
5758
Config $config,
58-
ReaderInterface $formatReader,
59+
?ReaderInterface $formatReader = null,
5960
?FileSystemHelper $fileSystemHelper = null
6061
) {
6162
$this->config = $config;
62-
$this->formatReader = $formatReader;
63+
$this->formatReader = $formatReader ?? new FormatPHPReader();
6364
$this->fileSystemHelper = $fileSystemHelper ?? new FileSystemHelper();
6465
$this->messagesDirectory = $this->fileSystemHelper->getRealPath($messagesDirectory);
6566

0 commit comments

Comments
 (0)