diff --git a/example/use_glossaries.php b/example/use_glossaries.php index 00fbfce..8f6c18b 100644 --- a/example/use_glossaries.php +++ b/example/use_glossaries.php @@ -6,6 +6,7 @@ use Scn\DeeplApiConnector\DeeplClientFactory; use Scn\DeeplApiConnector\Enum\GlossarySubmissionEntryFormatEnum; +use Scn\DeeplApiConnector\Enum\TextHandlingEnum; use Scn\DeeplApiConnector\Model\GlossariesInterface; use Scn\DeeplApiConnector\Model\GlossaryEntries; use Scn\DeeplApiConnector\Model\GlossaryIdSubmission; @@ -92,7 +93,12 @@ 'Hello World', $target, $source, - glossaryId: $glossary !== false ? $glossary['glossary_id'] : '' + [], + [], + [], + TextHandlingEnum::SPLITSENTENCES_ON, + TextHandlingEnum::PRESERVEFORMATTING_OFF, + $glossary !== false ? $glossary['glossary_id'] : '' ); $translationObj = $deepl->getTranslation($translationConfig); var_dump($translationObj); diff --git a/src/DeeplClientFactory.php b/src/DeeplClientFactory.php index 6e580c2..3a8b37c 100644 --- a/src/DeeplClientFactory.php +++ b/src/DeeplClientFactory.php @@ -18,9 +18,9 @@ final class DeeplClientFactory { public static function create( string $authKey, - ClientInterface $httpClient = null, - RequestFactoryInterface $requestFactory = null, - StreamFactoryInterface $streamFactory = null + ?ClientInterface $httpClient = null, + ?RequestFactoryInterface $requestFactory = null, + ?StreamFactoryInterface $streamFactory = null ): DeeplClientInterface { return new DeeplClient( new DeeplRequestFactory( diff --git a/src/Model/BatchTranslationConfig.php b/src/Model/BatchTranslationConfig.php index d5e837e..1847060 100644 --- a/src/Model/BatchTranslationConfig.php +++ b/src/Model/BatchTranslationConfig.php @@ -42,7 +42,7 @@ public function __construct( array $ignoreTags = [], string $splitSentences = TextHandlingEnum::SPLITSENTENCES_ON, string $preserveFormatting = TextHandlingEnum::PRESERVEFORMATTING_OFF, - string $glossaryId = '', + string $glossaryId = '' ) { $this->setText($text); $this->setTargetLang($targetLang); diff --git a/src/Model/TranslationConfig.php b/src/Model/TranslationConfig.php index a03bc78..ab28b13 100644 --- a/src/Model/TranslationConfig.php +++ b/src/Model/TranslationConfig.php @@ -40,7 +40,7 @@ public function __construct( array $ignoreTags = [], string $splitSentences = TextHandlingEnum::SPLITSENTENCES_ON, string $preserveFormatting = TextHandlingEnum::PRESERVEFORMATTING_OFF, - string $glossaryId = '', + string $glossaryId = '' ) { $this->setText($text); $this->setTargetLang($targetLang);