Skip to content

Commit 2c10869

Browse files
LuborRodRodion Liuborets
andauthored
SDK-2041 Support for non-latin documents when fetching session configuration (#249)
Co-authored-by: Rodion Liuborets <[email protected]>
1 parent 5e3710e commit 2c10869

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

src/DocScan/Session/Retrieve/Configuration/Capture/Document/SupportedDocumentResponse.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,17 @@ class SupportedDocumentResponse
1010
private $type;
1111

1212
/**
13-
* @param array<string, string> $supportedDocument
13+
* @var bool|null
14+
*/
15+
private $isStrictlyLatin;
16+
17+
/**
18+
* @param array<string, mixed> $supportedDocument
1419
*/
1520
public function __construct(array $supportedDocument)
1621
{
1722
$this->type = $supportedDocument['type'] ?? null;
23+
$this->isStrictlyLatin = $supportedDocument['is_strictly_latin'] ?? null;
1824
}
1925

2026
/**
@@ -26,4 +32,12 @@ public function getType(): ?string
2632
{
2733
return $this->type;
2834
}
35+
36+
/**
37+
* @return bool|null
38+
*/
39+
public function isStrictlyLatin(): ?bool
40+
{
41+
return $this->isStrictlyLatin;
42+
}
2943
}

tests/DocScan/Session/Retrieve/Configuration/Capture/Document/SupportedDocumentResponseTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ class SupportedDocumentResponseTest extends TestCase
1616
* @test
1717
* @covers ::__construct
1818
* @covers ::getType
19+
* @covers ::isStrictlyLatin
1920
*/
20-
public function shouldBuildCorrectly()
21+
public function shouldBuildCorrectly(): void
2122
{
22-
$result = new SupportedDocumentResponse(['type' => self::SOME_TYPE]);
23+
$result = new SupportedDocumentResponse(['type' => self::SOME_TYPE, 'is_strictly_latin' => true]);
2324

2425
$this->assertEquals(self::SOME_TYPE, $result->getType());
2526
$this->assertInstanceOf(SupportedDocumentResponse::class, $result);
27+
$this->assertTrue($result->isStrictlyLatin());
2628
}
2729
}

0 commit comments

Comments
 (0)