Skip to content

Commit 7f3fcce

Browse files
committed
Apply some fixes related to php-versions
- 7.4: remove some trailing commas - 8.4: add null-type to ClientFactory init parameters
1 parent 322b789 commit 7f3fcce

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

example/use_glossaries.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use Scn\DeeplApiConnector\DeeplClientFactory;
88
use Scn\DeeplApiConnector\Enum\GlossarySubmissionEntryFormatEnum;
9+
use Scn\DeeplApiConnector\Enum\TextHandlingEnum;
910
use Scn\DeeplApiConnector\Model\GlossariesInterface;
1011
use Scn\DeeplApiConnector\Model\GlossaryEntries;
1112
use Scn\DeeplApiConnector\Model\GlossaryIdSubmission;
@@ -92,7 +93,12 @@
9293
'Hello World',
9394
$target,
9495
$source,
95-
glossaryId: $glossary !== false ? $glossary['glossary_id'] : ''
96+
[],
97+
[],
98+
[],
99+
TextHandlingEnum::SPLITSENTENCES_ON,
100+
TextHandlingEnum::PRESERVEFORMATTING_OFF,
101+
$glossary !== false ? $glossary['glossary_id'] : ''
96102
);
97103
$translationObj = $deepl->getTranslation($translationConfig);
98104
var_dump($translationObj);

src/DeeplClientFactory.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ final class DeeplClientFactory
1818
{
1919
public static function create(
2020
string $authKey,
21-
ClientInterface $httpClient = null,
22-
RequestFactoryInterface $requestFactory = null,
23-
StreamFactoryInterface $streamFactory = null
21+
?ClientInterface $httpClient = null,
22+
?RequestFactoryInterface $requestFactory = null,
23+
?StreamFactoryInterface $streamFactory = null
2424
): DeeplClientInterface {
2525
return new DeeplClient(
2626
new DeeplRequestFactory(

src/Model/BatchTranslationConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function __construct(
4242
array $ignoreTags = [],
4343
string $splitSentences = TextHandlingEnum::SPLITSENTENCES_ON,
4444
string $preserveFormatting = TextHandlingEnum::PRESERVEFORMATTING_OFF,
45-
string $glossaryId = '',
45+
string $glossaryId = ''
4646
) {
4747
$this->setText($text);
4848
$this->setTargetLang($targetLang);

src/Model/TranslationConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function __construct(
4040
array $ignoreTags = [],
4141
string $splitSentences = TextHandlingEnum::SPLITSENTENCES_ON,
4242
string $preserveFormatting = TextHandlingEnum::PRESERVEFORMATTING_OFF,
43-
string $glossaryId = '',
43+
string $glossaryId = ''
4444
) {
4545
$this->setText($text);
4646
$this->setTargetLang($targetLang);

0 commit comments

Comments
 (0)