From 9e8dbae9bd5c872dc24384bec8d5951ed044209f Mon Sep 17 00:00:00 2001 From: sebastianMindee <130448732+sebastianMindee@users.noreply.github.com> Date: Mon, 11 May 2026 14:56:49 +0200 Subject: [PATCH 1/9] :recycle: move all V1 and V2 logic to their own namespaces --- CHANGELOG.md | 9 +++++++ bin/MindeeCLICommand.php | 3 +-- .../InvoiceSplitterAutoExtractionExample.php | 2 +- .../MultiReceiptsAutoExtractionExample.php | 4 +-- src/Error/MindeeV2HttpException.php | 2 +- src/Error/MindeeV2HttpUnknownException.php | 2 +- src/Input/PredictMethodOptions.php | 5 ++-- src/{ => V1}/Client.php | 17 +++++++------ src/{Http/BaseApi.php => V1/HTTP/BaseAPI.php} | 6 ++--- src/{Http => V1/HTTP}/BaseEndpoint.php | 6 ++--- src/{Http => V1/HTTP}/Endpoint.php | 6 ++--- .../MindeeApi.php => V1/HTTP/MindeeAPI.php} | 6 ++--- .../HTTP/MindeeWorkflowAPI.php} | 4 +-- src/{Http => V1/HTTP}/ResponseValidation.php | 2 +- src/{Http => V1/HTTP}/WorkflowEndpoint.php | 6 ++--- src/{ClientV2.php => V2/Client.php} | 25 ++++++++++--------- .../HTTP/MindeeAPIV2.php} | 24 ++++++++---------- src/V2/Parsing/BaseInference.php | 3 --- .../V2 => V2/Parsing}/BaseResponse.php | 2 +- .../Parsing}/DataSchemaActiveOption.php | 2 +- .../V2 => V2/Parsing}/ErrorResponse.php | 2 +- .../V2 => V2/Parsing}/Field/BaseField.php | 2 +- .../Parsing}/Field/FieldConfidence.php | 2 +- .../V2 => V2/Parsing}/Field/FieldLocation.php | 2 +- .../Parsing}/Field/InferenceFields.php | 2 +- .../V2 => V2/Parsing}/Field/ListField.php | 4 +-- .../V2 => V2/Parsing}/Field/ObjectField.php | 2 +- .../V2 => V2/Parsing}/Field/SimpleField.php | 2 +- src/{Parsing/V2 => V2/Parsing}/Inference.php | 3 +-- .../Parsing}/InferenceActiveOptions.php | 2 +- .../V2 => V2/Parsing}/InferenceFile.php | 2 +- .../V2 => V2/Parsing}/InferenceJob.php | 2 +- .../V2 => V2/Parsing}/InferenceModel.php | 2 +- .../V2 => V2/Parsing}/InferenceResponse.php | 2 +- .../V2 => V2/Parsing}/InferenceResult.php | 4 +-- src/{Parsing/V2 => V2/Parsing}/Job.php | 2 +- .../V2 => V2/Parsing}/JobResponse.php | 2 +- src/{Parsing/V2 => V2/Parsing}/JobWebhook.php | 2 +- .../V2 => V2/Parsing}/RagMetadata.php | 2 +- src/{Parsing/V2 => V2/Parsing}/RawText.php | 2 +- .../V2 => V2/Parsing}/RawTextPage.php | 2 +- .../ClassificationClassifier.php | 2 +- .../Classification/ClassificationResponse.php | 2 +- src/V2/Product/Crop/CropItem.php | 4 +-- src/V2/Product/Crop/CropResponse.php | 2 +- src/V2/Product/Ocr/OcrResponse.php | 2 +- src/V2/Product/Split/SplitRange.php | 2 +- src/V2/Product/Split/SplitResponse.php | 2 +- tests/ClientTest.php | 2 +- tests/Input/LocalInputSourceTest.php | 10 ++++---- tests/Input/URLInputSourceTest.php | 5 ++-- tests/V1/Error/MindeeHttpExceptionTest.php | 2 +- tests/V1/Extraction/ImageExtractorTest.php | 4 +-- ...ceSplitterAutoExtractionTestFunctional.php | 2 +- tests/V1/Extraction/PdfExtractorTest.php | 2 +- tests/V1/Http/MindeeApiTest.php | 12 ++++----- .../V1/Input/URLInputSourceTestFunctional.php | 2 +- .../Common/AsyncPredictResponseTest.php | 2 +- .../Extras/ExtrasIntegrationFunctional.php | 2 +- .../Common/Extras/FullTextOcrExtraTest.php | 2 +- tests/V1/Workflow/WorkflowTestFunctional.php | 2 +- tests/V2/ClientV2Test.php | 24 +++++++++--------- tests/V2/ClientV2TestFunctional.php | 6 ++--- tests/V2/FileOperations/CropFunctional.php | 8 +++--- tests/V2/FileOperations/SplitFunctional.php | 10 ++++---- tests/V2/Input/LocalResponseV2Test.php | 2 +- tests/V2/Parsing/InferenceResponseTest.php | 14 +++++------ tests/V2/Parsing/JobResponseTest.php | 4 +-- tests/V2/Product/ClassificationFunctional.php | 6 ++--- tests/V2/Product/CropFunctional.php | 6 ++--- tests/V2/Product/OcrFunctional.php | 6 ++--- tests/V2/Product/SplitFunctional.php | 6 ++--- 72 files changed, 171 insertions(+), 169 deletions(-) rename src/{ => V1}/Client.php (98%) rename src/{Http/BaseApi.php => V1/HTTP/BaseAPI.php} (96%) rename src/{Http => V1/HTTP}/BaseEndpoint.php (94%) rename src/{Http => V1/HTTP}/Endpoint.php (97%) rename src/{Http/MindeeApi.php => V1/HTTP/MindeeAPI.php} (95%) rename src/{Http/MindeeWorkflowApi.php => V1/HTTP/MindeeWorkflowAPI.php} (94%) rename src/{Http => V1/HTTP}/ResponseValidation.php (99%) rename src/{Http => V1/HTTP}/WorkflowEndpoint.php (95%) rename src/{ClientV2.php => V2/Client.php} (92%) rename src/{Http/MindeeApiV2.php => V2/HTTP/MindeeAPIV2.php} (98%) rename src/{Parsing/V2 => V2/Parsing}/BaseResponse.php (95%) rename src/{Parsing/V2 => V2/Parsing}/DataSchemaActiveOption.php (95%) rename src/{Parsing/V2 => V2/Parsing}/ErrorResponse.php (97%) rename src/{Parsing/V2 => V2/Parsing}/Field/BaseField.php (98%) rename src/{Parsing/V2 => V2/Parsing}/Field/FieldConfidence.php (98%) rename src/{Parsing/V2 => V2/Parsing}/Field/FieldLocation.php (96%) rename src/{Parsing/V2 => V2/Parsing}/Field/InferenceFields.php (99%) rename src/{Parsing/V2 => V2/Parsing}/Field/ListField.php (94%) rename src/{Parsing/V2 => V2/Parsing}/Field/ObjectField.php (99%) rename src/{Parsing/V2 => V2/Parsing}/Field/SimpleField.php (96%) rename src/{Parsing/V2 => V2/Parsing}/Inference.php (93%) rename src/{Parsing/V2 => V2/Parsing}/InferenceActiveOptions.php (98%) rename src/{Parsing/V2 => V2/Parsing}/InferenceFile.php (97%) rename src/{Parsing/V2 => V2/Parsing}/InferenceJob.php (94%) rename src/{Parsing/V2 => V2/Parsing}/InferenceModel.php (94%) rename src/{Parsing/V2 => V2/Parsing}/InferenceResponse.php (94%) rename src/{Parsing/V2 => V2/Parsing}/InferenceResult.php (93%) rename src/{Parsing/V2 => V2/Parsing}/Job.php (98%) rename src/{Parsing/V2 => V2/Parsing}/JobResponse.php (93%) rename src/{Parsing/V2 => V2/Parsing}/JobWebhook.php (98%) rename src/{Parsing/V2 => V2/Parsing}/RagMetadata.php (93%) rename src/{Parsing/V2 => V2/Parsing}/RawText.php (96%) rename src/{Parsing/V2 => V2/Parsing}/RawTextPage.php (94%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d9b1131..9003c542 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Mindee PHP API Library Changelog +## v3.0.0-alpha1 - 2026-05-11 +### ¡Breaking Changes! +* +### Changes +* :sparkles: add support for extraction in crop, split, and classification +### Fixes +* + + ## v2.9.0 - 2026-05-07 ### Changes * :sparkles: add support for extraction in crop, split, and classification diff --git a/bin/MindeeCLICommand.php b/bin/MindeeCLICommand.php index c7334193..abd7f083 100644 --- a/bin/MindeeCLICommand.php +++ b/bin/MindeeCLICommand.php @@ -2,7 +2,6 @@ namespace Mindee\CLI; -use Mindee\Client; use Mindee\Error\MindeeHttpException; use Mindee\Input\InputSource; use Mindee\Input\PageOptions; @@ -12,12 +11,12 @@ use Mindee\Input\URLInputSource; use Mindee\Parsing\Common\AsyncPredictResponse; use Mindee\Parsing\Common\PredictResponse; +use Mindee\V1\Client; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; - use const Mindee\Input\KEEP_ONLY; use const Mindee\Input\REMOVE; use const Mindee\VERSION; diff --git a/examples/InvoiceSplitterAutoExtractionExample.php b/examples/InvoiceSplitterAutoExtractionExample.php index f9b61dce..9ee4a4f4 100644 --- a/examples/InvoiceSplitterAutoExtractionExample.php +++ b/examples/InvoiceSplitterAutoExtractionExample.php @@ -1,10 +1,10 @@ 0 ? $endpointVersion : '1'; - $endpointSettings = new MindeeApi($this->apiKey, $endpointName, $endpointOwner, $endpointVersion); + $endpointSettings = new MindeeAPI($this->apiKey, $endpointName, $endpointOwner, $endpointVersion); return new Endpoint($endpointName, $endpointOwner, $endpointVersion, $endpointSettings); } @@ -329,7 +330,7 @@ private function makeWorkflowExecutionRequest( string $workflowId, PredictMethodOptions $options ): WorkflowResponse { - $workflowRouterSettings = new MindeeWorkflowApi($this->apiKey, $workflowId); + $workflowRouterSettings = new MindeeWorkflowAPI($this->apiKey, $workflowId); $options->endpoint = new WorkflowEndpoint($workflowRouterSettings); if (!$options->pageOptions->isEmpty()) { if ($inputDoc instanceof LocalInputSource) { diff --git a/src/Http/BaseApi.php b/src/V1/HTTP/BaseAPI.php similarity index 96% rename from src/Http/BaseApi.php rename to src/V1/HTTP/BaseAPI.php index a9bdad22..b3e2f58c 100644 --- a/src/Http/BaseApi.php +++ b/src/V1/HTTP/BaseAPI.php @@ -4,7 +4,7 @@ * Settings and variables linked to all API usage. */ -namespace Mindee\Http; +namespace Mindee\V1\HTTP; /** * Default key name for the API key entry in environment variables. @@ -30,7 +30,7 @@ */ const TIMEOUT_DEFAULT = 120; // phpcs:disable -include_once(dirname(__DIR__) . '/version.php'); +include_once(dirname(__DIR__, 2) . '/version.php'); // phpcs:enable use const Mindee\VERSION; @@ -54,7 +54,7 @@ function getUserAgent(): string /** * Base class for API settings. */ -abstract class BaseApi +abstract class BaseAPI { /** * @var string|null API key. diff --git a/src/Http/BaseEndpoint.php b/src/V1/HTTP/BaseEndpoint.php similarity index 94% rename from src/Http/BaseEndpoint.php rename to src/V1/HTTP/BaseEndpoint.php index 06cdcaff..29b64073 100644 --- a/src/Http/BaseEndpoint.php +++ b/src/V1/HTTP/BaseEndpoint.php @@ -1,6 +1,6 @@ urlName = $urlName; diff --git a/src/Http/MindeeApi.php b/src/V1/HTTP/MindeeAPI.php similarity index 95% rename from src/Http/MindeeApi.php rename to src/V1/HTTP/MindeeAPI.php index bf206b66..ccc7a5cf 100644 --- a/src/Http/MindeeApi.php +++ b/src/V1/HTTP/MindeeAPI.php @@ -4,16 +4,16 @@ * Settings and variables linked to endpoint calling & API usage. */ -namespace Mindee\Http; +namespace Mindee\V1\HTTP; -use Mindee\Client; use Mindee\Error\ErrorCode; use Mindee\Error\MindeeException; +use Mindee\V1\Client; /** * Data class containing settings for endpoints. */ -class MindeeApi extends BaseApi +class MindeeAPI extends BaseAPI { /** * @var string Name of the endpoint. diff --git a/src/Http/MindeeWorkflowApi.php b/src/V1/HTTP/MindeeWorkflowAPI.php similarity index 94% rename from src/Http/MindeeWorkflowApi.php rename to src/V1/HTTP/MindeeWorkflowAPI.php index 0e0a6f2d..38a57953 100644 --- a/src/Http/MindeeWorkflowApi.php +++ b/src/V1/HTTP/MindeeWorkflowAPI.php @@ -4,7 +4,7 @@ * Settings and variables linked to endpoint calling & API usage. */ -namespace Mindee\Http; +namespace Mindee\V1\HTTP; use Mindee\Error\ErrorCode; use Mindee\Error\MindeeException; @@ -12,7 +12,7 @@ /** * Data class containing settings for workflows. */ -class MindeeWorkflowApi extends BaseApi +class MindeeWorkflowAPI extends BaseAPI { /** * @var string ID of the workflow. diff --git a/src/Http/ResponseValidation.php b/src/V1/HTTP/ResponseValidation.php similarity index 99% rename from src/Http/ResponseValidation.php rename to src/V1/HTTP/ResponseValidation.php index 74d3518d..047ce24d 100644 --- a/src/Http/ResponseValidation.php +++ b/src/V1/HTTP/ResponseValidation.php @@ -4,7 +4,7 @@ * Settings and variables linked to endpoint calling & API usage. */ -namespace Mindee\Http; +namespace Mindee\V1\HTTP; /** * Wrapper class for http requests/responses validation handling. diff --git a/src/Http/WorkflowEndpoint.php b/src/V1/HTTP/WorkflowEndpoint.php similarity index 95% rename from src/Http/WorkflowEndpoint.php rename to src/V1/HTTP/WorkflowEndpoint.php index 219a70e1..23387e69 100644 --- a/src/Http/WorkflowEndpoint.php +++ b/src/V1/HTTP/WorkflowEndpoint.php @@ -1,6 +1,6 @@ mindeeApi = new MindeeApiV2($apiKey ?: getenv('MINDEE_V2_API_KEY')); + $this->mindeeApi = new MindeeAPIV2($apiKey ?: getenv('MINDEE_V2_API_KEY')); } /** @@ -81,7 +82,7 @@ public function getInference(string $inferenceId): InferenceResponse * @param string $responseClass The response class to construct. * @phpstan-param class-string $responseClass * @param string $resultUrl URL of the result. - * @return T A response containing parsing results. + * @return BaseResponse A response containing parsing results. */ public function getResultFromUrl( string $responseClass, @@ -95,7 +96,7 @@ public function getResultFromUrl( * @param string $responseClass The response class to construct. * @phpstan-param class-string $responseClass * @param string $resultId ID of the result. - * @return T A response containing parsing results. + * @return BaseResponse A response containing parsing results. */ public function getResult( string $responseClass, @@ -142,7 +143,7 @@ public function enqueueAndGetInference( * @phpstan-param class-string $responseClass * @param InputSource $inputDoc Input document to parse. * @param BaseParameters $params Parameters relating to prediction options. - * @return T A response containing parsing results. + * @return BaseResponse A response containing parsing results. * @throws MindeeException Throws if enqueueing fails, job fails, or times out. */ public function enqueueAndGetResult( diff --git a/src/Http/MindeeApiV2.php b/src/V2/HTTP/MindeeAPIV2.php similarity index 98% rename from src/Http/MindeeApiV2.php rename to src/V2/HTTP/MindeeAPIV2.php index 38c9957f..2d69cfe6 100644 --- a/src/Http/MindeeApiV2.php +++ b/src/V2/HTTP/MindeeAPIV2.php @@ -4,36 +4,34 @@ * Settings and variables linked to endpoint calling & API usage. */ -namespace Mindee\Http; +namespace Mindee\V2\HTTP; use CurlHandle; use Exception; use Mindee\Error\ErrorCode; use Mindee\Error\MindeeApiException; use Mindee\Error\MindeeException; - -// phpcs:disable -include_once(dirname(__DIR__) . '/version.php'); - -// phpcs:enable - use Mindee\Error\MindeeV2HttpException; use Mindee\Error\MindeeV2HttpUnknownException; -use Mindee\Input\InferenceParameters; use Mindee\Input\InputSource; use Mindee\Input\LocalInputSource; use Mindee\Input\URLInputSource; -use Mindee\Parsing\V2\BaseResponse; -use Mindee\Parsing\V2\ErrorResponse; -use Mindee\Parsing\V2\InferenceResponse; -use Mindee\Parsing\V2\JobResponse; use Mindee\V2\ClientOptions\BaseParameters; +use Mindee\V2\Parsing\BaseResponse; +use Mindee\V2\Parsing\ErrorResponse; +use Mindee\V2\Parsing\InferenceResponse; +use Mindee\V2\Parsing\JobResponse; use ReflectionClass; use ReflectionException; use ReflectionProperty; use const Mindee\VERSION; +// phpcs:disable +include_once(dirname(__DIR__, 2) . '/version.php'); + +// phpcs:enable + /** * Default key name for the API key entry in environment variables. */ @@ -61,7 +59,7 @@ /** * Data class containing settings for endpoints. */ -class MindeeApiV2 +class MindeeAPIV2 { /** * Get the User Agent to send for API calls. diff --git a/src/V2/Parsing/BaseInference.php b/src/V2/Parsing/BaseInference.php index 27dcb0f9..1461d213 100644 --- a/src/V2/Parsing/BaseInference.php +++ b/src/V2/Parsing/BaseInference.php @@ -3,9 +3,6 @@ namespace Mindee\V2\Parsing; use Mindee\Parsing\Common\SummaryHelper; -use Mindee\Parsing\V2\InferenceFile; -use Mindee\Parsing\V2\InferenceJob; -use Mindee\Parsing\V2\InferenceModel; /** * Base for all inference-based V2 products. diff --git a/src/Parsing/V2/BaseResponse.php b/src/V2/Parsing/BaseResponse.php similarity index 95% rename from src/Parsing/V2/BaseResponse.php rename to src/V2/Parsing/BaseResponse.php index 783f7c3e..a397cbe4 100644 --- a/src/Parsing/V2/BaseResponse.php +++ b/src/V2/Parsing/BaseResponse.php @@ -1,6 +1,6 @@ + * @var ObjectField */ public array $items; diff --git a/src/Parsing/V2/Field/ObjectField.php b/src/V2/Parsing/Field/ObjectField.php similarity index 99% rename from src/Parsing/V2/Field/ObjectField.php rename to src/V2/Parsing/Field/ObjectField.php index cfd440d0..5de6cc3d 100644 --- a/src/Parsing/V2/Field/ObjectField.php +++ b/src/V2/Parsing/Field/ObjectField.php @@ -1,6 +1,6 @@ assertEquals("my-api-key", $settings->apiKey); $this->assertEquals(InvoiceSplitterV1::$endpointName, $settings->endpointName); - $this->assertEquals(\Mindee\Client::DEFAULT_OWNER, $settings->accountName); + $this->assertEquals(\Mindee\V1\Client::DEFAULT_OWNER, $settings->accountName); $this->assertEquals("1", $settings->version); } public function testGivenCustomParametersAProperMindeeApiObjectShouldBeCreated() { - $settings = new MindeeApi("my-api-key", "custom-endpoint-name", "custom-owner-name", "1.3"); + $settings = new MindeeAPI("my-api-key", "custom-endpoint-name", "custom-owner-name", "1.3"); $this->assertEquals("my-api-key", $settings->apiKey); $this->assertEquals("custom-endpoint-name", $settings->endpointName); $this->assertEquals("custom-owner-name", $settings->accountName); @@ -43,6 +43,6 @@ public function testGivenInvalidApiKeyAnExceptionShouldBeThrown() { $this->expectException(MindeeException::class); putenv(API_KEY_ENV_NAME . '='); - new MindeeApi(null, InvoiceSplitterV1::$endpointName); + new MindeeAPI(null, InvoiceSplitterV1::$endpointName); } } diff --git a/tests/V1/Input/URLInputSourceTestFunctional.php b/tests/V1/Input/URLInputSourceTestFunctional.php index 432de859..596e8043 100644 --- a/tests/V1/Input/URLInputSourceTestFunctional.php +++ b/tests/V1/Input/URLInputSourceTestFunctional.php @@ -2,8 +2,8 @@ namespace V1\Input; -use Mindee\Client; use Mindee\Product\Invoice\InvoiceV4; +use Mindee\V1\Client; use PHPUnit\Framework\TestCase; class URLInputSourceTestFunctional extends TestCase diff --git a/tests/V1/Parsing/Common/AsyncPredictResponseTest.php b/tests/V1/Parsing/Common/AsyncPredictResponseTest.php index f48e153f..de3e8f41 100644 --- a/tests/V1/Parsing/Common/AsyncPredictResponseTest.php +++ b/tests/V1/Parsing/Common/AsyncPredictResponseTest.php @@ -2,9 +2,9 @@ namespace V1\Parsing\Common; -use Mindee\Http\ResponseValidation; use Mindee\Parsing\Common\AsyncPredictResponse; use Mindee\Product\InvoiceSplitter\InvoiceSplitterV1; +use Mindee\V1\HTTP\ResponseValidation; use PHPUnit\Framework\TestCase; class AsyncPredictResponseTest extends TestCase diff --git a/tests/V1/Parsing/Common/Extras/ExtrasIntegrationFunctional.php b/tests/V1/Parsing/Common/Extras/ExtrasIntegrationFunctional.php index 65e84521..9632cd34 100644 --- a/tests/V1/Parsing/Common/Extras/ExtrasIntegrationFunctional.php +++ b/tests/V1/Parsing/Common/Extras/ExtrasIntegrationFunctional.php @@ -2,11 +2,11 @@ namespace V1\Parsing\Common\Extras; -use Mindee\Client; use Mindee\Input\PredictMethodOptions; use Mindee\Input\PredictOptions; use Mindee\Product\InternationalId\InternationalIdV2; use Mindee\Product\Invoice\InvoiceV4; +use Mindee\V1\Client; use PHPUnit\Framework\TestCase; class ExtrasIntegrationFunctional extends TestCase diff --git a/tests/V1/Parsing/Common/Extras/FullTextOcrExtraTest.php b/tests/V1/Parsing/Common/Extras/FullTextOcrExtraTest.php index 48896e73..964826ac 100644 --- a/tests/V1/Parsing/Common/Extras/FullTextOcrExtraTest.php +++ b/tests/V1/Parsing/Common/Extras/FullTextOcrExtraTest.php @@ -16,7 +16,7 @@ protected function setUp(): void private function loadDocument() { - $dummyClient = new \Mindee\Client("dummy-key"); + $dummyClient = new \Mindee\V1\Client("dummy-key"); $localResponse = new \Mindee\Input\LocalResponse($this->extrasDir . '/full_text_ocr/complete.json'); $response = $dummyClient->loadPrediction(InternationalIdV2::class, $localResponse); return $response->document; diff --git a/tests/V1/Workflow/WorkflowTestFunctional.php b/tests/V1/Workflow/WorkflowTestFunctional.php index 1144e612..1e93ab5e 100644 --- a/tests/V1/Workflow/WorkflowTestFunctional.php +++ b/tests/V1/Workflow/WorkflowTestFunctional.php @@ -2,10 +2,10 @@ namespace V1\Workflow; -use Mindee\Client; use Mindee\Input\PredictMethodOptions; use Mindee\Input\WorkflowOptions; use Mindee\Product\FinancialDocument\FinancialDocumentV1; +use Mindee\V1\Client; use PHPUnit\Framework\TestCase; require_once(__DIR__ . "/../../TestingUtilities.php"); diff --git a/tests/V2/ClientV2Test.php b/tests/V2/ClientV2Test.php index 3de066ed..e7cebd36 100644 --- a/tests/V2/ClientV2Test.php +++ b/tests/V2/ClientV2Test.php @@ -2,23 +2,23 @@ namespace V2; -use Mindee\ClientV2; use Mindee\Error\MindeeException; -use Mindee\Http\MindeeApiV2; +use Mindee\V2\HTTP\MindeeAPIV2; use Mindee\Input\InferenceParameters; use Mindee\Input\LocalInputSource; use Mindee\Input\LocalResponse; use Mindee\Input\PathInput; -use Mindee\Parsing\V2\InferenceResponse; -use Mindee\Parsing\V2\JobResponse; +use Mindee\V2\Client; +use Mindee\V2\Parsing\InferenceResponse; +use Mindee\V2\Parsing\JobResponse; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; class ClientV2Test extends TestCase { - private static function makeClientWithMockedApi(MindeeApiV2 $mockedApi): ClientV2 + private static function makeClientWithMockedApi(MindeeAPIV2 $mockedApi): Client { - $client = new ClientV2("dummy"); + $client = new Client("dummy"); $reflection = new \ReflectionClass($client); $property = $reflection->getProperty('mindeeApi'); $property->setAccessible(true); @@ -28,7 +28,7 @@ private static function makeClientWithMockedApi(MindeeApiV2 $mockedApi): ClientV public function testEnqueuePostAsync(): void { - $predictable = $this->createMock(MindeeApiV2::class); + $predictable = $this->createMock(MindeeAPIV2::class); $syntheticResponse = file_get_contents(\TestingUtilities::getV2DataDir() . '/job/ok_processing.json'); $predictable->expects($this->once()) ->method('reqPostEnqueue') @@ -51,8 +51,8 @@ public function testEnqueuePostAsync(): void public function testDocumentGetJobAsync(): void { - /** @var MindeeApiV2&MockObject $predictable */ - $predictable = $this->createMock(MindeeApiV2::class); + /** @var MindeeAPIV2&MockObject $predictable */ + $predictable = $this->createMock(MindeeAPIV2::class); $syntheticResponse = file_get_contents(\TestingUtilities::getV2DataDir() . '/job/ok_processing.json'); $processing = new JobResponse(json_decode($syntheticResponse, true)); @@ -72,8 +72,8 @@ public function testDocumentGetJobAsync(): void public function testDocumentGetInferenceAsync(): void { - /** @var MindeeApiV2&MockObject $predictable */ - $predictable = $this->createMock(MindeeApiV2::class); + /** @var MindeeAPIV2&MockObject $predictable */ + $predictable = $this->createMock(MindeeAPIV2::class); $jsonFile = \TestingUtilities::getV2DataDir() . '/products/extraction/financial_document/complete.json'; $this->assertFileExists($jsonFile, 'Test resource file must exist'); @@ -141,7 +141,7 @@ public function testInvalidBaseUrlRaisesMindeeException(): void putenv('MINDEE_V2_BASE_URL=https://invalid-v2.mindee.net'); try { - $client = new ClientV2('dummy-key'); + $client = new Client('dummy-key'); $input = new PathInput(\TestingUtilities::getFileTypesDir() . '/pdf/blank_1.pdf'); $params = new InferenceParameters('dummy-model-id'); $client->enqueueAndGetInference($input, $params); diff --git a/tests/V2/ClientV2TestFunctional.php b/tests/V2/ClientV2TestFunctional.php index e2e70991..6bbb4341 100644 --- a/tests/V2/ClientV2TestFunctional.php +++ b/tests/V2/ClientV2TestFunctional.php @@ -2,17 +2,17 @@ namespace V2; -use Mindee\ClientV2; use Mindee\Error\MindeeV2HttpException; use Mindee\Input\InferenceParameters; use Mindee\Input\PathInput; use Mindee\Input\URLInputSource; +use Mindee\V2\Client; use PHPUnit\Framework\TestCase; use TestingUtilities; class ClientV2TestFunctional extends TestCase { - private ClientV2 $mindeeClient; + private Client $mindeeClient; private string $modelId; protected function setUp(): void @@ -20,7 +20,7 @@ protected function setUp(): void $apiKey = getenv('MINDEE_V2_API_KEY'); $this->modelId = getenv('MINDEE_V2_FINDOC_MODEL_ID'); - $this->mindeeClient = new ClientV2($apiKey); + $this->mindeeClient = new Client($apiKey); } public function testParseFileEmptyMultiPageMustSucceed(): void diff --git a/tests/V2/FileOperations/CropFunctional.php b/tests/V2/FileOperations/CropFunctional.php index c7de38b2..a2d771a9 100644 --- a/tests/V2/FileOperations/CropFunctional.php +++ b/tests/V2/FileOperations/CropFunctional.php @@ -2,18 +2,18 @@ namespace V2\FileOperations; -use Mindee\ClientV2; use Mindee\Input\InferenceParameters; use Mindee\Input\PathInput; -use Mindee\Parsing\V2\InferenceResponse; +use Mindee\V2\Client; use Mindee\V2\FileOperations\Crop; +use Mindee\V2\Parsing\InferenceResponse; use Mindee\V2\Product\Crop\CropResponse; use Mindee\V2\Product\Crop\Params\CropParameters; use PHPUnit\Framework\TestCase; class CropFunctional extends TestCase { - private ClientV2 $client; + private Client $client; private string $cropModelId; private string $findocModelId; private string $outputDir; @@ -21,7 +21,7 @@ class CropFunctional extends TestCase protected function setUp(): void { $apiKey = getenv('MINDEE_V2_API_KEY') ?: ''; - $this->client = new ClientV2($apiKey); + $this->client = new Client($apiKey); $this->cropModelId = getenv('MINDEE_V2_CROP_MODEL_ID') ?: ''; $this->findocModelId = getenv('MINDEE_V2_FINDOC_MODEL_ID') ?: ''; diff --git a/tests/V2/FileOperations/SplitFunctional.php b/tests/V2/FileOperations/SplitFunctional.php index dd12191d..862bd3f4 100644 --- a/tests/V2/FileOperations/SplitFunctional.php +++ b/tests/V2/FileOperations/SplitFunctional.php @@ -2,18 +2,18 @@ namespace V2\FileOperations; -use Mindee\ClientV2; use Mindee\Input\InferenceParameters; use Mindee\Input\PathInput; -use Mindee\Parsing\V2\InferenceResponse; +use Mindee\V2\Client; use Mindee\V2\FileOperations\Split; -use Mindee\V2\Product\Split\SplitResponse; +use Mindee\V2\Parsing\InferenceResponse; use Mindee\V2\Product\Split\Params\SplitParameters; +use Mindee\V2\Product\Split\SplitResponse; use PHPUnit\Framework\TestCase; class SplitFunctional extends TestCase { - private ClientV2 $client; + private Client $client; private string $splitModelId; private string $findocModelId; private string $outputDir; @@ -21,7 +21,7 @@ class SplitFunctional extends TestCase protected function setUp(): void { $apiKey = getenv('MINDEE_V2_API_KEY') ?: ''; - $this->client = new ClientV2($apiKey); + $this->client = new Client($apiKey); $this->splitModelId = getenv('MINDEE_V2_SPLIT_MODEL_ID') ?: ''; $this->findocModelId = getenv('MINDEE_V2_FINDOC_MODEL_ID') ?: ''; diff --git a/tests/V2/Input/LocalResponseV2Test.php b/tests/V2/Input/LocalResponseV2Test.php index 0b1b761e..e34acca4 100644 --- a/tests/V2/Input/LocalResponseV2Test.php +++ b/tests/V2/Input/LocalResponseV2Test.php @@ -3,7 +3,7 @@ namespace V2\Input; use Mindee\Input\LocalResponse; -use Mindee\Parsing\V2\InferenceResponse; +use Mindee\V2\Parsing\InferenceResponse; use PHPUnit\Framework\TestCase; class LocalResponseV2Test extends TestCase diff --git a/tests/V2/Parsing/InferenceResponseTest.php b/tests/V2/Parsing/InferenceResponseTest.php index 89b9b1c6..f335f280 100644 --- a/tests/V2/Parsing/InferenceResponseTest.php +++ b/tests/V2/Parsing/InferenceResponseTest.php @@ -5,13 +5,13 @@ use Mindee\Error\ErrorItem; use Mindee\Geometry\Point; use Mindee\Input\LocalResponse; -use Mindee\Parsing\V2\ErrorResponse; -use Mindee\Parsing\V2\Field\FieldConfidence; -use Mindee\Parsing\V2\Field\ListField; -use Mindee\Parsing\V2\Field\ObjectField; -use Mindee\Parsing\V2\Field\SimpleField; -use Mindee\Parsing\V2\InferenceResponse; -use Mindee\Parsing\V2\JobResponse; +use Mindee\V2\Parsing\ErrorResponse; +use Mindee\V2\Parsing\Field\FieldConfidence; +use Mindee\V2\Parsing\Field\ListField; +use Mindee\V2\Parsing\Field\ObjectField; +use Mindee\V2\Parsing\Field\SimpleField; +use Mindee\V2\Parsing\InferenceResponse; +use Mindee\V2\Parsing\JobResponse; use PHPUnit\Framework\TestCase; use TestingUtilities; diff --git a/tests/V2/Parsing/JobResponseTest.php b/tests/V2/Parsing/JobResponseTest.php index 0a09d4d5..898582f6 100644 --- a/tests/V2/Parsing/JobResponseTest.php +++ b/tests/V2/Parsing/JobResponseTest.php @@ -4,8 +4,8 @@ use DateTime; use Mindee\Error\ErrorItem; -use Mindee\Parsing\V2\ErrorResponse; -use Mindee\Parsing\V2\JobResponse; +use Mindee\V2\Parsing\ErrorResponse; +use Mindee\V2\Parsing\JobResponse; use PHPUnit\Framework\TestCase; use TestingUtilities; diff --git a/tests/V2/Product/ClassificationFunctional.php b/tests/V2/Product/ClassificationFunctional.php index 5d91bce7..3227212d 100644 --- a/tests/V2/Product/ClassificationFunctional.php +++ b/tests/V2/Product/ClassificationFunctional.php @@ -3,8 +3,8 @@ namespace V2\Product; -use Mindee\ClientV2; use Mindee\Input\PathInput; +use Mindee\V2\Client; use Mindee\V2\Product\Classification\ClassificationResponse; use Mindee\V2\Product\Classification\Params\ClassificationParameters; use PHPUnit\Framework\TestCase; @@ -14,13 +14,13 @@ class ClassificationFunctional extends TestCase { - private ClientV2 $client; + private Client $client; private string $classificationModelId; protected function setUp(): void { $apiKey = getenv('MINDEE_V2_API_KEY'); - $this->client = new ClientV2($apiKey); + $this->client = new Client($apiKey); $this->classificationModelId = getenv('MINDEE_V2_CLASSIFICATION_MODEL_ID') ?: ''; } diff --git a/tests/V2/Product/CropFunctional.php b/tests/V2/Product/CropFunctional.php index d509cb37..9ba83619 100644 --- a/tests/V2/Product/CropFunctional.php +++ b/tests/V2/Product/CropFunctional.php @@ -2,8 +2,8 @@ namespace V2\Product; -use Mindee\ClientV2; use Mindee\Input\PathInput; +use Mindee\V2\Client; use Mindee\V2\Product\Crop\CropResponse; use Mindee\V2\Product\Crop\Params\CropParameters; use PHPUnit\Framework\TestCase; @@ -13,14 +13,14 @@ class CropFunctional extends TestCase { - private ClientV2 $client; + private Client $client; private string $cropModelId; private string $cropExtractionModelId; protected function setUp(): void { $apiKey = getenv('MINDEE_V2_API_KEY'); - $this->client = new ClientV2($apiKey); + $this->client = new Client($apiKey); $this->cropModelId = getenv('MINDEE_V2_CROP_MODEL_ID') ?: ''; $this->cropExtractionModelId = getenv('MINDEE_V2_SE_TESTS_CROP_EXTRACTION_MODEL_ID') ?: ''; diff --git a/tests/V2/Product/OcrFunctional.php b/tests/V2/Product/OcrFunctional.php index 70d1eb1d..b65af80f 100644 --- a/tests/V2/Product/OcrFunctional.php +++ b/tests/V2/Product/OcrFunctional.php @@ -2,8 +2,8 @@ namespace V2\Product; -use Mindee\ClientV2; use Mindee\Input\PathInput; +use Mindee\V2\Client; use Mindee\V2\Product\Ocr\OcrResponse; use Mindee\V2\Product\Ocr\Params\OcrParameters; use PHPUnit\Framework\TestCase; @@ -13,13 +13,13 @@ class OcrFunctional extends TestCase { - private ClientV2 $client; + private Client $client; private string $ocrModelId; protected function setUp(): void { $apiKey = getenv('MINDEE_V2_API_KEY'); - $this->client = new ClientV2($apiKey); + $this->client = new Client($apiKey); $this->ocrModelId = getenv('MINDEE_V2_OCR_MODEL_ID') ?: ''; } diff --git a/tests/V2/Product/SplitFunctional.php b/tests/V2/Product/SplitFunctional.php index 92d2cbc8..aa89b158 100644 --- a/tests/V2/Product/SplitFunctional.php +++ b/tests/V2/Product/SplitFunctional.php @@ -2,8 +2,8 @@ namespace V2\Product; -use Mindee\ClientV2; use Mindee\Input\PathInput; +use Mindee\V2\Client; use Mindee\V2\Product\Split\Params\SplitParameters; use Mindee\V2\Product\Split\SplitResponse; use PHPUnit\Framework\TestCase; @@ -13,13 +13,13 @@ class SplitFunctional extends TestCase { - private ClientV2 $client; + private Client $client; private string $splitModelId; protected function setUp(): void { $apiKey = getenv('MINDEE_V2_API_KEY'); - $this->client = new ClientV2($apiKey); + $this->client = new Client($apiKey); $this->splitModelId = getenv('MINDEE_V2_SPLIT_MODEL_ID') ?: ''; } From 31071f37a93acba1ecf751626e64bef66a81bf32 Mon Sep 17 00:00:00 2001 From: sebastianMindee <130448732+sebastianMindee@users.noreply.github.com> Date: Mon, 11 May 2026 14:59:12 +0200 Subject: [PATCH 2/9] fix smoke tests --- docs/code_samples/v2_classification.txt | 4 ++-- docs/code_samples/v2_crop.txt | 4 ++-- docs/code_samples/v2_extraction_polling.txt | 4 ++-- docs/code_samples/v2_extraction_webhook.txt | 4 ++-- docs/code_samples/v2_ocr.txt | 4 ++-- docs/code_samples/v2_split.txt | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/code_samples/v2_classification.txt b/docs/code_samples/v2_classification.txt index 1995f910..8dd97a82 100644 --- a/docs/code_samples/v2_classification.txt +++ b/docs/code_samples/v2_classification.txt @@ -1,6 +1,6 @@ Date: Mon, 11 May 2026 15:05:32 +0200 Subject: [PATCH 3/9] fix v1 samples --- docs/code_samples/bank_account_details_v1.txt | 4 ++-- docs/code_samples/bank_account_details_v2.txt | 4 ++-- docs/code_samples/bank_check_v1.txt | 4 ++-- docs/code_samples/barcode_reader_v1.txt | 4 ++-- docs/code_samples/bill_of_lading_v1_async.txt | 4 ++-- docs/code_samples/business_card_v1_async.txt | 4 ++-- docs/code_samples/carte_grise_v1.txt | 4 ++-- docs/code_samples/cropper_v1.txt | 4 ++-- docs/code_samples/custom_v1.txt | 4 ++-- docs/code_samples/default.txt | 4 ++-- docs/code_samples/default_async.txt | 4 ++-- docs/code_samples/delivery_notes_v1_async.txt | 4 ++-- docs/code_samples/driver_license_v1_async.txt | 4 ++-- docs/code_samples/energy_bill_fra_v1_async.txt | 4 ++-- docs/code_samples/expense_receipts_v5.txt | 4 ++-- docs/code_samples/expense_receipts_v5_async.txt | 4 ++-- docs/code_samples/financial_document_v1.txt | 4 ++-- docs/code_samples/financial_document_v1_async.txt | 4 ++-- docs/code_samples/french_healthcard_v1_async.txt | 4 ++-- docs/code_samples/idcard_fr_v1.txt | 4 ++-- docs/code_samples/idcard_fr_v2.txt | 4 ++-- docs/code_samples/ind_passport_v1_async.txt | 4 ++-- docs/code_samples/international_id_v2_async.txt | 4 ++-- docs/code_samples/invoice_splitter_v1_async.txt | 4 ++-- docs/code_samples/invoices_v4.txt | 4 ++-- docs/code_samples/invoices_v4_async.txt | 4 ++-- docs/code_samples/multi_receipts_detector_v1.txt | 4 ++-- docs/code_samples/nutrition_facts_v1_async.txt | 4 ++-- docs/code_samples/passport_v1.txt | 4 ++-- docs/code_samples/payslip_fra_v3_async.txt | 4 ++-- docs/code_samples/resume_v1_async.txt | 4 ++-- docs/code_samples/us_healthcare_cards_v1_async.txt | 4 ++-- docs/code_samples/us_mail_v3_async.txt | 4 ++-- docs/code_samples/workflow_execution.txt | 2 +- docs/code_samples/workflow_polling.txt | 4 ++-- 35 files changed, 69 insertions(+), 69 deletions(-) diff --git a/docs/code_samples/bank_account_details_v1.txt b/docs/code_samples/bank_account_details_v1.txt index dfd63f64..af944d38 100644 --- a/docs/code_samples/bank_account_details_v1.txt +++ b/docs/code_samples/bank_account_details_v1.txt @@ -1,7 +1,7 @@ Date: Mon, 11 May 2026 15:48:43 +0200 Subject: [PATCH 4/9] :recycle: move inputs and client options --- bin/MindeeCLICommand.php | 4 ++-- docs/code_samples/custom_v1.txt | 2 +- docs/code_samples/default.txt | 2 +- docs/code_samples/default_async.txt | 2 +- docs/code_samples/workflow_execution.txt | 2 +- docs/code_samples/workflow_polling.txt | 2 +- src/{Input => ClientOptions}/PollingOptions.php | 2 +- src/V1/Client.php | 6 +++--- src/{Input => V1/ClientOptions}/CommonOptions.php | 2 +- src/{Input => V1/ClientOptions}/PredictMethodOptions.php | 3 ++- src/{Input => V1/ClientOptions}/PredictOptions.php | 2 +- src/{Input => V1/ClientOptions}/WorkflowOptions.php | 2 +- src/V1/HTTP/Endpoint.php | 2 +- src/V1/HTTP/WorkflowEndpoint.php | 2 +- src/V2/Client.php | 4 ++-- src/V2/ClientOptions/BaseParameters.php | 2 +- .../Classification/Params/ClassificationParameters.php | 2 +- src/V2/Product/Crop/Params/CropParameters.php | 2 +- src/{Input => V2/Product/Extraction/Params}/DataSchema.php | 2 +- .../Product/Extraction/Params}/DataSchemaField.php | 2 +- .../Product/Extraction/Params}/DataSchemaReplace.php | 2 +- .../Product/Extraction/Params}/InferenceParameters.php | 3 ++- src/V2/Product/Ocr/Params/OcrParameters.php | 2 +- src/V2/Product/Split/Params/SplitParameters.php | 2 +- tests/ClientTest.php | 4 ++-- tests/V1/Parsing/Common/Extras/CropperExtraTest.php | 2 +- .../Parsing/Common/Extras/ExtrasIntegrationFunctional.php | 4 ++-- tests/V1/Workflow/WorkflowTestFunctional.php | 4 ++-- tests/V2/ClientV2Test.php | 4 ++-- tests/V2/ClientV2TestFunctional.php | 2 +- tests/V2/FileOperations/CropFunctional.php | 2 +- tests/V2/FileOperations/SplitFunctional.php | 2 +- tests/V2/Input/InferenceParameterTest.php | 4 ++-- 33 files changed, 44 insertions(+), 42 deletions(-) rename src/{Input => ClientOptions}/PollingOptions.php (98%) rename src/{Input => V1/ClientOptions}/CommonOptions.php (96%) rename src/{Input => V1/ClientOptions}/PredictMethodOptions.php (97%) rename src/{Input => V1/ClientOptions}/PredictOptions.php (98%) rename src/{Input => V1/ClientOptions}/WorkflowOptions.php (97%) rename src/{Input => V2/Product/Extraction/Params}/DataSchema.php (98%) rename src/{Input => V2/Product/Extraction/Params}/DataSchemaField.php (98%) rename src/{Input => V2/Product/Extraction/Params}/DataSchemaReplace.php (96%) rename src/{Input => V2/Product/Extraction/Params}/InferenceParameters.php (97%) diff --git a/bin/MindeeCLICommand.php b/bin/MindeeCLICommand.php index abd7f083..243fb6c5 100644 --- a/bin/MindeeCLICommand.php +++ b/bin/MindeeCLICommand.php @@ -6,12 +6,12 @@ use Mindee\Input\InputSource; use Mindee\Input\PageOptions; use Mindee\Input\PathInput; -use Mindee\Input\PredictMethodOptions; -use Mindee\Input\PredictOptions; use Mindee\Input\URLInputSource; use Mindee\Parsing\Common\AsyncPredictResponse; use Mindee\Parsing\Common\PredictResponse; use Mindee\V1\Client; +use Mindee\V1\ClientOptions\PredictMethodOptions; +use Mindee\V1\ClientOptions\PredictOptions; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; diff --git a/docs/code_samples/custom_v1.txt b/docs/code_samples/custom_v1.txt index cae07036..4a19629d 100644 --- a/docs/code_samples/custom_v1.txt +++ b/docs/code_samples/custom_v1.txt @@ -8,7 +8,7 @@ use Mindee\V1\Client; use Mindee\V1\Product\Custom\CustomV1; -use Mindee\Input\PredictMethodOptions; +use Mindee\V1\ClientOptions\PredictMethodOptions; // Init a new client $mindeeClient = new Client("my-api-key"); diff --git a/docs/code_samples/default.txt b/docs/code_samples/default.txt index 44711848..b6e7b3c4 100644 --- a/docs/code_samples/default.txt +++ b/docs/code_samples/default.txt @@ -2,7 +2,7 @@ use Mindee\V1\Client; use Mindee\V1\Product\Generated\GeneratedV1; -use Mindee\Input\PredictMethodOptions; +use Mindee\V1\ClientOptions\PredictMethodOptions; // Init a new client $mindeeClient = new Client("my-api-key"); diff --git a/docs/code_samples/default_async.txt b/docs/code_samples/default_async.txt index 9ed44696..c1f5e632 100644 --- a/docs/code_samples/default_async.txt +++ b/docs/code_samples/default_async.txt @@ -2,7 +2,7 @@ use Mindee\V1\Client; use Mindee\V1\Product\Generated\GeneratedV1; -use Mindee\Input\PredictMethodOptions; +use Mindee\V1\ClientOptions\PredictMethodOptions; // Init a new client $mindeeClient = new Client("my-api-key"); diff --git a/docs/code_samples/workflow_execution.txt b/docs/code_samples/workflow_execution.txt index f9b0ed4e..cf8ca9be 100644 --- a/docs/code_samples/workflow_execution.txt +++ b/docs/code_samples/workflow_execution.txt @@ -2,7 +2,7 @@ use Mindee\V1\Client; -use Mindee\Input\WorkflowOptions; +use Mindee\V1\ClientOptions\WorkflowOptions; $workflowId = "workflow-id"; diff --git a/docs/code_samples/workflow_polling.txt b/docs/code_samples/workflow_polling.txt index f39c1290..3271bdaa 100644 --- a/docs/code_samples/workflow_polling.txt +++ b/docs/code_samples/workflow_polling.txt @@ -2,7 +2,7 @@ use Mindee\V1\Client; -use Mindee\Input\PredictMethodOptions; +use Mindee\V1\ClientOptions\PredictMethodOptions; use Mindee\V1\Product\Generated\GeneratedV1; $workflowId = "workflow-id"; diff --git a/src/Input/PollingOptions.php b/src/ClientOptions/PollingOptions.php similarity index 98% rename from src/Input/PollingOptions.php rename to src/ClientOptions/PollingOptions.php index 60e2c3e3..99f4b5f1 100644 --- a/src/Input/PollingOptions.php +++ b/src/ClientOptions/PollingOptions.php @@ -1,6 +1,6 @@ Date: Mon, 11 May 2026 16:23:31 +0200 Subject: [PATCH 5/9] move more things --- bin/MindeeCLICommand.php | 4 +- bin/MindeeCLIDocuments.php | 52 +++---- .../InvoiceSplitterAutoExtractionExample.php | 8 +- .../MultiReceiptsAutoExtractionExample.php | 4 +- .../DependencyChecker.php | 2 +- src/Extraction/ExtractedImage.php | 2 +- .../{ExtractedPdf.php => ExtractedPDF.php} | 6 +- src/Extraction/ImageExtractor.php | 4 +- .../{PdfExtractor.php => PDFExtractor.php} | 12 +- src/Image/ImageCompressor.php | 4 +- src/PDF/PDFCompressor.php | 10 +- src/PDF/PDFUtils.php | 2 +- src/Parsing/Common/SummaryHelper.php | 17 +-- src/V1/Client.php | 10 +- src/{ => V1}/Parsing/Common/ApiRequest.php | 2 +- src/{ => V1}/Parsing/Common/ApiResponse.php | 4 +- .../Parsing/Common/AsyncPredictResponse.php | 6 +- src/{ => V1}/Parsing/Common/Document.php | 16 +- src/{ => V1}/Parsing/Common/Execution.php | 4 +- src/{ => V1}/Parsing/Common/ExecutionFile.php | 2 +- .../Parsing/Common/Extras/CropperExtra.php | 4 +- src/{ => V1}/Parsing/Common/Extras/Extras.php | 2 +- .../Common/Extras/FullTextOcrExtra.php | 4 +- .../Parsing/Common/Extras/RAGExtra.php | 2 +- src/{ => V1}/Parsing/Common/Inference.php | 10 +- src/{ => V1}/Parsing/Common/Job.php | 2 +- .../Parsing/Common/OCR}/MVisionV1.php | 4 +- .../Ocr.php => V1/Parsing/Common/OCR/OCR.php} | 6 +- .../Parsing/Common/OCR/OCRLine.php} | 10 +- .../Parsing/Common/OCR/OCRPage.php} | 28 ++-- .../Parsing/Common/OCR/OCRWord.php} | 6 +- .../Parsing/Common/OrientationField.php | 4 +- src/{ => V1}/Parsing/Common/Page.php | 4 +- .../Parsing/Common/PredictResponse.php | 4 +- src/{ => V1}/Parsing/Common/Prediction.php | 2 +- src/{ => V1}/Parsing/Common/Product.php | 2 +- src/V1/Parsing/Common/SummaryHelperV1.php | 24 +++ .../Parsing/Common/WorkflowResponse.php | 4 +- .../Parsing/Generated/GeneratedListField.php | 4 +- .../Generated/GeneratedObjectField.php | 4 +- .../Parsing/Standard/AddressField.php | 2 +- src/{ => V1}/Parsing/Standard/AmountField.php | 2 +- src/{ => V1}/Parsing/Standard/BaseField.php | 2 +- .../Parsing/Standard/BooleanField.php | 6 +- .../Parsing/Standard/ClassificationField.php | 2 +- .../Standard/CompanyRegistrationField.php | 8 +- src/{ => V1}/Parsing/Standard/DateField.php | 2 +- .../Parsing/Standard/FieldConfidenceMixin.php | 2 +- .../Parsing/Standard/FieldPositionMixin.php | 3 +- src/{ => V1}/Parsing/Standard/LocaleField.php | 2 +- .../Parsing/Standard/PaymentDetailsField.php | 2 +- .../Parsing/Standard/PositionField.php | 2 +- src/{ => V1}/Parsing/Standard/StringField.php | 2 +- src/{ => V1}/Parsing/Standard/TaxField.php | 2 +- src/{ => V1}/Parsing/Standard/Taxes.php | 2 +- .../Product/BarcodeReader/BarcodeReaderV1.php | 8 +- .../BarcodeReader/BarcodeReaderV1Document.php | 10 +- .../Product/BillOfLading/BillOfLadingV1.php | 8 +- .../BillOfLading/BillOfLadingV1Carrier.php | 22 +-- .../BillOfLadingV1CarrierItem.php | 48 +++--- .../BillOfLadingV1CarrierItems.php | 2 +- .../BillOfLading/BillOfLadingV1Consignee.php | 26 ++-- .../BillOfLading/BillOfLadingV1Document.php | 12 +- .../BillOfLadingV1NotifyParty.php | 26 ++-- .../BillOfLading/BillOfLadingV1Shipper.php | 26 ++-- .../Product/BusinessCard/BusinessCardV1.php | 8 +- .../BusinessCard/BusinessCardV1Document.php | 10 +- src/{ => V1}/Product/Cropper/CropperV1.php | 8 +- .../Product/Cropper/CropperV1Document.php | 4 +- .../Product/Cropper/CropperV1Page.php | 8 +- .../Product/DeliveryNote/DeliveryNoteV1.php | 8 +- .../DeliveryNote/DeliveryNoteV1Document.php | 14 +- .../Product/DriverLicense/DriverLicenseV1.php | 8 +- .../DriverLicense/DriverLicenseV1Document.php | 12 +- .../FinancialDocument/FinancialDocumentV1.php | 8 +- .../FinancialDocumentV1Document.php | 26 ++-- .../FinancialDocumentV1LineItem.php | 60 ++++---- .../FinancialDocumentV1LineItems.php | 2 +- .../BankAccountDetailsV1.php | 8 +- .../BankAccountDetailsV1Document.php | 10 +- .../BankAccountDetailsV2.php | 8 +- .../BankAccountDetailsV2Bban.php | 26 ++-- .../BankAccountDetailsV2Document.php | 10 +- .../Product/Fr/CarteGrise/CarteGriseV1.php | 8 +- .../Fr/CarteGrise/CarteGriseV1Document.php | 12 +- .../Product/Fr/EnergyBill/EnergyBillV1.php | 8 +- .../Fr/EnergyBill/EnergyBillV1Document.php | 14 +- .../EnergyBill/EnergyBillV1EnergyConsumer.php | 18 +-- .../EnergyBill/EnergyBillV1EnergySupplier.php | 18 +-- .../Fr/EnergyBill/EnergyBillV1EnergyUsage.php | 60 ++++---- .../EnergyBill/EnergyBillV1EnergyUsages.php | 2 +- .../Fr/EnergyBill/EnergyBillV1MeterDetail.php | 22 +-- .../EnergyBill/EnergyBillV1Subscription.php | 48 +++--- .../EnergyBill/EnergyBillV1Subscriptions.php | 2 +- .../EnergyBillV1TaxesAndContribution.php | 48 +++--- .../EnergyBillV1TaxesAndContributions.php | 2 +- .../Product/Fr/HealthCard/HealthCardV1.php | 8 +- .../Fr/HealthCard/HealthCardV1Document.php | 12 +- src/{ => V1}/Product/Fr/IdCard/IdCardV1.php | 8 +- .../Product/Fr/IdCard/IdCardV1Document.php | 12 +- .../Product/Fr/IdCard/IdCardV1Page.php | 8 +- src/{ => V1}/Product/Fr/IdCard/IdCardV2.php | 8 +- .../Product/Fr/IdCard/IdCardV2Document.php | 12 +- .../Product/Fr/IdCard/IdCardV2Page.php | 8 +- src/{ => V1}/Product/Fr/Payslip/PayslipV3.php | 8 +- .../Fr/Payslip/PayslipV3BankAccountDetail.php | 22 +-- .../Product/Fr/Payslip/PayslipV3Document.php | 8 +- .../Product/Fr/Payslip/PayslipV3Employee.php | 38 ++--- .../Product/Fr/Payslip/PayslipV3Employer.php | 38 ++--- .../Fr/Payslip/PayslipV3Employment.php | 38 ++--- .../Fr/Payslip/PayslipV3PaidTimeOff.php | 42 +++--- .../Fr/Payslip/PayslipV3PaidTimeOffs.php | 2 +- .../Product/Fr/Payslip/PayslipV3PayDetail.php | 50 +++---- .../Product/Fr/Payslip/PayslipV3PayPeriod.php | 30 ++-- .../Fr/Payslip/PayslipV3SalaryDetail.php | 42 +++--- .../Fr/Payslip/PayslipV3SalaryDetails.php | 2 +- .../Product/Generated/GeneratedV1.php | 6 +- .../Product/Generated/GeneratedV1Document.php | 8 +- .../Product/Generated/GeneratedV1Page.php | 8 +- .../Generated/GeneratedV1Prediction.php | 14 +- .../Ind/IndianPassport/IndianPassportV1.php | 8 +- .../IndianPassportV1Document.php | 14 +- .../InternationalId/InternationalIdV2.php | 8 +- .../InternationalIdV2Document.php | 14 +- src/{ => V1}/Product/Invoice/InvoiceV4.php | 8 +- .../Product/Invoice/InvoiceV4Document.php | 26 ++-- .../Product/Invoice/InvoiceV4LineItem.php | 60 ++++---- .../Product/Invoice/InvoiceV4LineItems.php | 2 +- .../InvoiceSplitter/InvoiceSplitterV1.php | 8 +- .../InvoiceSplitterV1Document.php | 8 +- .../InvoiceSplitterV1InvoicePageGroup.php | 14 +- .../InvoiceSplitterV1InvoicePageGroups.php | 2 +- .../MultiReceiptsDetectorV1.php | 8 +- .../MultiReceiptsDetectorV1Document.php | 10 +- .../NutritionFactsLabelV1.php | 8 +- .../NutritionFactsLabelV1AddedSugar.php | 22 +-- .../NutritionFactsLabelV1Calorie.php | 22 +-- .../NutritionFactsLabelV1Cholesterol.php | 22 +-- .../NutritionFactsLabelV1DietaryFiber.php | 22 +-- .../NutritionFactsLabelV1Document.php | 10 +- .../NutritionFactsLabelV1Nutrient.php | 42 +++--- .../NutritionFactsLabelV1Nutrients.php | 2 +- .../NutritionFactsLabelV1Protein.php | 22 +-- .../NutritionFactsLabelV1SaturatedFat.php | 22 +-- .../NutritionFactsLabelV1ServingSize.php | 18 +-- .../NutritionFactsLabelV1Sodium.php | 26 ++-- ...NutritionFactsLabelV1TotalCarbohydrate.php | 22 +-- .../NutritionFactsLabelV1TotalFat.php | 22 +-- .../NutritionFactsLabelV1TotalSugar.php | 22 +-- .../NutritionFactsLabelV1TransFat.php | 22 +-- src/{ => V1}/Product/Passport/PassportV1.php | 8 +- .../Product/Passport/PassportV1Document.php | 12 +- src/{ => V1}/Product/Receipt/ReceiptV5.php | 8 +- .../Product/Receipt/ReceiptV5Document.php | 22 +-- .../Product/Receipt/ReceiptV5LineItem.php | 36 ++--- .../Product/Receipt/ReceiptV5LineItems.php | 2 +- src/{ => V1}/Product/Resume/ResumeV1.php | 8 +- .../Product/Resume/ResumeV1Certificate.php | 36 ++--- .../Product/Resume/ResumeV1Certificates.php | 2 +- .../Product/Resume/ResumeV1Document.php | 12 +- .../Product/Resume/ResumeV1Education.php | 54 +++---- .../Product/Resume/ResumeV1Educations.php | 2 +- .../Product/Resume/ResumeV1Language.php | 24 +-- .../Product/Resume/ResumeV1Languages.php | 2 +- .../Resume/ResumeV1ProfessionalExperience.php | 66 ++++----- .../ResumeV1ProfessionalExperiences.php | 2 +- .../Resume/ResumeV1SocialNetworksUrl.php | 24 +-- .../Resume/ResumeV1SocialNetworksUrls.php | 2 +- .../Product/Us/BankCheck/BankCheckV1.php | 8 +- .../Us/BankCheck/BankCheckV1Document.php | 14 +- .../Product/Us/BankCheck/BankCheckV1Page.php | 8 +- .../Us/HealthcareCard/HealthcareCardV1.php | 8 +- .../HealthcareCard/HealthcareCardV1Copay.php | 24 +-- .../HealthcareCard/HealthcareCardV1Copays.php | 2 +- .../HealthcareCardV1Document.php | 12 +- src/{ => V1}/Product/Us/UsMail/UsMailV3.php | 8 +- .../Product/Us/UsMail/UsMailV3Document.php | 12 +- .../Us/UsMail/UsMailV3RecipientAddress.php | 60 ++++---- .../Us/UsMail/UsMailV3RecipientAddresses.php | 2 +- .../Us/UsMail/UsMailV3SenderAddress.php | 30 ++-- src/V2/Client.php | 4 +- src/V2/FileOperations/Split.php | 10 +- src/V2/FileOperations/SplitFiles.php | 8 +- src/V2/HTTP/MindeeAPIV2.php | 4 +- src/V2/Parsing/BaseInference.php | 3 + src/{Error => V2/Parsing}/ErrorItem.php | 2 +- src/V2/Parsing/ErrorResponse.php | 2 - .../Parsing/{ => Inference}/BaseResponse.php | 2 +- .../{ => Inference}/Field/BaseField.php | 2 +- .../{ => Inference}/Field/FieldConfidence.php | 2 +- .../{ => Inference}/Field/FieldLocation.php | 2 +- .../{ => Inference}/Field/InferenceFields.php | 2 +- .../{ => Inference}/Field/ListField.php | 2 +- .../{ => Inference}/Field/ObjectField.php | 2 +- .../{ => Inference}/Field/SimpleField.php | 2 +- src/V2/Parsing/{ => Inference}/Inference.php | 3 +- .../InferenceActiveOptions.php | 3 +- .../Parsing/{ => Inference}/InferenceFile.php | 2 +- .../Parsing/{ => Inference}/InferenceJob.php | 2 +- .../{ => Inference}/InferenceModel.php | 2 +- .../{ => Inference}/InferenceResponse.php | 2 +- .../{ => Inference}/InferenceResult.php | 10 +- .../RAGMetadata.php} | 4 +- src/V2/Parsing/{ => Inference}/RawText.php | 2 +- .../Parsing/{ => Inference}/RawTextPage.php | 2 +- src/V2/Parsing/JobResponse.php | 2 + .../ClassificationClassifier.php | 2 +- .../Classification/ClassificationResponse.php | 2 +- src/V2/Product/Crop/CropItem.php | 4 +- src/V2/Product/Crop/CropResponse.php | 2 +- .../Params}/DataSchemaActiveOption.php | 2 +- src/V2/Product/Ocr/OcrResponse.php | 2 +- src/V2/Product/Split/SplitRange.php | 2 +- src/V2/Product/Split/SplitResponse.php | 2 +- tests/ClientTest.php | 12 +- ...=> DependencyCheckerNoExtendedTestPDF.php} | 14 +- ...fTest.php => DependencyCheckerPDFTest.php} | 4 +- tests/Input/LocalInputSourceTest.php | 139 +++++++++--------- tests/V1/Error/MindeeHttpExceptionTest.php | 2 +- tests/V1/Extraction/ImageExtractorTest.php | 6 +- ...ceSplitterAutoExtractionTestFunctional.php | 14 +- ...ExtractorTest.php => PDFExtractorTest.php} | 14 +- tests/V1/Http/MindeeApiTest.php | 2 +- .../V1/Input/URLInputSourceTestFunctional.php | 2 +- .../Common/AsyncPredictResponseTest.php | 4 +- .../Common/Extras/CropperExtraTest.php | 4 +- .../Extras/ExtrasIntegrationFunctional.php | 4 +- .../Common/Extras/FullTextOcrExtraTest.php | 2 +- .../{Ocr/OcrTest.php => OCR/OCRTest.php} | 10 +- .../V1/Parsing/Common/PredictResponseTest.php | 6 +- .../BarcodeReader/BarcodeReaderV1Test.php | 6 +- .../BillOfLading/BillOfLadingV1Test.php | 6 +- .../BusinessCard/BusinessCardV1Test.php | 6 +- tests/V1/Product/Cropper/CropperV1Test.php | 10 +- .../DeliveryNote/DeliveryNoteV1Test.php | 6 +- .../DriverLicense/DriverLicenseV1Test.php | 6 +- .../FinancialDocumentV1Test.php | 14 +- .../BankAccountDetailsV1Test.php | 6 +- .../BankAccountDetailsV2Test.php | 6 +- .../Fr/CarteGrise/CarteGriseV1Test.php | 6 +- .../Fr/EnergyBill/EnergyBillV1Test.php | 6 +- .../Fr/HealthCard/HealthCardV1Test.php | 6 +- tests/V1/Product/Fr/IdCard/IdCardV1Test.php | 10 +- tests/V1/Product/Fr/IdCard/IdCardV2Test.php | 10 +- tests/V1/Product/Fr/Payslip/PayslipV3Test.php | 6 +- .../V1/Product/Generated/GeneratedV1Test.php | 16 +- .../IndianPassport/IndianPassportV1Test.php | 6 +- .../InternationalId/InternationalIdV2Test.php | 6 +- tests/V1/Product/Invoice/InvoiceV4Test.php | 6 +- .../InvoiceSplitter/InvoiceSplitterV1Test.php | 6 +- .../MultiReceiptsDetectorV1Test.php | 6 +- .../NutritionFactsLabelV1Test.php | 6 +- tests/V1/Product/Passport/PassportV1Test.php | 6 +- tests/V1/Product/Receipt/ReceiptV5Test.php | 6 +- tests/V1/Product/Resume/ResumeV1Test.php | 6 +- .../Product/Us/BankCheck/BankCheckV1Test.php | 10 +- .../HealthcareCard/HealthcareCardV1Test.php | 6 +- tests/V1/Product/Us/UsMail/UsMailV3Test.php | 6 +- tests/V1/Standard/AmountFieldTest.php | 2 +- tests/V1/Standard/ClassificationFieldTest.php | 2 +- .../Standard/CompanyRegistrationFieldTest.php | 2 +- tests/V1/Standard/DateFieldTest.php | 2 +- tests/V1/Standard/LocaleFieldTest.php | 2 +- tests/V1/Standard/PaymentDetailsFieldTest.php | 2 +- tests/V1/Standard/PositionFieldTest.php | 2 +- tests/V1/Standard/StringFieldTest.php | 2 +- tests/V1/Standard/TaxesTest.php | 2 +- tests/V1/Workflow/WorkflowTest.php | 4 +- tests/V1/Workflow/WorkflowTestFunctional.php | 2 +- tests/V2/ClientV2Test.php | 2 +- tests/V2/FileOperations/CropFunctional.php | 4 +- tests/V2/FileOperations/SplitFunctional.php | 4 +- tests/V2/Input/LocalResponseV2Test.php | 2 +- tests/V2/Parsing/InferenceResponseTest.php | 12 +- tests/V2/Parsing/JobResponseTest.php | 2 +- 275 files changed, 1547 insertions(+), 1533 deletions(-) rename src/{Parsing => Dependency}/DependencyChecker.php (99%) rename src/Extraction/{ExtractedPdf.php => ExtractedPDF.php} (96%) rename src/Extraction/{PdfExtractor.php => PDFExtractor.php} (95%) rename src/{ => V1}/Parsing/Common/ApiRequest.php (96%) rename src/{ => V1}/Parsing/Common/ApiResponse.php (85%) rename src/{ => V1}/Parsing/Common/AsyncPredictResponse.php (78%) rename src/{ => V1}/Parsing/Common/Document.php (85%) rename src/{ => V1}/Parsing/Common/Execution.php (97%) rename src/{ => V1}/Parsing/Common/ExecutionFile.php (93%) rename src/{ => V1}/Parsing/Common/Extras/CropperExtra.php (92%) rename src/{ => V1}/Parsing/Common/Extras/Extras.php (98%) rename src/{ => V1}/Parsing/Common/Extras/FullTextOcrExtra.php (90%) rename src/{ => V1}/Parsing/Common/Extras/RAGExtra.php (94%) rename src/{ => V1}/Parsing/Common/Inference.php (84%) rename src/{ => V1}/Parsing/Common/Job.php (98%) rename src/{Parsing/Common/Ocr => V1/Parsing/Common/OCR}/MVisionV1.php (86%) rename src/{Parsing/Common/Ocr/Ocr.php => V1/Parsing/Common/OCR/OCR.php} (90%) rename src/{Parsing/Common/Ocr/OcrLine.php => V1/Parsing/Common/OCR/OCRLine.php} (80%) rename src/{Parsing/Common/Ocr/OcrPage.php => V1/Parsing/Common/OCR/OCRPage.php} (82%) rename src/{Parsing/Common/Ocr/OcrWord.php => V1/Parsing/Common/OCR/OCRWord.php} (86%) rename src/{ => V1}/Parsing/Common/OrientationField.php (93%) rename src/{ => V1}/Parsing/Common/Page.php (96%) rename src/{ => V1}/Parsing/Common/PredictResponse.php (79%) rename src/{ => V1}/Parsing/Common/Prediction.php (85%) rename src/{ => V1}/Parsing/Common/Product.php (94%) create mode 100644 src/V1/Parsing/Common/SummaryHelperV1.php rename src/{ => V1}/Parsing/Common/WorkflowResponse.php (90%) rename src/{ => V1}/Parsing/Generated/GeneratedListField.php (96%) rename src/{ => V1}/Parsing/Generated/GeneratedObjectField.php (97%) rename src/{ => V1}/Parsing/Standard/AddressField.php (98%) rename src/{ => V1}/Parsing/Standard/AmountField.php (96%) rename src/{ => V1}/Parsing/Standard/BaseField.php (98%) rename src/{ => V1}/Parsing/Standard/BooleanField.php (86%) rename src/{ => V1}/Parsing/Standard/ClassificationField.php (95%) rename src/{ => V1}/Parsing/Standard/CompanyRegistrationField.php (87%) rename src/{ => V1}/Parsing/Standard/DateField.php (98%) rename src/{ => V1}/Parsing/Standard/FieldConfidenceMixin.php (94%) rename src/{ => V1}/Parsing/Standard/FieldPositionMixin.php (94%) rename src/{ => V1}/Parsing/Standard/LocaleField.php (98%) rename src/{ => V1}/Parsing/Standard/PaymentDetailsField.php (98%) rename src/{ => V1}/Parsing/Standard/PositionField.php (98%) rename src/{ => V1}/Parsing/Standard/StringField.php (96%) rename src/{ => V1}/Parsing/Standard/TaxField.php (98%) rename src/{ => V1}/Parsing/Standard/Taxes.php (97%) rename src/{ => V1}/Product/BarcodeReader/BarcodeReaderV1.php (84%) rename src/{ => V1}/Product/BarcodeReader/BarcodeReaderV1Document.php (87%) rename src/{ => V1}/Product/BillOfLading/BillOfLadingV1.php (84%) rename src/{ => V1}/Product/BillOfLading/BillOfLadingV1Carrier.php (72%) rename src/{ => V1}/Product/BillOfLading/BillOfLadingV1CarrierItem.php (57%) rename src/{ => V1}/Product/BillOfLading/BillOfLadingV1CarrierItems.php (97%) rename src/{ => V1}/Product/BillOfLading/BillOfLadingV1Consignee.php (71%) rename src/{ => V1}/Product/BillOfLading/BillOfLadingV1Document.php (95%) rename src/{ => V1}/Product/BillOfLading/BillOfLadingV1NotifyParty.php (71%) rename src/{ => V1}/Product/BillOfLading/BillOfLadingV1Shipper.php (70%) rename src/{ => V1}/Product/BusinessCard/BusinessCardV1.php (84%) rename src/{ => V1}/Product/BusinessCard/BusinessCardV1Document.php (95%) rename src/{ => V1}/Product/Cropper/CropperV1.php (84%) rename src/{ => V1}/Product/Cropper/CropperV1Document.php (75%) rename src/{ => V1}/Product/Cropper/CropperV1Page.php (84%) rename src/{ => V1}/Product/DeliveryNote/DeliveryNoteV1.php (84%) rename src/{ => V1}/Product/DeliveryNote/DeliveryNoteV1Document.php (91%) rename src/{ => V1}/Product/DriverLicense/DriverLicenseV1.php (84%) rename src/{ => V1}/Product/DriverLicense/DriverLicenseV1Document.php (95%) rename src/{ => V1}/Product/FinancialDocument/FinancialDocumentV1.php (84%) rename src/{ => V1}/Product/FinancialDocument/FinancialDocumentV1Document.php (96%) rename src/{ => V1}/Product/FinancialDocument/FinancialDocumentV1LineItem.php (55%) rename src/{ => V1}/Product/FinancialDocument/FinancialDocumentV1LineItems.php (97%) rename src/{ => V1}/Product/Fr/BankAccountDetails/BankAccountDetailsV1.php (84%) rename src/{ => V1}/Product/Fr/BankAccountDetails/BankAccountDetailsV1Document.php (88%) rename src/{ => V1}/Product/Fr/BankAccountDetails/BankAccountDetailsV2.php (84%) rename src/{ => V1}/Product/Fr/BankAccountDetails/BankAccountDetailsV2Bban.php (70%) rename src/{ => V1}/Product/Fr/BankAccountDetails/BankAccountDetailsV2Document.php (90%) rename src/{ => V1}/Product/Fr/CarteGrise/CarteGriseV1.php (84%) rename src/{ => V1}/Product/Fr/CarteGrise/CarteGriseV1Document.php (98%) rename src/{ => V1}/Product/Fr/EnergyBill/EnergyBillV1.php (84%) rename src/{ => V1}/Product/Fr/EnergyBill/EnergyBillV1Document.php (95%) rename src/{ => V1}/Product/Fr/EnergyBill/EnergyBillV1EnergyConsumer.php (75%) rename src/{ => V1}/Product/Fr/EnergyBill/EnergyBillV1EnergySupplier.php (75%) rename src/{ => V1}/Product/Fr/EnergyBill/EnergyBillV1EnergyUsage.php (56%) rename src/{ => V1}/Product/Fr/EnergyBill/EnergyBillV1EnergyUsages.php (98%) rename src/{ => V1}/Product/Fr/EnergyBill/EnergyBillV1MeterDetail.php (72%) rename src/{ => V1}/Product/Fr/EnergyBill/EnergyBillV1Subscription.php (58%) rename src/{ => V1}/Product/Fr/EnergyBill/EnergyBillV1Subscriptions.php (97%) rename src/{ => V1}/Product/Fr/EnergyBill/EnergyBillV1TaxesAndContribution.php (59%) rename src/{ => V1}/Product/Fr/EnergyBill/EnergyBillV1TaxesAndContributions.php (97%) rename src/{ => V1}/Product/Fr/HealthCard/HealthCardV1.php (84%) rename src/{ => V1}/Product/Fr/HealthCard/HealthCardV1Document.php (89%) rename src/{ => V1}/Product/Fr/IdCard/IdCardV1.php (84%) rename src/{ => V1}/Product/Fr/IdCard/IdCardV1Document.php (94%) rename src/{ => V1}/Product/Fr/IdCard/IdCardV1Page.php (82%) rename src/{ => V1}/Product/Fr/IdCard/IdCardV2.php (84%) rename src/{ => V1}/Product/Fr/IdCard/IdCardV2Document.php (95%) rename src/{ => V1}/Product/Fr/IdCard/IdCardV2Page.php (86%) rename src/{ => V1}/Product/Fr/Payslip/PayslipV3.php (84%) rename src/{ => V1}/Product/Fr/Payslip/PayslipV3BankAccountDetail.php (72%) rename src/{ => V1}/Product/Fr/Payslip/PayslipV3Document.php (96%) rename src/{ => V1}/Product/Fr/Payslip/PayslipV3Employee.php (66%) rename src/{ => V1}/Product/Fr/Payslip/PayslipV3Employer.php (66%) rename src/{ => V1}/Product/Fr/Payslip/PayslipV3Employment.php (66%) rename src/{ => V1}/Product/Fr/Payslip/PayslipV3PaidTimeOff.php (60%) rename src/{ => V1}/Product/Fr/Payslip/PayslipV3PaidTimeOffs.php (97%) rename src/{ => V1}/Product/Fr/Payslip/PayslipV3PayDetail.php (69%) rename src/{ => V1}/Product/Fr/Payslip/PayslipV3PayPeriod.php (69%) rename src/{ => V1}/Product/Fr/Payslip/PayslipV3SalaryDetail.php (61%) rename src/{ => V1}/Product/Fr/Payslip/PayslipV3SalaryDetails.php (97%) rename src/{ => V1}/Product/Generated/GeneratedV1.php (88%) rename src/{ => V1}/Product/Generated/GeneratedV1Document.php (90%) rename src/{ => V1}/Product/Generated/GeneratedV1Page.php (91%) rename src/{ => V1}/Product/Generated/GeneratedV1Prediction.php (91%) rename src/{ => V1}/Product/Ind/IndianPassport/IndianPassportV1.php (84%) rename src/{ => V1}/Product/Ind/IndianPassport/IndianPassportV1Document.php (96%) rename src/{ => V1}/Product/InternationalId/InternationalIdV2.php (84%) rename src/{ => V1}/Product/InternationalId/InternationalIdV2Document.php (95%) rename src/{ => V1}/Product/Invoice/InvoiceV4.php (84%) rename src/{ => V1}/Product/Invoice/InvoiceV4Document.php (95%) rename src/{ => V1}/Product/Invoice/InvoiceV4LineItem.php (55%) rename src/{ => V1}/Product/Invoice/InvoiceV4LineItems.php (98%) rename src/{ => V1}/Product/InvoiceSplitter/InvoiceSplitterV1.php (84%) rename src/{ => V1}/Product/InvoiceSplitter/InvoiceSplitterV1Document.php (87%) rename src/{ => V1}/Product/InvoiceSplitter/InvoiceSplitterV1InvoicePageGroup.php (80%) rename src/{ => V1}/Product/InvoiceSplitter/InvoiceSplitterV1InvoicePageGroups.php (97%) rename src/{ => V1}/Product/MultiReceiptsDetector/MultiReceiptsDetectorV1.php (84%) rename src/{ => V1}/Product/MultiReceiptsDetector/MultiReceiptsDetectorV1Document.php (83%) rename src/{ => V1}/Product/NutritionFactsLabel/NutritionFactsLabelV1.php (84%) rename src/{ => V1}/Product/NutritionFactsLabel/NutritionFactsLabelV1AddedSugar.php (75%) rename src/{ => V1}/Product/NutritionFactsLabel/NutritionFactsLabelV1Calorie.php (75%) rename src/{ => V1}/Product/NutritionFactsLabel/NutritionFactsLabelV1Cholesterol.php (75%) rename src/{ => V1}/Product/NutritionFactsLabel/NutritionFactsLabelV1DietaryFiber.php (75%) rename src/{ => V1}/Product/NutritionFactsLabel/NutritionFactsLabelV1Document.php (97%) rename src/{ => V1}/Product/NutritionFactsLabel/NutritionFactsLabelV1Nutrient.php (61%) rename src/{ => V1}/Product/NutritionFactsLabel/NutritionFactsLabelV1Nutrients.php (97%) rename src/{ => V1}/Product/NutritionFactsLabel/NutritionFactsLabelV1Protein.php (75%) rename src/{ => V1}/Product/NutritionFactsLabel/NutritionFactsLabelV1SaturatedFat.php (75%) rename src/{ => V1}/Product/NutritionFactsLabel/NutritionFactsLabelV1ServingSize.php (76%) rename src/{ => V1}/Product/NutritionFactsLabel/NutritionFactsLabelV1Sodium.php (73%) rename src/{ => V1}/Product/NutritionFactsLabel/NutritionFactsLabelV1TotalCarbohydrate.php (75%) rename src/{ => V1}/Product/NutritionFactsLabel/NutritionFactsLabelV1TotalFat.php (75%) rename src/{ => V1}/Product/NutritionFactsLabel/NutritionFactsLabelV1TotalSugar.php (75%) rename src/{ => V1}/Product/NutritionFactsLabel/NutritionFactsLabelV1TransFat.php (75%) rename src/{ => V1}/Product/Passport/PassportV1.php (84%) rename src/{ => V1}/Product/Passport/PassportV1Document.php (94%) rename src/{ => V1}/Product/Receipt/ReceiptV5.php (84%) rename src/{ => V1}/Product/Receipt/ReceiptV5Document.php (93%) rename src/{ => V1}/Product/Receipt/ReceiptV5LineItem.php (61%) rename src/{ => V1}/Product/Receipt/ReceiptV5LineItems.php (98%) rename src/{ => V1}/Product/Resume/ResumeV1.php (84%) rename src/{ => V1}/Product/Resume/ResumeV1Certificate.php (61%) rename src/{ => V1}/Product/Resume/ResumeV1Certificates.php (98%) rename src/{ => V1}/Product/Resume/ResumeV1Document.php (96%) rename src/{ => V1}/Product/Resume/ResumeV1Education.php (55%) rename src/{ => V1}/Product/Resume/ResumeV1Educations.php (98%) rename src/{ => V1}/Product/Resume/ResumeV1Language.php (67%) rename src/{ => V1}/Product/Resume/ResumeV1Languages.php (97%) rename src/{ => V1}/Product/Resume/ResumeV1ProfessionalExperience.php (54%) rename src/{ => V1}/Product/Resume/ResumeV1ProfessionalExperiences.php (98%) rename src/{ => V1}/Product/Resume/ResumeV1SocialNetworksUrl.php (67%) rename src/{ => V1}/Product/Resume/ResumeV1SocialNetworksUrls.php (98%) rename src/{ => V1}/Product/Us/BankCheck/BankCheckV1.php (84%) rename src/{ => V1}/Product/Us/BankCheck/BankCheckV1Document.php (90%) rename src/{ => V1}/Product/Us/BankCheck/BankCheckV1Page.php (88%) rename src/{ => V1}/Product/Us/HealthcareCard/HealthcareCardV1.php (84%) rename src/{ => V1}/Product/Us/HealthcareCard/HealthcareCardV1Copay.php (66%) rename src/{ => V1}/Product/Us/HealthcareCard/HealthcareCardV1Copays.php (97%) rename src/{ => V1}/Product/Us/HealthcareCard/HealthcareCardV1Document.php (95%) rename src/{ => V1}/Product/Us/UsMail/UsMailV3.php (84%) rename src/{ => V1}/Product/Us/UsMail/UsMailV3Document.php (91%) rename src/{ => V1}/Product/Us/UsMail/UsMailV3RecipientAddress.php (54%) rename src/{ => V1}/Product/Us/UsMail/UsMailV3RecipientAddresses.php (98%) rename src/{ => V1}/Product/Us/UsMail/UsMailV3SenderAddress.php (69%) rename src/{Error => V2/Parsing}/ErrorItem.php (94%) rename src/V2/Parsing/{ => Inference}/BaseResponse.php (93%) rename src/V2/Parsing/{ => Inference}/Field/BaseField.php (97%) rename src/V2/Parsing/{ => Inference}/Field/FieldConfidence.php (97%) rename src/V2/Parsing/{ => Inference}/Field/FieldLocation.php (95%) rename src/V2/Parsing/{ => Inference}/Field/InferenceFields.php (98%) rename src/V2/Parsing/{ => Inference}/Field/ListField.php (97%) rename src/V2/Parsing/{ => Inference}/Field/ObjectField.php (98%) rename src/V2/Parsing/{ => Inference}/Field/SimpleField.php (95%) rename src/V2/Parsing/{ => Inference}/Inference.php (93%) rename src/V2/Parsing/{ => Inference}/InferenceActiveOptions.php (96%) rename src/V2/Parsing/{ => Inference}/InferenceFile.php (96%) rename src/V2/Parsing/{ => Inference}/InferenceJob.php (93%) rename src/V2/Parsing/{ => Inference}/InferenceModel.php (93%) rename src/V2/Parsing/{ => Inference}/InferenceResponse.php (93%) rename src/V2/Parsing/{ => Inference}/InferenceResult.php (81%) rename src/V2/Parsing/{RagMetadata.php => Inference/RAGMetadata.php} (87%) rename src/V2/Parsing/{ => Inference}/RawText.php (95%) rename src/V2/Parsing/{ => Inference}/RawTextPage.php (93%) rename src/V2/{Parsing => Product/Extraction/Params}/DataSchemaActiveOption.php (92%) rename tests/Dependencies/{DependencyCheckerNoExtendedTestPdf.php => DependencyCheckerNoExtendedTestPDF.php} (78%) rename tests/Dependencies/{DependencyCheckerPdfTest.php => DependencyCheckerPDFTest.php} (85%) rename tests/V1/Extraction/{PdfExtractorTest.php => PDFExtractorTest.php} (89%) rename tests/V1/Parsing/Common/{Ocr/OcrTest.php => OCR/OCRTest.php} (88%) diff --git a/bin/MindeeCLICommand.php b/bin/MindeeCLICommand.php index 243fb6c5..0685284c 100644 --- a/bin/MindeeCLICommand.php +++ b/bin/MindeeCLICommand.php @@ -7,11 +7,11 @@ use Mindee\Input\PageOptions; use Mindee\Input\PathInput; use Mindee\Input\URLInputSource; -use Mindee\Parsing\Common\AsyncPredictResponse; -use Mindee\Parsing\Common\PredictResponse; use Mindee\V1\Client; use Mindee\V1\ClientOptions\PredictMethodOptions; use Mindee\V1\ClientOptions\PredictOptions; +use Mindee\V1\Parsing\Common\AsyncPredictResponse; +use Mindee\V1\Parsing\Common\PredictResponse; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; diff --git a/bin/MindeeCLIDocuments.php b/bin/MindeeCLIDocuments.php index 83411e52..21c34140 100644 --- a/bin/MindeeCLIDocuments.php +++ b/bin/MindeeCLIDocuments.php @@ -16,157 +16,157 @@ public static function getSpecs(): array return [ "generated" => new DocumentCommandConfig( "Custom document type from docTI", - \Mindee\Product\Generated\GeneratedV1::class, + \Mindee\V1\Product\Generated\GeneratedV1::class, false, true ), "barcode-reader" => new DocumentCommandConfig( "Barcode Reader", - \Mindee\Product\BarcodeReader\BarcodeReaderV1::class, + \Mindee\V1\Product\BarcodeReader\BarcodeReaderV1::class, true, false ), "bill-of-lading" => new DocumentCommandConfig( "Bill of Lading", - \Mindee\Product\BillOfLading\BillOfLadingV1::class, + \Mindee\V1\Product\BillOfLading\BillOfLadingV1::class, false, true ), "business-card" => new DocumentCommandConfig( "Business Card", - \Mindee\Product\BusinessCard\BusinessCardV1::class, + \Mindee\V1\Product\BusinessCard\BusinessCardV1::class, false, true ), "cropper" => new DocumentCommandConfig( "Cropper", - \Mindee\Product\Cropper\CropperV1::class, + \Mindee\V1\Product\Cropper\CropperV1::class, true, false ), "delivery-note" => new DocumentCommandConfig( "Delivery note", - \Mindee\Product\DeliveryNote\DeliveryNoteV1::class, + \Mindee\V1\Product\DeliveryNote\DeliveryNoteV1::class, false, true ), "driver-license" => new DocumentCommandConfig( "Driver License", - \Mindee\Product\DriverLicense\DriverLicenseV1::class, + \Mindee\V1\Product\DriverLicense\DriverLicenseV1::class, false, true ), "financial-document" => new DocumentCommandConfig( "Financial Document", - \Mindee\Product\FinancialDocument\FinancialDocumentV1::class, + \Mindee\V1\Product\FinancialDocument\FinancialDocumentV1::class, true, true ), "fr-bank-account-details" => new DocumentCommandConfig( "FR Bank Account Details", - \Mindee\Product\Fr\BankAccountDetails\BankAccountDetailsV2::class, + \Mindee\V1\Product\Fr\BankAccountDetails\BankAccountDetailsV2::class, true, false ), "fr-carte-grise" => new DocumentCommandConfig( "FR Carte Grise", - \Mindee\Product\Fr\CarteGrise\CarteGriseV1::class, + \Mindee\V1\Product\Fr\CarteGrise\CarteGriseV1::class, true, false ), "fr-energy-bill" => new DocumentCommandConfig( "FR Energy Bill", - \Mindee\Product\Fr\EnergyBill\EnergyBillV1::class, + \Mindee\V1\Product\Fr\EnergyBill\EnergyBillV1::class, false, true ), "fr-health-card" => new DocumentCommandConfig( "FR Health Card", - \Mindee\Product\Fr\HealthCard\HealthCardV1::class, + \Mindee\V1\Product\Fr\HealthCard\HealthCardV1::class, false, true ), "fr-carte-nationale-d-identite" => new DocumentCommandConfig( "FR Carte Nationale d'Identité", - \Mindee\Product\Fr\IdCard\IdCardV2::class, + \Mindee\V1\Product\Fr\IdCard\IdCardV2::class, true, false ), "fr-payslip" => new DocumentCommandConfig( "FR Payslip", - \Mindee\Product\Fr\Payslip\PayslipV3::class, + \Mindee\V1\Product\Fr\Payslip\PayslipV3::class, false, true ), "ind-passport-india" => new DocumentCommandConfig( "IND Passport - India", - \Mindee\Product\Ind\IndianPassport\IndianPassportV1::class, + \Mindee\V1\Product\Ind\IndianPassport\IndianPassportV1::class, false, true ), "international-id" => new DocumentCommandConfig( "International ID", - \Mindee\Product\InternationalId\InternationalIdV2::class, + \Mindee\V1\Product\InternationalId\InternationalIdV2::class, false, true ), "invoice" => new DocumentCommandConfig( "Invoice", - \Mindee\Product\Invoice\InvoiceV4::class, + \Mindee\V1\Product\Invoice\InvoiceV4::class, true, true ), "invoice-splitter" => new DocumentCommandConfig( "Invoice Splitter", - \Mindee\Product\InvoiceSplitter\InvoiceSplitterV1::class, + \Mindee\V1\Product\InvoiceSplitter\InvoiceSplitterV1::class, false, true ), "multi-receipts-detector" => new DocumentCommandConfig( "Multi Receipts Detector", - \Mindee\Product\MultiReceiptsDetector\MultiReceiptsDetectorV1::class, + \Mindee\V1\Product\MultiReceiptsDetector\MultiReceiptsDetectorV1::class, true, false ), "nutrition-facts-label" => new DocumentCommandConfig( "Nutrition Facts Label", - \Mindee\Product\NutritionFactsLabel\NutritionFactsLabelV1::class, + \Mindee\V1\Product\NutritionFactsLabel\NutritionFactsLabelV1::class, false, true ), "passport" => new DocumentCommandConfig( "Passport", - \Mindee\Product\Passport\PassportV1::class, + \Mindee\V1\Product\Passport\PassportV1::class, true, false ), "receipt" => new DocumentCommandConfig( "Receipt", - \Mindee\Product\Receipt\ReceiptV5::class, + \Mindee\V1\Product\Receipt\ReceiptV5::class, true, true ), "resume" => new DocumentCommandConfig( "Resume", - \Mindee\Product\Resume\ResumeV1::class, + \Mindee\V1\Product\Resume\ResumeV1::class, false, true ), "us-bank-check" => new DocumentCommandConfig( "US Bank Check", - \Mindee\Product\Us\BankCheck\BankCheckV1::class, + \Mindee\V1\Product\Us\BankCheck\BankCheckV1::class, true, false ), "us-healthcare-card" => new DocumentCommandConfig( "US Healthcare Card", - \Mindee\Product\Us\HealthcareCard\HealthcareCardV1::class, + \Mindee\V1\Product\Us\HealthcareCard\HealthcareCardV1::class, false, true ), "us-us-mail" => new DocumentCommandConfig( "US US Mail", - \Mindee\Product\Us\UsMail\UsMailV3::class, + \Mindee\V1\Product\Us\UsMail\UsMailV3::class, false, true ), diff --git a/examples/InvoiceSplitterAutoExtractionExample.php b/examples/InvoiceSplitterAutoExtractionExample.php index 9ee4a4f4..4f2d65b7 100644 --- a/examples/InvoiceSplitterAutoExtractionExample.php +++ b/examples/InvoiceSplitterAutoExtractionExample.php @@ -1,10 +1,10 @@ enqueueAndParse( InvoiceSplitterV1::class, $inputSource diff --git a/examples/MultiReceiptsAutoExtractionExample.php b/examples/MultiReceiptsAutoExtractionExample.php index 97ed1cbb..5ab1daa4 100644 --- a/examples/MultiReceiptsAutoExtractionExample.php +++ b/examples/MultiReceiptsAutoExtractionExample.php @@ -1,10 +1,10 @@ pdfBytes; } diff --git a/src/Extraction/ImageExtractor.php b/src/Extraction/ImageExtractor.php index 16bc580a..c9519434 100644 --- a/src/Extraction/ImageExtractor.php +++ b/src/Extraction/ImageExtractor.php @@ -2,6 +2,7 @@ namespace Mindee\Extraction; +use Mindee\Dependency\DependencyChecker; use Mindee\Error\ErrorCode; use Mindee\Error\MindeeGeometryException; use Mindee\Error\MindeeImageException; @@ -10,8 +11,7 @@ use Mindee\Geometry\BBoxUtils; use Mindee\Geometry\Polygon; use Mindee\Input\LocalInputSource; -use Mindee\Parsing\DependencyChecker; -use Mindee\Parsing\Standard\BaseField; +use Mindee\V1\Parsing\Standard\BaseField; /** * Extract sub-images from an image. diff --git a/src/Extraction/PdfExtractor.php b/src/Extraction/PDFExtractor.php similarity index 95% rename from src/Extraction/PdfExtractor.php rename to src/Extraction/PDFExtractor.php index 36bac699..e6e6b39c 100644 --- a/src/Extraction/PdfExtractor.php +++ b/src/Extraction/PDFExtractor.php @@ -2,10 +2,10 @@ namespace Mindee\Extraction; +use Mindee\Dependency\DependencyChecker; use Mindee\Error\MindeePDFException; use Mindee\Input\LocalInputSource; -use Mindee\Parsing\DependencyChecker; -use Mindee\Product\InvoiceSplitter\InvoiceSplitterV1InvoicePageGroups; +use Mindee\V1\Product\InvoiceSplitter\InvoiceSplitterV1InvoicePageGroups; use setasign\Fpdi\Fpdi; use setasign\Fpdi\PdfParser\CrossReference\CrossReferenceException; use setasign\Fpdi\PdfParser\Filter\FilterException; @@ -15,7 +15,7 @@ /** * PDF extraction class. */ -class PdfExtractor +class PDFExtractor { /** * @var string bytes representation of a file @@ -79,7 +79,7 @@ public function getPageCount(): int * * @param array|InvoiceSplitterV1InvoicePageGroups $pageIndexes List of sub-lists of pages to keep. * - * @return ExtractedPdf[] list of extracted documents + * @return ExtractedPDF[] list of extracted documents * * @throws MindeePDFException Throws if FDPF/FPDI wasn't able to handle the pdf during the extraction. * @throws \InvalidArgumentException Throws if invalid indexes are provided. @@ -123,7 +123,7 @@ public function extractSubDocuments(mixed $pageIndexes): array ) { throw new MindeePDFException("PDF file couldn't be processed during extraction.", 0, $e); } - $extractedPdfs[] = new ExtractedPdf($mergedPdfBytes, $fieldFilename); + $extractedPdfs[] = new ExtractedPDF($mergedPdfBytes, $fieldFilename); } return $extractedPdfs; @@ -135,7 +135,7 @@ public function extractSubDocuments(mixed $pageIndexes): array * @param array|InvoiceSplitterV1InvoicePageGroups $pageIndexes List of sub-lists of pages to keep. * @param boolean $strict Whether to trust confidence scores or not. * - * @return ExtractedPdf[] a list of extracted invoices + * @return ExtractedPDF[] a list of extracted invoices */ public function extractInvoices(mixed $pageIndexes, bool $strict = false): array { diff --git a/src/Image/ImageCompressor.php b/src/Image/ImageCompressor.php index 0d339f2a..e88dedba 100644 --- a/src/Image/ImageCompressor.php +++ b/src/Image/ImageCompressor.php @@ -2,10 +2,10 @@ namespace Mindee\Image; +use Mindee\Dependency\DependencyChecker; +use Mindee\Error\ErrorCode; use Mindee\Error\MindeeImageException; use Mindee\Error\MindeeUnhandledException; -use Mindee\Parsing\DependencyChecker; -use Mindee\Error\ErrorCode; /** * Image compressor class to handle image compression. diff --git a/src/PDF/PDFCompressor.php b/src/PDF/PDFCompressor.php index 5906f6a3..5ec84f23 100644 --- a/src/PDF/PDFCompressor.php +++ b/src/PDF/PDFCompressor.php @@ -2,10 +2,10 @@ namespace Mindee\PDF; +use Mindee\Dependency\DependencyChecker; use Mindee\Error\ErrorCode; use Mindee\Error\MindeePDFException; use Mindee\Error\MindeeUnhandledException; -use Mindee\Parsing\DependencyChecker; use setasign\Fpdi\Fpdi; use setasign\Fpdi\PdfParser\CrossReference\CrossReferenceException; use Smalot\PdfParser\Config; @@ -65,10 +65,10 @@ public static function compress( try { $fpdi = new CustomFPDI(); $pageCount = $fpdi->setSourceFile($pdfPath); - } catch (CrossReferenceException $e) { + } catch (CrossReferenceException) { error_log("[WARNING] PDF format for '$pdfPath' is not directly supported." . " Output PDF will be rasterized and source text won't be available."); - $pdfPath = PDFUtils::downgradePdfVersion($pdfPath); + $pdfPath = PDFUtils::downgradePDFVersion($pdfPath); $fpdi = new CustomFPDI(); $pdf = $parser->parseFile($pdfPath); $pageCount = $fpdi->setSourceFile($pdfPath); @@ -76,7 +76,7 @@ public static function compress( $outPdf = new CustomFPDI(); for ($i = 1; $i <= $pageCount; $i++) { - list($tempJpegFile, $orientation) = static::processPdfPage($pdfPath, $i, $quality); + list($tempJpegFile, $orientation) = static::processPDFPage($pdfPath, $i, $quality); list($width, $height) = getimagesize($tempJpegFile); $outPdf->AddPage($orientation, [$width, $height]); $outPdf->Image($tempJpegFile, 0, 0, $width, $height); @@ -207,7 +207,7 @@ private static function injectText(Document $inputPdf, CustomFPDI $outputPdf): v * @return array Path to the temporary JPEG file and orientation of the page. * @throws MindeePDFException If there's an error processing the page. */ - private static function processPdfPage(string $sourcePdfPath, int $pageIndex, int $imageQuality): array + private static function processPDFPage(string $sourcePdfPath, int $pageIndex, int $imageQuality): array { try { $singlePagePdf = new FPDI(); diff --git a/src/PDF/PDFUtils.php b/src/PDF/PDFUtils.php index 710cfccf..63047e35 100644 --- a/src/PDF/PDFUtils.php +++ b/src/PDF/PDFUtils.php @@ -111,7 +111,7 @@ public static function extractPagesTextElements(string $pdfPath): array * @throws MindeePDFException Throws if the file can't be handled through Imagick. * @throws Exception Will be thrown as MindeePDFException, this is just for PHPCS linting purposes. */ - public static function downgradePdfVersion(string $inputPath): string + public static function downgradePDFVersion(string $inputPath): string { try { $outputPath = tempnam(sys_get_temp_dir(), 'downgrade_pdf_') . '.pdf'; diff --git a/src/Parsing/Common/SummaryHelper.php b/src/Parsing/Common/SummaryHelper.php index 9165acfc..ce266b96 100644 --- a/src/Parsing/Common/SummaryHelper.php +++ b/src/Parsing/Common/SummaryHelper.php @@ -3,7 +3,7 @@ namespace Mindee\Parsing\Common; /** - * Utility class to handle information display. + * Base utility class to handle information display. */ class SummaryHelper { @@ -48,7 +48,7 @@ public static function cleanOutString(string $inputString): string * @param string|null $string The string to fix. * @return string|null The fixed string. */ - private static function escapeSpecialChars(?string $string): ?string + protected static function escapeSpecialChars(?string $string): ?string { if ($string === null) { return null; @@ -90,17 +90,4 @@ public static function formatForDisplay($inputString = null, ?int $maxColSize = "UTF-8" ) . "..."; } - - /** - * Pads and add separators to a string for rst table items. - * - * @param string $inputString Input value, as an already printable string. - * @param integer $colSize Column size assigned to the value. - * @param string $separator Optional custom separator for tables. - * @return string The string, with table separators. - */ - public static function padString(string $inputString, int $colSize, string $separator = "|"): string - { - return mb_str_pad($inputString, $colSize, " ", STR_PAD_RIGHT, "UTF-8") . " $separator "; - } } diff --git a/src/V1/Client.php b/src/V1/Client.php index cbc57347..e7e6edea 100644 --- a/src/V1/Client.php +++ b/src/V1/Client.php @@ -9,6 +9,7 @@ namespace Mindee\V1; use Exception; +use Mindee\ClientOptions\PollingOptions; use Mindee\CustomSleepMixin; use Mindee\Error\ErrorCode; use Mindee\Error\MindeeApiException; @@ -23,12 +24,7 @@ use Mindee\Input\LocalResponse; use Mindee\Input\PageOptions; use Mindee\Input\PathInput; -use Mindee\ClientOptions\PollingOptions; use Mindee\Input\URLInputSource; -use Mindee\Parsing\Common\AsyncPredictResponse; -use Mindee\Parsing\Common\PredictResponse; -use Mindee\Parsing\Common\WorkflowResponse; -use Mindee\Product\Generated\GeneratedV1; use Mindee\V1\ClientOptions\PredictMethodOptions; use Mindee\V1\ClientOptions\WorkflowOptions; use Mindee\V1\HTTP\Endpoint; @@ -36,6 +32,10 @@ use Mindee\V1\HTTP\MindeeWorkflowAPI; use Mindee\V1\HTTP\ResponseValidation; use Mindee\V1\HTTP\WorkflowEndpoint; +use Mindee\V1\Parsing\Common\AsyncPredictResponse; +use Mindee\V1\Parsing\Common\PredictResponse; +use Mindee\V1\Parsing\Common\WorkflowResponse; +use Mindee\V1\Product\Generated\GeneratedV1; use ReflectionClass; use ReflectionException; diff --git a/src/Parsing/Common/ApiRequest.php b/src/V1/Parsing/Common/ApiRequest.php similarity index 96% rename from src/Parsing/Common/ApiRequest.php rename to src/V1/Parsing/Common/ApiRequest.php index b39065b0..1bb6b9da 100644 --- a/src/Parsing/Common/ApiRequest.php +++ b/src/V1/Parsing/Common/ApiRequest.php @@ -1,6 +1,6 @@ ocr = new Ocr($rawResponse['ocr']); + $this->ocr = new OCR($rawResponse['ocr']); } if (array_key_exists("extras", $rawResponse['inference']) && $rawResponse['inference']['extras']) { $this->extras = new Extras($rawResponse['inference']['extras']); diff --git a/src/Parsing/Common/Execution.php b/src/V1/Parsing/Common/Execution.php similarity index 97% rename from src/Parsing/Common/Execution.php rename to src/V1/Parsing/Common/Execution.php index 7fb83ab8..6d115454 100644 --- a/src/Parsing/Common/Execution.php +++ b/src/V1/Parsing/Common/Execution.php @@ -1,12 +1,12 @@ pages = []; foreach ($rawPrediction['pages'] as $pagePrediction) { - $this->pages[] = new OcrPage($pagePrediction); + $this->pages[] = new OCRPage($pagePrediction); } } diff --git a/src/Parsing/Common/Ocr/Ocr.php b/src/V1/Parsing/Common/OCR/OCR.php similarity index 90% rename from src/Parsing/Common/Ocr/Ocr.php rename to src/V1/Parsing/Common/OCR/OCR.php index 6cefb57d..1b2648ba 100644 --- a/src/Parsing/Common/Ocr/Ocr.php +++ b/src/V1/Parsing/Common/OCR/OCR.php @@ -1,14 +1,14 @@ words, "Mindee\\Parsing\\Common\\Ocr\\OcrPage::getMinMaxX"); + usort($this->words, "Mindee\\V1\\Parsing\\Common\\OCR\\OCRPage::getMinMaxX"); } /** * Appends a word to the line. * - * @param \Mindee\Parsing\Common\Ocr\OcrWord $word Word to add. + * @param OCRWord $word Word to add. * @return void */ - public function add(OcrWord $word) + public function add(OCRWord $word) { $this->words[] = $word; } diff --git a/src/Parsing/Common/Ocr/OcrPage.php b/src/V1/Parsing/Common/OCR/OCRPage.php similarity index 82% rename from src/Parsing/Common/Ocr/OcrPage.php rename to src/V1/Parsing/Common/OCR/OCRPage.php index 8cee1982..67e4b783 100644 --- a/src/Parsing/Common/Ocr/OcrPage.php +++ b/src/V1/Parsing/Common/OCR/OCRPage.php @@ -1,11 +1,11 @@ polygon->isPointInY($currentWord->polygon->getCentroid()); $nextInCurrent = $currentWord->polygon->isPointInY($nextWord->polygon->getCentroid()); @@ -33,11 +33,11 @@ private static function areWordsOnSameLine(OcrWord $currentWord, OcrWord $nextWo /** * Compares word positions on the X axis. Returns a sort-compliant result (0;-1;1). * - * @param OcrWord $word1 First word. - * @param OcrWord $word2 Second word. + * @param OCRWord $word1 First word. + * @param OCRWord $word2 Second word. * @return integer */ - public static function getMinMaxX(OcrWord $word1, OcrWord $word2): int + public static function getMinMaxX(OCRWord $word1, OCRWord $word2): int { $word1X = $word1->polygon->getMinMaxX()->getMin(); $word2X = $word2->polygon->getMinMaxX()->getMin(); @@ -50,11 +50,11 @@ public static function getMinMaxX(OcrWord $word1, OcrWord $word2): int /** * Compares word positions on the Y axis. Returns a sort-compliant result (0;-1;1). * - * @param OcrWord $word1 First word. - * @param OcrWord $word2 Second word. + * @param OCRWord $word1 First word. + * @param OCRWord $word2 Second word. * @return integer */ - public static function getMinMaxY(OcrWord $word1, OcrWord $word2): int + public static function getMinMaxY(OCRWord $word1, OCRWord $word2): int { $word1Y = $word1->polygon->getMinMaxY()->getMin(); $word2Y = $word2->polygon->getMinMaxY()->getMin(); @@ -75,14 +75,14 @@ private function toLines(): array $indexes = []; $lines = []; foreach ($this->allWords as $w) { - $line = new OcrLine(); + $line = new OCRLine(); for ($idx = 0; $idx < count($this->allWords); $idx++) { $word = $this->allWords[$idx]; if (!in_array($idx, $indexes)) { if ($current == null) { $current = $word; $indexes[] = $idx; - $line = new OcrLine(); + $line = new OCRLine(); $line->add($word); } else { if ($this->areWordsOnSameLine($current, $word)) { @@ -131,7 +131,7 @@ public function __construct(array $rawPrediction) { $this->allWords = []; foreach ($rawPrediction['all_words'] as $wordPrediction) { - $this->allWords[] = new OcrWord($wordPrediction); + $this->allWords[] = new OCRWord($wordPrediction); } usort($this->allWords, "self::getMinMaxY"); } diff --git a/src/Parsing/Common/Ocr/OcrWord.php b/src/V1/Parsing/Common/OCR/OCRWord.php similarity index 86% rename from src/Parsing/Common/Ocr/OcrWord.php rename to src/V1/Parsing/Common/OCR/OCRWord.php index 197862a1..1ac5d46c 100644 --- a/src/Parsing/Common/Ocr/OcrWord.php +++ b/src/V1/Parsing/Common/OCR/OCRWord.php @@ -1,13 +1,13 @@ value); + return SummaryHelperV1::formatForDisplay($this->value); } } diff --git a/src/Parsing/Standard/ClassificationField.php b/src/V1/Parsing/Standard/ClassificationField.php similarity index 95% rename from src/Parsing/Standard/ClassificationField.php rename to src/V1/Parsing/Standard/ClassificationField.php index d530f90d..9d31848f 100644 --- a/src/Parsing/Standard/ClassificationField.php +++ b/src/V1/Parsing/Standard/ClassificationField.php @@ -1,6 +1,6 @@ type); - $printable['value'] = SummaryHelper::formatForDisplay($this->value); + $printable['type'] = SummaryHelperV1::formatForDisplay($this->type); + $printable['value'] = SummaryHelperV1::formatForDisplay($this->value); return $printable; } } diff --git a/src/Parsing/Standard/DateField.php b/src/V1/Parsing/Standard/DateField.php similarity index 98% rename from src/Parsing/Standard/DateField.php rename to src/V1/Parsing/Standard/DateField.php index 356ae224..d9d2c551 100644 --- a/src/Parsing/Standard/DateField.php +++ b/src/V1/Parsing/Standard/DateField.php @@ -1,6 +1,6 @@ pages[] = new Page(BarcodeReaderV1Document::class, $page); - } catch (MindeeUnsetException $ignored) { + } catch (MindeeUnsetException) { } } } diff --git a/src/Product/BarcodeReader/BarcodeReaderV1Document.php b/src/V1/Product/BarcodeReader/BarcodeReaderV1Document.php similarity index 87% rename from src/Product/BarcodeReader/BarcodeReaderV1Document.php rename to src/V1/Product/BarcodeReader/BarcodeReaderV1Document.php index 82d9a6ef..99cc51a6 100644 --- a/src/Product/BarcodeReader/BarcodeReaderV1Document.php +++ b/src/V1/Product/BarcodeReader/BarcodeReaderV1Document.php @@ -1,11 +1,11 @@ pages[] = new Page(BillOfLadingV1Document::class, $page); - } catch (MindeeUnsetException $ignored) { + } catch (MindeeUnsetException) { } } } diff --git a/src/Product/BillOfLading/BillOfLadingV1Carrier.php b/src/V1/Product/BillOfLading/BillOfLadingV1Carrier.php similarity index 72% rename from src/Product/BillOfLading/BillOfLadingV1Carrier.php rename to src/V1/Product/BillOfLading/BillOfLadingV1Carrier.php index 55b196e9..45268bd0 100644 --- a/src/Product/BillOfLading/BillOfLadingV1Carrier.php +++ b/src/V1/Product/BillOfLading/BillOfLadingV1Carrier.php @@ -1,10 +1,10 @@ name); - $outArr["professionalNumber"] = SummaryHelper::formatForDisplay($this->professionalNumber); - $outArr["scac"] = SummaryHelper::formatForDisplay($this->scac); + $outArr["name"] = SummaryHelperV1::formatForDisplay($this->name); + $outArr["professionalNumber"] = SummaryHelperV1::formatForDisplay($this->professionalNumber); + $outArr["scac"] = SummaryHelperV1::formatForDisplay($this->scac); return $outArr; } @@ -62,9 +62,9 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["name"] = SummaryHelper::formatForDisplay($this->name); - $outArr["professionalNumber"] = SummaryHelper::formatForDisplay($this->professionalNumber); - $outArr["scac"] = SummaryHelper::formatForDisplay($this->scac); + $outArr["name"] = SummaryHelperV1::formatForDisplay($this->name); + $outArr["professionalNumber"] = SummaryHelperV1::formatForDisplay($this->professionalNumber); + $outArr["scac"] = SummaryHelperV1::formatForDisplay($this->scac); return $outArr; } /** @@ -87,6 +87,6 @@ public function toFieldList(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toFieldList()); + return SummaryHelperV1::cleanOutString($this->toFieldList()); } } diff --git a/src/Product/BillOfLading/BillOfLadingV1CarrierItem.php b/src/V1/Product/BillOfLading/BillOfLadingV1CarrierItem.php similarity index 57% rename from src/Product/BillOfLading/BillOfLadingV1CarrierItem.php rename to src/V1/Product/BillOfLading/BillOfLadingV1CarrierItem.php index 9b5d68fe..31883873 100644 --- a/src/Product/BillOfLading/BillOfLadingV1CarrierItem.php +++ b/src/V1/Product/BillOfLading/BillOfLadingV1CarrierItem.php @@ -1,10 +1,10 @@ description, 36); - $outArr["grossWeight"] = SummaryHelper::formatFloat($this->grossWeight); - $outArr["measurement"] = SummaryHelper::formatFloat($this->measurement); - $outArr["measurementUnit"] = SummaryHelper::formatForDisplay($this->measurementUnit); - $outArr["quantity"] = SummaryHelper::formatFloat($this->quantity); - $outArr["weightUnit"] = SummaryHelper::formatForDisplay($this->weightUnit); + $outArr["description"] = SummaryHelperV1::formatForDisplay($this->description, 36); + $outArr["grossWeight"] = SummaryHelperV1::formatFloat($this->grossWeight); + $outArr["measurement"] = SummaryHelperV1::formatFloat($this->measurement); + $outArr["measurementUnit"] = SummaryHelperV1::formatForDisplay($this->measurementUnit); + $outArr["quantity"] = SummaryHelperV1::formatFloat($this->quantity); + $outArr["weightUnit"] = SummaryHelperV1::formatForDisplay($this->weightUnit); return $outArr; } @@ -83,12 +83,12 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["description"] = SummaryHelper::formatForDisplay($this->description); - $outArr["grossWeight"] = SummaryHelper::formatFloat($this->grossWeight); - $outArr["measurement"] = SummaryHelper::formatFloat($this->measurement); - $outArr["measurementUnit"] = SummaryHelper::formatForDisplay($this->measurementUnit); - $outArr["quantity"] = SummaryHelper::formatFloat($this->quantity); - $outArr["weightUnit"] = SummaryHelper::formatForDisplay($this->weightUnit); + $outArr["description"] = SummaryHelperV1::formatForDisplay($this->description); + $outArr["grossWeight"] = SummaryHelperV1::formatFloat($this->grossWeight); + $outArr["measurement"] = SummaryHelperV1::formatFloat($this->measurement); + $outArr["measurementUnit"] = SummaryHelperV1::formatForDisplay($this->measurementUnit); + $outArr["quantity"] = SummaryHelperV1::formatFloat($this->quantity); + $outArr["weightUnit"] = SummaryHelperV1::formatForDisplay($this->weightUnit); return $outArr; } /** @@ -100,13 +100,13 @@ public function toTableLine(): string { $printable = $this->tablePrintableValues(); $outStr = "| "; - $outStr .= SummaryHelper::padString($printable["description"], 36); - $outStr .= SummaryHelper::padString($printable["grossWeight"], 12); - $outStr .= SummaryHelper::padString($printable["measurement"], 11); - $outStr .= SummaryHelper::padString($printable["measurementUnit"], 16); - $outStr .= SummaryHelper::padString($printable["quantity"], 8); - $outStr .= SummaryHelper::padString($printable["weightUnit"], 11); - return rtrim(SummaryHelper::cleanOutString($outStr)); + $outStr .= SummaryHelperV1::padString($printable["description"], 36); + $outStr .= SummaryHelperV1::padString($printable["grossWeight"], 12); + $outStr .= SummaryHelperV1::padString($printable["measurement"], 11); + $outStr .= SummaryHelperV1::padString($printable["measurementUnit"], 16); + $outStr .= SummaryHelperV1::padString($printable["quantity"], 8); + $outStr .= SummaryHelperV1::padString($printable["weightUnit"], 11); + return rtrim(SummaryHelperV1::cleanOutString($outStr)); } /** @@ -114,6 +114,6 @@ public function toTableLine(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toTableLine()); + return SummaryHelperV1::cleanOutString($this->toTableLine()); } } diff --git a/src/Product/BillOfLading/BillOfLadingV1CarrierItems.php b/src/V1/Product/BillOfLading/BillOfLadingV1CarrierItems.php similarity index 97% rename from src/Product/BillOfLading/BillOfLadingV1CarrierItems.php rename to src/V1/Product/BillOfLading/BillOfLadingV1CarrierItems.php index b579173e..89b38c3c 100644 --- a/src/Product/BillOfLading/BillOfLadingV1CarrierItems.php +++ b/src/V1/Product/BillOfLading/BillOfLadingV1CarrierItems.php @@ -1,6 +1,6 @@ address); - $outArr["email"] = SummaryHelper::formatForDisplay($this->email); - $outArr["name"] = SummaryHelper::formatForDisplay($this->name); - $outArr["phone"] = SummaryHelper::formatForDisplay($this->phone); + $outArr["address"] = SummaryHelperV1::formatForDisplay($this->address); + $outArr["email"] = SummaryHelperV1::formatForDisplay($this->email); + $outArr["name"] = SummaryHelperV1::formatForDisplay($this->name); + $outArr["phone"] = SummaryHelperV1::formatForDisplay($this->phone); return $outArr; } @@ -68,10 +68,10 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["address"] = SummaryHelper::formatForDisplay($this->address); - $outArr["email"] = SummaryHelper::formatForDisplay($this->email); - $outArr["name"] = SummaryHelper::formatForDisplay($this->name); - $outArr["phone"] = SummaryHelper::formatForDisplay($this->phone); + $outArr["address"] = SummaryHelperV1::formatForDisplay($this->address); + $outArr["email"] = SummaryHelperV1::formatForDisplay($this->email); + $outArr["name"] = SummaryHelperV1::formatForDisplay($this->name); + $outArr["phone"] = SummaryHelperV1::formatForDisplay($this->phone); return $outArr; } /** @@ -95,6 +95,6 @@ public function toFieldList(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toFieldList()); + return SummaryHelperV1::cleanOutString($this->toFieldList()); } } diff --git a/src/Product/BillOfLading/BillOfLadingV1Document.php b/src/V1/Product/BillOfLading/BillOfLadingV1Document.php similarity index 95% rename from src/Product/BillOfLading/BillOfLadingV1Document.php rename to src/V1/Product/BillOfLading/BillOfLadingV1Document.php index 8e836c2e..0ba0f2ae 100644 --- a/src/Product/BillOfLading/BillOfLadingV1Document.php +++ b/src/V1/Product/BillOfLading/BillOfLadingV1Document.php @@ -1,12 +1,12 @@ dateOfIssue :Departure Date: $this->departureDate "; - return SummaryHelper::cleanOutString($outStr); + return SummaryHelperV1::cleanOutString($outStr); } } diff --git a/src/Product/BillOfLading/BillOfLadingV1NotifyParty.php b/src/V1/Product/BillOfLading/BillOfLadingV1NotifyParty.php similarity index 71% rename from src/Product/BillOfLading/BillOfLadingV1NotifyParty.php rename to src/V1/Product/BillOfLading/BillOfLadingV1NotifyParty.php index ec96befb..d93fbdcd 100644 --- a/src/Product/BillOfLading/BillOfLadingV1NotifyParty.php +++ b/src/V1/Product/BillOfLading/BillOfLadingV1NotifyParty.php @@ -1,10 +1,10 @@ address); - $outArr["email"] = SummaryHelper::formatForDisplay($this->email); - $outArr["name"] = SummaryHelper::formatForDisplay($this->name); - $outArr["phone"] = SummaryHelper::formatForDisplay($this->phone); + $outArr["address"] = SummaryHelperV1::formatForDisplay($this->address); + $outArr["email"] = SummaryHelperV1::formatForDisplay($this->email); + $outArr["name"] = SummaryHelperV1::formatForDisplay($this->name); + $outArr["phone"] = SummaryHelperV1::formatForDisplay($this->phone); return $outArr; } @@ -68,10 +68,10 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["address"] = SummaryHelper::formatForDisplay($this->address); - $outArr["email"] = SummaryHelper::formatForDisplay($this->email); - $outArr["name"] = SummaryHelper::formatForDisplay($this->name); - $outArr["phone"] = SummaryHelper::formatForDisplay($this->phone); + $outArr["address"] = SummaryHelperV1::formatForDisplay($this->address); + $outArr["email"] = SummaryHelperV1::formatForDisplay($this->email); + $outArr["name"] = SummaryHelperV1::formatForDisplay($this->name); + $outArr["phone"] = SummaryHelperV1::formatForDisplay($this->phone); return $outArr; } /** @@ -95,6 +95,6 @@ public function toFieldList(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toFieldList()); + return SummaryHelperV1::cleanOutString($this->toFieldList()); } } diff --git a/src/Product/BillOfLading/BillOfLadingV1Shipper.php b/src/V1/Product/BillOfLading/BillOfLadingV1Shipper.php similarity index 70% rename from src/Product/BillOfLading/BillOfLadingV1Shipper.php rename to src/V1/Product/BillOfLading/BillOfLadingV1Shipper.php index bd3ae072..f22a1d50 100644 --- a/src/Product/BillOfLading/BillOfLadingV1Shipper.php +++ b/src/V1/Product/BillOfLading/BillOfLadingV1Shipper.php @@ -1,10 +1,10 @@ address); - $outArr["email"] = SummaryHelper::formatForDisplay($this->email); - $outArr["name"] = SummaryHelper::formatForDisplay($this->name); - $outArr["phone"] = SummaryHelper::formatForDisplay($this->phone); + $outArr["address"] = SummaryHelperV1::formatForDisplay($this->address); + $outArr["email"] = SummaryHelperV1::formatForDisplay($this->email); + $outArr["name"] = SummaryHelperV1::formatForDisplay($this->name); + $outArr["phone"] = SummaryHelperV1::formatForDisplay($this->phone); return $outArr; } @@ -68,10 +68,10 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["address"] = SummaryHelper::formatForDisplay($this->address); - $outArr["email"] = SummaryHelper::formatForDisplay($this->email); - $outArr["name"] = SummaryHelper::formatForDisplay($this->name); - $outArr["phone"] = SummaryHelper::formatForDisplay($this->phone); + $outArr["address"] = SummaryHelperV1::formatForDisplay($this->address); + $outArr["email"] = SummaryHelperV1::formatForDisplay($this->email); + $outArr["name"] = SummaryHelperV1::formatForDisplay($this->name); + $outArr["phone"] = SummaryHelperV1::formatForDisplay($this->phone); return $outArr; } /** @@ -95,6 +95,6 @@ public function toFieldList(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toFieldList()); + return SummaryHelperV1::cleanOutString($this->toFieldList()); } } diff --git a/src/Product/BusinessCard/BusinessCardV1.php b/src/V1/Product/BusinessCard/BusinessCardV1.php similarity index 84% rename from src/Product/BusinessCard/BusinessCardV1.php rename to src/V1/Product/BusinessCard/BusinessCardV1.php index f5697c46..3c93c46f 100644 --- a/src/Product/BusinessCard/BusinessCardV1.php +++ b/src/V1/Product/BusinessCard/BusinessCardV1.php @@ -2,11 +2,11 @@ /** Business Card V1. */ -namespace Mindee\Product\BusinessCard; +namespace Mindee\V1\Product\BusinessCard; -use Mindee\Parsing\Common\Inference; -use Mindee\Parsing\Common\Page; use Mindee\Error\MindeeUnsetException; +use Mindee\V1\Parsing\Common\Inference; +use Mindee\V1\Parsing\Common\Page; /** * Business Card API version 1 inference prediction. @@ -33,7 +33,7 @@ public function __construct(array $rawPrediction) foreach ($rawPrediction['pages'] as $page) { try { $this->pages[] = new Page(BusinessCardV1Document::class, $page); - } catch (MindeeUnsetException $ignored) { + } catch (MindeeUnsetException) { } } } diff --git a/src/Product/BusinessCard/BusinessCardV1Document.php b/src/V1/Product/BusinessCard/BusinessCardV1Document.php similarity index 95% rename from src/Product/BusinessCard/BusinessCardV1Document.php rename to src/V1/Product/BusinessCard/BusinessCardV1Document.php index 711ea6f7..6965ba5f 100644 --- a/src/Product/BusinessCard/BusinessCardV1Document.php +++ b/src/V1/Product/BusinessCard/BusinessCardV1Document.php @@ -1,11 +1,11 @@ website :Social Media: $socialMedia "; - return SummaryHelper::cleanOutString($outStr); + return SummaryHelperV1::cleanOutString($outStr); } } diff --git a/src/Product/Cropper/CropperV1.php b/src/V1/Product/Cropper/CropperV1.php similarity index 84% rename from src/Product/Cropper/CropperV1.php rename to src/V1/Product/Cropper/CropperV1.php index e3863ffa..51718551 100644 --- a/src/Product/Cropper/CropperV1.php +++ b/src/V1/Product/Cropper/CropperV1.php @@ -2,11 +2,11 @@ /** Cropper V1. */ -namespace Mindee\Product\Cropper; +namespace Mindee\V1\Product\Cropper; -use Mindee\Parsing\Common\Inference; -use Mindee\Parsing\Common\Page; use Mindee\Error\MindeeUnsetException; +use Mindee\V1\Parsing\Common\Inference; +use Mindee\V1\Parsing\Common\Page; /** * Cropper API version 1 inference prediction. @@ -33,7 +33,7 @@ public function __construct(array $rawPrediction) foreach ($rawPrediction['pages'] as $page) { try { $this->pages[] = new Page(CropperV1Page::class, $page); - } catch (MindeeUnsetException $ignored) { + } catch (MindeeUnsetException) { } } } diff --git a/src/Product/Cropper/CropperV1Document.php b/src/V1/Product/Cropper/CropperV1Document.php similarity index 75% rename from src/Product/Cropper/CropperV1Document.php rename to src/V1/Product/Cropper/CropperV1Document.php index aecf0b65..2920532f 100644 --- a/src/Product/Cropper/CropperV1Document.php +++ b/src/V1/Product/Cropper/CropperV1Document.php @@ -1,8 +1,8 @@ pages[] = new Page(DeliveryNoteV1Document::class, $page); - } catch (MindeeUnsetException $ignored) { + } catch (MindeeUnsetException) { } } } diff --git a/src/Product/DeliveryNote/DeliveryNoteV1Document.php b/src/V1/Product/DeliveryNote/DeliveryNoteV1Document.php similarity index 91% rename from src/Product/DeliveryNote/DeliveryNoteV1Document.php rename to src/V1/Product/DeliveryNote/DeliveryNoteV1Document.php index 426646b5..eda678b5 100644 --- a/src/Product/DeliveryNote/DeliveryNoteV1Document.php +++ b/src/V1/Product/DeliveryNote/DeliveryNoteV1Document.php @@ -1,13 +1,13 @@ customerAddress :Total Amount: $this->totalAmount "; - return SummaryHelper::cleanOutString($outStr); + return SummaryHelperV1::cleanOutString($outStr); } } diff --git a/src/Product/DriverLicense/DriverLicenseV1.php b/src/V1/Product/DriverLicense/DriverLicenseV1.php similarity index 84% rename from src/Product/DriverLicense/DriverLicenseV1.php rename to src/V1/Product/DriverLicense/DriverLicenseV1.php index 43c2468a..c791542b 100644 --- a/src/Product/DriverLicense/DriverLicenseV1.php +++ b/src/V1/Product/DriverLicense/DriverLicenseV1.php @@ -2,11 +2,11 @@ /** Driver License V1. */ -namespace Mindee\Product\DriverLicense; +namespace Mindee\V1\Product\DriverLicense; -use Mindee\Parsing\Common\Inference; -use Mindee\Parsing\Common\Page; use Mindee\Error\MindeeUnsetException; +use Mindee\V1\Parsing\Common\Inference; +use Mindee\V1\Parsing\Common\Page; /** * Driver License API version 1 inference prediction. @@ -33,7 +33,7 @@ public function __construct(array $rawPrediction) foreach ($rawPrediction['pages'] as $page) { try { $this->pages[] = new Page(DriverLicenseV1Document::class, $page); - } catch (MindeeUnsetException $ignored) { + } catch (MindeeUnsetException) { } } } diff --git a/src/Product/DriverLicense/DriverLicenseV1Document.php b/src/V1/Product/DriverLicense/DriverLicenseV1Document.php similarity index 95% rename from src/Product/DriverLicense/DriverLicenseV1Document.php rename to src/V1/Product/DriverLicense/DriverLicenseV1Document.php index c3ddb431..05c17ced 100644 --- a/src/Product/DriverLicense/DriverLicenseV1Document.php +++ b/src/V1/Product/DriverLicense/DriverLicenseV1Document.php @@ -1,12 +1,12 @@ mrz :DD Number: $this->ddNumber "; - return SummaryHelper::cleanOutString($outStr); + return SummaryHelperV1::cleanOutString($outStr); } } diff --git a/src/Product/FinancialDocument/FinancialDocumentV1.php b/src/V1/Product/FinancialDocument/FinancialDocumentV1.php similarity index 84% rename from src/Product/FinancialDocument/FinancialDocumentV1.php rename to src/V1/Product/FinancialDocument/FinancialDocumentV1.php index 5c153e3e..2a86164c 100644 --- a/src/Product/FinancialDocument/FinancialDocumentV1.php +++ b/src/V1/Product/FinancialDocument/FinancialDocumentV1.php @@ -2,11 +2,11 @@ /** Financial Document V1. */ -namespace Mindee\Product\FinancialDocument; +namespace Mindee\V1\Product\FinancialDocument; -use Mindee\Parsing\Common\Inference; -use Mindee\Parsing\Common\Page; use Mindee\Error\MindeeUnsetException; +use Mindee\V1\Parsing\Common\Inference; +use Mindee\V1\Parsing\Common\Page; /** * Financial Document API version 1 inference prediction. @@ -33,7 +33,7 @@ public function __construct(array $rawPrediction) foreach ($rawPrediction['pages'] as $page) { try { $this->pages[] = new Page(FinancialDocumentV1Document::class, $page); - } catch (MindeeUnsetException $ignored) { + } catch (MindeeUnsetException) { } } } diff --git a/src/Product/FinancialDocument/FinancialDocumentV1Document.php b/src/V1/Product/FinancialDocument/FinancialDocumentV1Document.php similarity index 96% rename from src/Product/FinancialDocument/FinancialDocumentV1Document.php rename to src/V1/Product/FinancialDocument/FinancialDocumentV1Document.php index e070e7f6..227eddda 100644 --- a/src/Product/FinancialDocument/FinancialDocumentV1Document.php +++ b/src/V1/Product/FinancialDocument/FinancialDocumentV1Document.php @@ -1,19 +1,19 @@ time :Line Items: $lineItemsSummary "; - return SummaryHelper::cleanOutString($outStr); + return SummaryHelperV1::cleanOutString($outStr); } } diff --git a/src/Product/FinancialDocument/FinancialDocumentV1LineItem.php b/src/V1/Product/FinancialDocument/FinancialDocumentV1LineItem.php similarity index 55% rename from src/Product/FinancialDocument/FinancialDocumentV1LineItem.php rename to src/V1/Product/FinancialDocument/FinancialDocumentV1LineItem.php index ed04696d..cc3ed6cf 100644 --- a/src/Product/FinancialDocument/FinancialDocumentV1LineItem.php +++ b/src/V1/Product/FinancialDocument/FinancialDocumentV1LineItem.php @@ -1,10 +1,10 @@ description, 36); - $outArr["productCode"] = SummaryHelper::formatForDisplay($this->productCode); - $outArr["quantity"] = SummaryHelper::formatFloat($this->quantity); - $outArr["taxAmount"] = SummaryHelper::formatFloat($this->taxAmount); - $outArr["taxRate"] = SummaryHelper::formatFloat($this->taxRate); - $outArr["totalAmount"] = SummaryHelper::formatFloat($this->totalAmount); - $outArr["unitMeasure"] = SummaryHelper::formatForDisplay($this->unitMeasure); - $outArr["unitPrice"] = SummaryHelper::formatFloat($this->unitPrice); + $outArr["description"] = SummaryHelperV1::formatForDisplay($this->description, 36); + $outArr["productCode"] = SummaryHelperV1::formatForDisplay($this->productCode); + $outArr["quantity"] = SummaryHelperV1::formatFloat($this->quantity); + $outArr["taxAmount"] = SummaryHelperV1::formatFloat($this->taxAmount); + $outArr["taxRate"] = SummaryHelperV1::formatFloat($this->taxRate); + $outArr["totalAmount"] = SummaryHelperV1::formatFloat($this->totalAmount); + $outArr["unitMeasure"] = SummaryHelperV1::formatForDisplay($this->unitMeasure); + $outArr["unitPrice"] = SummaryHelperV1::formatFloat($this->unitPrice); return $outArr; } @@ -97,14 +97,14 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["description"] = SummaryHelper::formatForDisplay($this->description); - $outArr["productCode"] = SummaryHelper::formatForDisplay($this->productCode); - $outArr["quantity"] = SummaryHelper::formatFloat($this->quantity); - $outArr["taxAmount"] = SummaryHelper::formatFloat($this->taxAmount); - $outArr["taxRate"] = SummaryHelper::formatFloat($this->taxRate); - $outArr["totalAmount"] = SummaryHelper::formatFloat($this->totalAmount); - $outArr["unitMeasure"] = SummaryHelper::formatForDisplay($this->unitMeasure); - $outArr["unitPrice"] = SummaryHelper::formatFloat($this->unitPrice); + $outArr["description"] = SummaryHelperV1::formatForDisplay($this->description); + $outArr["productCode"] = SummaryHelperV1::formatForDisplay($this->productCode); + $outArr["quantity"] = SummaryHelperV1::formatFloat($this->quantity); + $outArr["taxAmount"] = SummaryHelperV1::formatFloat($this->taxAmount); + $outArr["taxRate"] = SummaryHelperV1::formatFloat($this->taxRate); + $outArr["totalAmount"] = SummaryHelperV1::formatFloat($this->totalAmount); + $outArr["unitMeasure"] = SummaryHelperV1::formatForDisplay($this->unitMeasure); + $outArr["unitPrice"] = SummaryHelperV1::formatFloat($this->unitPrice); return $outArr; } /** @@ -116,15 +116,15 @@ public function toTableLine(): string { $printable = $this->tablePrintableValues(); $outStr = "| "; - $outStr .= SummaryHelper::padString($printable["description"], 36); - $outStr .= SummaryHelper::padString($printable["productCode"], 12); - $outStr .= SummaryHelper::padString($printable["quantity"], 8); - $outStr .= SummaryHelper::padString($printable["taxAmount"], 10); - $outStr .= SummaryHelper::padString($printable["taxRate"], 12); - $outStr .= SummaryHelper::padString($printable["totalAmount"], 12); - $outStr .= SummaryHelper::padString($printable["unitMeasure"], 15); - $outStr .= SummaryHelper::padString($printable["unitPrice"], 10); - return rtrim(SummaryHelper::cleanOutString($outStr)); + $outStr .= SummaryHelperV1::padString($printable["description"], 36); + $outStr .= SummaryHelperV1::padString($printable["productCode"], 12); + $outStr .= SummaryHelperV1::padString($printable["quantity"], 8); + $outStr .= SummaryHelperV1::padString($printable["taxAmount"], 10); + $outStr .= SummaryHelperV1::padString($printable["taxRate"], 12); + $outStr .= SummaryHelperV1::padString($printable["totalAmount"], 12); + $outStr .= SummaryHelperV1::padString($printable["unitMeasure"], 15); + $outStr .= SummaryHelperV1::padString($printable["unitPrice"], 10); + return rtrim(SummaryHelperV1::cleanOutString($outStr)); } /** @@ -132,6 +132,6 @@ public function toTableLine(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toTableLine()); + return SummaryHelperV1::cleanOutString($this->toTableLine()); } } diff --git a/src/Product/FinancialDocument/FinancialDocumentV1LineItems.php b/src/V1/Product/FinancialDocument/FinancialDocumentV1LineItems.php similarity index 97% rename from src/Product/FinancialDocument/FinancialDocumentV1LineItems.php rename to src/V1/Product/FinancialDocument/FinancialDocumentV1LineItems.php index b9340c2c..ca69c2e1 100644 --- a/src/Product/FinancialDocument/FinancialDocumentV1LineItems.php +++ b/src/V1/Product/FinancialDocument/FinancialDocumentV1LineItems.php @@ -1,6 +1,6 @@ pages[] = new Page(BankAccountDetailsV1Document::class, $page); - } catch (MindeeUnsetException $ignored) { + } catch (MindeeUnsetException) { } } } diff --git a/src/Product/Fr/BankAccountDetails/BankAccountDetailsV1Document.php b/src/V1/Product/Fr/BankAccountDetails/BankAccountDetailsV1Document.php similarity index 88% rename from src/Product/Fr/BankAccountDetails/BankAccountDetailsV1Document.php rename to src/V1/Product/Fr/BankAccountDetails/BankAccountDetailsV1Document.php index ceb8cc30..da1809df 100644 --- a/src/Product/Fr/BankAccountDetails/BankAccountDetailsV1Document.php +++ b/src/V1/Product/Fr/BankAccountDetails/BankAccountDetailsV1Document.php @@ -1,11 +1,11 @@ accountHolderName :SWIFT Code: $this->swift "; - return SummaryHelper::cleanOutString($outStr); + return SummaryHelperV1::cleanOutString($outStr); } } diff --git a/src/Product/Fr/BankAccountDetails/BankAccountDetailsV2.php b/src/V1/Product/Fr/BankAccountDetails/BankAccountDetailsV2.php similarity index 84% rename from src/Product/Fr/BankAccountDetails/BankAccountDetailsV2.php rename to src/V1/Product/Fr/BankAccountDetails/BankAccountDetailsV2.php index 532eaf80..4d7f7917 100644 --- a/src/Product/Fr/BankAccountDetails/BankAccountDetailsV2.php +++ b/src/V1/Product/Fr/BankAccountDetails/BankAccountDetailsV2.php @@ -2,11 +2,11 @@ /** Bank Account Details V2. */ -namespace Mindee\Product\Fr\BankAccountDetails; +namespace Mindee\V1\Product\Fr\BankAccountDetails; -use Mindee\Parsing\Common\Inference; -use Mindee\Parsing\Common\Page; use Mindee\Error\MindeeUnsetException; +use Mindee\V1\Parsing\Common\Inference; +use Mindee\V1\Parsing\Common\Page; /** * Bank Account Details API version 2 inference prediction. @@ -33,7 +33,7 @@ public function __construct(array $rawPrediction) foreach ($rawPrediction['pages'] as $page) { try { $this->pages[] = new Page(BankAccountDetailsV2Document::class, $page); - } catch (MindeeUnsetException $ignored) { + } catch (MindeeUnsetException) { } } } diff --git a/src/Product/Fr/BankAccountDetails/BankAccountDetailsV2Bban.php b/src/V1/Product/Fr/BankAccountDetails/BankAccountDetailsV2Bban.php similarity index 70% rename from src/Product/Fr/BankAccountDetails/BankAccountDetailsV2Bban.php rename to src/V1/Product/Fr/BankAccountDetails/BankAccountDetailsV2Bban.php index 94297e1b..1a6803e7 100644 --- a/src/Product/Fr/BankAccountDetails/BankAccountDetailsV2Bban.php +++ b/src/V1/Product/Fr/BankAccountDetails/BankAccountDetailsV2Bban.php @@ -1,10 +1,10 @@ bbanBankCode); - $outArr["bbanBranchCode"] = SummaryHelper::formatForDisplay($this->bbanBranchCode); - $outArr["bbanKey"] = SummaryHelper::formatForDisplay($this->bbanKey); - $outArr["bbanNumber"] = SummaryHelper::formatForDisplay($this->bbanNumber); + $outArr["bbanBankCode"] = SummaryHelperV1::formatForDisplay($this->bbanBankCode); + $outArr["bbanBranchCode"] = SummaryHelperV1::formatForDisplay($this->bbanBranchCode); + $outArr["bbanKey"] = SummaryHelperV1::formatForDisplay($this->bbanKey); + $outArr["bbanNumber"] = SummaryHelperV1::formatForDisplay($this->bbanNumber); return $outArr; } @@ -68,10 +68,10 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["bbanBankCode"] = SummaryHelper::formatForDisplay($this->bbanBankCode); - $outArr["bbanBranchCode"] = SummaryHelper::formatForDisplay($this->bbanBranchCode); - $outArr["bbanKey"] = SummaryHelper::formatForDisplay($this->bbanKey); - $outArr["bbanNumber"] = SummaryHelper::formatForDisplay($this->bbanNumber); + $outArr["bbanBankCode"] = SummaryHelperV1::formatForDisplay($this->bbanBankCode); + $outArr["bbanBranchCode"] = SummaryHelperV1::formatForDisplay($this->bbanBranchCode); + $outArr["bbanKey"] = SummaryHelperV1::formatForDisplay($this->bbanKey); + $outArr["bbanNumber"] = SummaryHelperV1::formatForDisplay($this->bbanNumber); return $outArr; } /** @@ -95,6 +95,6 @@ public function toFieldList(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toFieldList()); + return SummaryHelperV1::cleanOutString($this->toFieldList()); } } diff --git a/src/Product/Fr/BankAccountDetails/BankAccountDetailsV2Document.php b/src/V1/Product/Fr/BankAccountDetails/BankAccountDetailsV2Document.php similarity index 90% rename from src/Product/Fr/BankAccountDetails/BankAccountDetailsV2Document.php rename to src/V1/Product/Fr/BankAccountDetails/BankAccountDetailsV2Document.php index dfc3043a..9e33d608 100644 --- a/src/Product/Fr/BankAccountDetails/BankAccountDetailsV2Document.php +++ b/src/V1/Product/Fr/BankAccountDetails/BankAccountDetailsV2Document.php @@ -1,11 +1,11 @@ iban :SWIFT Code: $this->swiftCode "; - return SummaryHelper::cleanOutString($outStr); + return SummaryHelperV1::cleanOutString($outStr); } } diff --git a/src/Product/Fr/CarteGrise/CarteGriseV1.php b/src/V1/Product/Fr/CarteGrise/CarteGriseV1.php similarity index 84% rename from src/Product/Fr/CarteGrise/CarteGriseV1.php rename to src/V1/Product/Fr/CarteGrise/CarteGriseV1.php index ede84373..d1557163 100644 --- a/src/Product/Fr/CarteGrise/CarteGriseV1.php +++ b/src/V1/Product/Fr/CarteGrise/CarteGriseV1.php @@ -2,11 +2,11 @@ /** Carte Grise V1. */ -namespace Mindee\Product\Fr\CarteGrise; +namespace Mindee\V1\Product\Fr\CarteGrise; -use Mindee\Parsing\Common\Inference; -use Mindee\Parsing\Common\Page; use Mindee\Error\MindeeUnsetException; +use Mindee\V1\Parsing\Common\Inference; +use Mindee\V1\Parsing\Common\Page; /** * Carte Grise API version 1 inference prediction. @@ -33,7 +33,7 @@ public function __construct(array $rawPrediction) foreach ($rawPrediction['pages'] as $page) { try { $this->pages[] = new Page(CarteGriseV1Document::class, $page); - } catch (MindeeUnsetException $ignored) { + } catch (MindeeUnsetException) { } } } diff --git a/src/Product/Fr/CarteGrise/CarteGriseV1Document.php b/src/V1/Product/Fr/CarteGrise/CarteGriseV1Document.php similarity index 98% rename from src/Product/Fr/CarteGrise/CarteGriseV1Document.php rename to src/V1/Product/Fr/CarteGrise/CarteGriseV1Document.php index 9342649a..9accb238 100644 --- a/src/Product/Fr/CarteGrise/CarteGriseV1Document.php +++ b/src/V1/Product/Fr/CarteGrise/CarteGriseV1Document.php @@ -1,12 +1,12 @@ mrz1 :MRZ Line 2: $this->mrz2 "; - return SummaryHelper::cleanOutString($outStr); + return SummaryHelperV1::cleanOutString($outStr); } } diff --git a/src/Product/Fr/EnergyBill/EnergyBillV1.php b/src/V1/Product/Fr/EnergyBill/EnergyBillV1.php similarity index 84% rename from src/Product/Fr/EnergyBill/EnergyBillV1.php rename to src/V1/Product/Fr/EnergyBill/EnergyBillV1.php index d027d1be..c49192cd 100644 --- a/src/Product/Fr/EnergyBill/EnergyBillV1.php +++ b/src/V1/Product/Fr/EnergyBill/EnergyBillV1.php @@ -2,11 +2,11 @@ /** Energy Bill V1. */ -namespace Mindee\Product\Fr\EnergyBill; +namespace Mindee\V1\Product\Fr\EnergyBill; -use Mindee\Parsing\Common\Inference; -use Mindee\Parsing\Common\Page; use Mindee\Error\MindeeUnsetException; +use Mindee\V1\Parsing\Common\Inference; +use Mindee\V1\Parsing\Common\Page; /** * Energy Bill API version 1 inference prediction. @@ -33,7 +33,7 @@ public function __construct(array $rawPrediction) foreach ($rawPrediction['pages'] as $page) { try { $this->pages[] = new Page(EnergyBillV1Document::class, $page); - } catch (MindeeUnsetException $ignored) { + } catch (MindeeUnsetException) { } } } diff --git a/src/Product/Fr/EnergyBill/EnergyBillV1Document.php b/src/V1/Product/Fr/EnergyBill/EnergyBillV1Document.php similarity index 95% rename from src/Product/Fr/EnergyBill/EnergyBillV1Document.php rename to src/V1/Product/Fr/EnergyBill/EnergyBillV1Document.php index 9667b67b..7a7ad1ae 100644 --- a/src/Product/Fr/EnergyBill/EnergyBillV1Document.php +++ b/src/V1/Product/Fr/EnergyBill/EnergyBillV1Document.php @@ -1,13 +1,13 @@ address); - $outArr["name"] = SummaryHelper::formatForDisplay($this->name); + $outArr["address"] = SummaryHelperV1::formatForDisplay($this->address); + $outArr["name"] = SummaryHelperV1::formatForDisplay($this->name); return $outArr; } @@ -56,8 +56,8 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["address"] = SummaryHelper::formatForDisplay($this->address); - $outArr["name"] = SummaryHelper::formatForDisplay($this->name); + $outArr["address"] = SummaryHelperV1::formatForDisplay($this->address); + $outArr["name"] = SummaryHelperV1::formatForDisplay($this->name); return $outArr; } /** @@ -79,6 +79,6 @@ public function toFieldList(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toFieldList()); + return SummaryHelperV1::cleanOutString($this->toFieldList()); } } diff --git a/src/Product/Fr/EnergyBill/EnergyBillV1EnergySupplier.php b/src/V1/Product/Fr/EnergyBill/EnergyBillV1EnergySupplier.php similarity index 75% rename from src/Product/Fr/EnergyBill/EnergyBillV1EnergySupplier.php rename to src/V1/Product/Fr/EnergyBill/EnergyBillV1EnergySupplier.php index b95eafc3..86c84d61 100644 --- a/src/Product/Fr/EnergyBill/EnergyBillV1EnergySupplier.php +++ b/src/V1/Product/Fr/EnergyBill/EnergyBillV1EnergySupplier.php @@ -1,10 +1,10 @@ address); - $outArr["name"] = SummaryHelper::formatForDisplay($this->name); + $outArr["address"] = SummaryHelperV1::formatForDisplay($this->address); + $outArr["name"] = SummaryHelperV1::formatForDisplay($this->name); return $outArr; } @@ -56,8 +56,8 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["address"] = SummaryHelper::formatForDisplay($this->address); - $outArr["name"] = SummaryHelper::formatForDisplay($this->name); + $outArr["address"] = SummaryHelperV1::formatForDisplay($this->address); + $outArr["name"] = SummaryHelperV1::formatForDisplay($this->name); return $outArr; } /** @@ -79,6 +79,6 @@ public function toFieldList(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toFieldList()); + return SummaryHelperV1::cleanOutString($this->toFieldList()); } } diff --git a/src/Product/Fr/EnergyBill/EnergyBillV1EnergyUsage.php b/src/V1/Product/Fr/EnergyBill/EnergyBillV1EnergyUsage.php similarity index 56% rename from src/Product/Fr/EnergyBill/EnergyBillV1EnergyUsage.php rename to src/V1/Product/Fr/EnergyBill/EnergyBillV1EnergyUsage.php index 4e6767a6..3d919302 100644 --- a/src/Product/Fr/EnergyBill/EnergyBillV1EnergyUsage.php +++ b/src/V1/Product/Fr/EnergyBill/EnergyBillV1EnergyUsage.php @@ -1,10 +1,10 @@ consumption); - $outArr["description"] = SummaryHelper::formatForDisplay($this->description, 36); - $outArr["endDate"] = SummaryHelper::formatForDisplay($this->endDate, 10); - $outArr["startDate"] = SummaryHelper::formatForDisplay($this->startDate); - $outArr["taxRate"] = SummaryHelper::formatFloat($this->taxRate); - $outArr["total"] = SummaryHelper::formatFloat($this->total); - $outArr["unit"] = SummaryHelper::formatForDisplay($this->unit); - $outArr["unitPrice"] = SummaryHelper::formatFloat($this->unitPrice); + $outArr["consumption"] = SummaryHelperV1::formatFloat($this->consumption); + $outArr["description"] = SummaryHelperV1::formatForDisplay($this->description, 36); + $outArr["endDate"] = SummaryHelperV1::formatForDisplay($this->endDate, 10); + $outArr["startDate"] = SummaryHelperV1::formatForDisplay($this->startDate); + $outArr["taxRate"] = SummaryHelperV1::formatFloat($this->taxRate); + $outArr["total"] = SummaryHelperV1::formatFloat($this->total); + $outArr["unit"] = SummaryHelperV1::formatForDisplay($this->unit); + $outArr["unitPrice"] = SummaryHelperV1::formatFloat($this->unitPrice); return $outArr; } @@ -96,14 +96,14 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["consumption"] = SummaryHelper::formatFloat($this->consumption); - $outArr["description"] = SummaryHelper::formatForDisplay($this->description); - $outArr["endDate"] = SummaryHelper::formatForDisplay($this->endDate); - $outArr["startDate"] = SummaryHelper::formatForDisplay($this->startDate); - $outArr["taxRate"] = SummaryHelper::formatFloat($this->taxRate); - $outArr["total"] = SummaryHelper::formatFloat($this->total); - $outArr["unit"] = SummaryHelper::formatForDisplay($this->unit); - $outArr["unitPrice"] = SummaryHelper::formatFloat($this->unitPrice); + $outArr["consumption"] = SummaryHelperV1::formatFloat($this->consumption); + $outArr["description"] = SummaryHelperV1::formatForDisplay($this->description); + $outArr["endDate"] = SummaryHelperV1::formatForDisplay($this->endDate); + $outArr["startDate"] = SummaryHelperV1::formatForDisplay($this->startDate); + $outArr["taxRate"] = SummaryHelperV1::formatFloat($this->taxRate); + $outArr["total"] = SummaryHelperV1::formatFloat($this->total); + $outArr["unit"] = SummaryHelperV1::formatForDisplay($this->unit); + $outArr["unitPrice"] = SummaryHelperV1::formatFloat($this->unitPrice); return $outArr; } /** @@ -115,15 +115,15 @@ public function toTableLine(): string { $printable = $this->tablePrintableValues(); $outStr = "| "; - $outStr .= SummaryHelper::padString($printable["consumption"], 11); - $outStr .= SummaryHelper::padString($printable["description"], 36); - $outStr .= SummaryHelper::padString($printable["endDate"], 10); - $outStr .= SummaryHelper::padString($printable["startDate"], 10); - $outStr .= SummaryHelper::padString($printable["taxRate"], 8); - $outStr .= SummaryHelper::padString($printable["total"], 9); - $outStr .= SummaryHelper::padString($printable["unit"], 15); - $outStr .= SummaryHelper::padString($printable["unitPrice"], 10); - return rtrim(SummaryHelper::cleanOutString($outStr)); + $outStr .= SummaryHelperV1::padString($printable["consumption"], 11); + $outStr .= SummaryHelperV1::padString($printable["description"], 36); + $outStr .= SummaryHelperV1::padString($printable["endDate"], 10); + $outStr .= SummaryHelperV1::padString($printable["startDate"], 10); + $outStr .= SummaryHelperV1::padString($printable["taxRate"], 8); + $outStr .= SummaryHelperV1::padString($printable["total"], 9); + $outStr .= SummaryHelperV1::padString($printable["unit"], 15); + $outStr .= SummaryHelperV1::padString($printable["unitPrice"], 10); + return rtrim(SummaryHelperV1::cleanOutString($outStr)); } /** @@ -131,6 +131,6 @@ public function toTableLine(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toTableLine()); + return SummaryHelperV1::cleanOutString($this->toTableLine()); } } diff --git a/src/Product/Fr/EnergyBill/EnergyBillV1EnergyUsages.php b/src/V1/Product/Fr/EnergyBill/EnergyBillV1EnergyUsages.php similarity index 98% rename from src/Product/Fr/EnergyBill/EnergyBillV1EnergyUsages.php rename to src/V1/Product/Fr/EnergyBill/EnergyBillV1EnergyUsages.php index 39f0b4c7..8a100ab5 100644 --- a/src/Product/Fr/EnergyBill/EnergyBillV1EnergyUsages.php +++ b/src/V1/Product/Fr/EnergyBill/EnergyBillV1EnergyUsages.php @@ -1,6 +1,6 @@ meterNumber); - $outArr["meterType"] = SummaryHelper::formatForDisplay($this->meterType); - $outArr["unit"] = SummaryHelper::formatForDisplay($this->unit); + $outArr["meterNumber"] = SummaryHelperV1::formatForDisplay($this->meterNumber); + $outArr["meterType"] = SummaryHelperV1::formatForDisplay($this->meterType); + $outArr["unit"] = SummaryHelperV1::formatForDisplay($this->unit); return $outArr; } @@ -62,9 +62,9 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["meterNumber"] = SummaryHelper::formatForDisplay($this->meterNumber); - $outArr["meterType"] = SummaryHelper::formatForDisplay($this->meterType); - $outArr["unit"] = SummaryHelper::formatForDisplay($this->unit); + $outArr["meterNumber"] = SummaryHelperV1::formatForDisplay($this->meterNumber); + $outArr["meterType"] = SummaryHelperV1::formatForDisplay($this->meterType); + $outArr["unit"] = SummaryHelperV1::formatForDisplay($this->unit); return $outArr; } /** @@ -87,6 +87,6 @@ public function toFieldList(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toFieldList()); + return SummaryHelperV1::cleanOutString($this->toFieldList()); } } diff --git a/src/Product/Fr/EnergyBill/EnergyBillV1Subscription.php b/src/V1/Product/Fr/EnergyBill/EnergyBillV1Subscription.php similarity index 58% rename from src/Product/Fr/EnergyBill/EnergyBillV1Subscription.php rename to src/V1/Product/Fr/EnergyBill/EnergyBillV1Subscription.php index 04c81e3e..8cc6877b 100644 --- a/src/Product/Fr/EnergyBill/EnergyBillV1Subscription.php +++ b/src/V1/Product/Fr/EnergyBill/EnergyBillV1Subscription.php @@ -1,10 +1,10 @@ description, 36); - $outArr["endDate"] = SummaryHelper::formatForDisplay($this->endDate, 10); - $outArr["startDate"] = SummaryHelper::formatForDisplay($this->startDate); - $outArr["taxRate"] = SummaryHelper::formatFloat($this->taxRate); - $outArr["total"] = SummaryHelper::formatFloat($this->total); - $outArr["unitPrice"] = SummaryHelper::formatFloat($this->unitPrice); + $outArr["description"] = SummaryHelperV1::formatForDisplay($this->description, 36); + $outArr["endDate"] = SummaryHelperV1::formatForDisplay($this->endDate, 10); + $outArr["startDate"] = SummaryHelperV1::formatForDisplay($this->startDate); + $outArr["taxRate"] = SummaryHelperV1::formatFloat($this->taxRate); + $outArr["total"] = SummaryHelperV1::formatFloat($this->total); + $outArr["unitPrice"] = SummaryHelperV1::formatFloat($this->unitPrice); return $outArr; } @@ -83,12 +83,12 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["description"] = SummaryHelper::formatForDisplay($this->description); - $outArr["endDate"] = SummaryHelper::formatForDisplay($this->endDate); - $outArr["startDate"] = SummaryHelper::formatForDisplay($this->startDate); - $outArr["taxRate"] = SummaryHelper::formatFloat($this->taxRate); - $outArr["total"] = SummaryHelper::formatFloat($this->total); - $outArr["unitPrice"] = SummaryHelper::formatFloat($this->unitPrice); + $outArr["description"] = SummaryHelperV1::formatForDisplay($this->description); + $outArr["endDate"] = SummaryHelperV1::formatForDisplay($this->endDate); + $outArr["startDate"] = SummaryHelperV1::formatForDisplay($this->startDate); + $outArr["taxRate"] = SummaryHelperV1::formatFloat($this->taxRate); + $outArr["total"] = SummaryHelperV1::formatFloat($this->total); + $outArr["unitPrice"] = SummaryHelperV1::formatFloat($this->unitPrice); return $outArr; } /** @@ -100,13 +100,13 @@ public function toTableLine(): string { $printable = $this->tablePrintableValues(); $outStr = "| "; - $outStr .= SummaryHelper::padString($printable["description"], 36); - $outStr .= SummaryHelper::padString($printable["endDate"], 10); - $outStr .= SummaryHelper::padString($printable["startDate"], 10); - $outStr .= SummaryHelper::padString($printable["taxRate"], 8); - $outStr .= SummaryHelper::padString($printable["total"], 9); - $outStr .= SummaryHelper::padString($printable["unitPrice"], 10); - return rtrim(SummaryHelper::cleanOutString($outStr)); + $outStr .= SummaryHelperV1::padString($printable["description"], 36); + $outStr .= SummaryHelperV1::padString($printable["endDate"], 10); + $outStr .= SummaryHelperV1::padString($printable["startDate"], 10); + $outStr .= SummaryHelperV1::padString($printable["taxRate"], 8); + $outStr .= SummaryHelperV1::padString($printable["total"], 9); + $outStr .= SummaryHelperV1::padString($printable["unitPrice"], 10); + return rtrim(SummaryHelperV1::cleanOutString($outStr)); } /** @@ -114,6 +114,6 @@ public function toTableLine(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toTableLine()); + return SummaryHelperV1::cleanOutString($this->toTableLine()); } } diff --git a/src/Product/Fr/EnergyBill/EnergyBillV1Subscriptions.php b/src/V1/Product/Fr/EnergyBill/EnergyBillV1Subscriptions.php similarity index 97% rename from src/Product/Fr/EnergyBill/EnergyBillV1Subscriptions.php rename to src/V1/Product/Fr/EnergyBill/EnergyBillV1Subscriptions.php index 78d4818f..91d16dde 100644 --- a/src/Product/Fr/EnergyBill/EnergyBillV1Subscriptions.php +++ b/src/V1/Product/Fr/EnergyBill/EnergyBillV1Subscriptions.php @@ -1,6 +1,6 @@ description, 36); - $outArr["endDate"] = SummaryHelper::formatForDisplay($this->endDate, 10); - $outArr["startDate"] = SummaryHelper::formatForDisplay($this->startDate); - $outArr["taxRate"] = SummaryHelper::formatFloat($this->taxRate); - $outArr["total"] = SummaryHelper::formatFloat($this->total); - $outArr["unitPrice"] = SummaryHelper::formatFloat($this->unitPrice); + $outArr["description"] = SummaryHelperV1::formatForDisplay($this->description, 36); + $outArr["endDate"] = SummaryHelperV1::formatForDisplay($this->endDate, 10); + $outArr["startDate"] = SummaryHelperV1::formatForDisplay($this->startDate); + $outArr["taxRate"] = SummaryHelperV1::formatFloat($this->taxRate); + $outArr["total"] = SummaryHelperV1::formatFloat($this->total); + $outArr["unitPrice"] = SummaryHelperV1::formatFloat($this->unitPrice); return $outArr; } @@ -83,12 +83,12 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["description"] = SummaryHelper::formatForDisplay($this->description); - $outArr["endDate"] = SummaryHelper::formatForDisplay($this->endDate); - $outArr["startDate"] = SummaryHelper::formatForDisplay($this->startDate); - $outArr["taxRate"] = SummaryHelper::formatFloat($this->taxRate); - $outArr["total"] = SummaryHelper::formatFloat($this->total); - $outArr["unitPrice"] = SummaryHelper::formatFloat($this->unitPrice); + $outArr["description"] = SummaryHelperV1::formatForDisplay($this->description); + $outArr["endDate"] = SummaryHelperV1::formatForDisplay($this->endDate); + $outArr["startDate"] = SummaryHelperV1::formatForDisplay($this->startDate); + $outArr["taxRate"] = SummaryHelperV1::formatFloat($this->taxRate); + $outArr["total"] = SummaryHelperV1::formatFloat($this->total); + $outArr["unitPrice"] = SummaryHelperV1::formatFloat($this->unitPrice); return $outArr; } /** @@ -100,13 +100,13 @@ public function toTableLine(): string { $printable = $this->tablePrintableValues(); $outStr = "| "; - $outStr .= SummaryHelper::padString($printable["description"], 36); - $outStr .= SummaryHelper::padString($printable["endDate"], 10); - $outStr .= SummaryHelper::padString($printable["startDate"], 10); - $outStr .= SummaryHelper::padString($printable["taxRate"], 8); - $outStr .= SummaryHelper::padString($printable["total"], 9); - $outStr .= SummaryHelper::padString($printable["unitPrice"], 10); - return rtrim(SummaryHelper::cleanOutString($outStr)); + $outStr .= SummaryHelperV1::padString($printable["description"], 36); + $outStr .= SummaryHelperV1::padString($printable["endDate"], 10); + $outStr .= SummaryHelperV1::padString($printable["startDate"], 10); + $outStr .= SummaryHelperV1::padString($printable["taxRate"], 8); + $outStr .= SummaryHelperV1::padString($printable["total"], 9); + $outStr .= SummaryHelperV1::padString($printable["unitPrice"], 10); + return rtrim(SummaryHelperV1::cleanOutString($outStr)); } /** @@ -114,6 +114,6 @@ public function toTableLine(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toTableLine()); + return SummaryHelperV1::cleanOutString($this->toTableLine()); } } diff --git a/src/Product/Fr/EnergyBill/EnergyBillV1TaxesAndContributions.php b/src/V1/Product/Fr/EnergyBill/EnergyBillV1TaxesAndContributions.php similarity index 97% rename from src/Product/Fr/EnergyBill/EnergyBillV1TaxesAndContributions.php rename to src/V1/Product/Fr/EnergyBill/EnergyBillV1TaxesAndContributions.php index 477416e1..167d4354 100644 --- a/src/Product/Fr/EnergyBill/EnergyBillV1TaxesAndContributions.php +++ b/src/V1/Product/Fr/EnergyBill/EnergyBillV1TaxesAndContributions.php @@ -1,6 +1,6 @@ pages[] = new Page(HealthCardV1Document::class, $page); - } catch (MindeeUnsetException $ignored) { + } catch (MindeeUnsetException) { } } } diff --git a/src/Product/Fr/HealthCard/HealthCardV1Document.php b/src/V1/Product/Fr/HealthCard/HealthCardV1Document.php similarity index 89% rename from src/Product/Fr/HealthCard/HealthCardV1Document.php rename to src/V1/Product/Fr/HealthCard/HealthCardV1Document.php index 94f2d774..4d129bf8 100644 --- a/src/Product/Fr/HealthCard/HealthCardV1Document.php +++ b/src/V1/Product/Fr/HealthCard/HealthCardV1Document.php @@ -1,12 +1,12 @@ socialSecurity :Issuance Date: $this->issuanceDate "; - return SummaryHelper::cleanOutString($outStr); + return SummaryHelperV1::cleanOutString($outStr); } } diff --git a/src/Product/Fr/IdCard/IdCardV1.php b/src/V1/Product/Fr/IdCard/IdCardV1.php similarity index 84% rename from src/Product/Fr/IdCard/IdCardV1.php rename to src/V1/Product/Fr/IdCard/IdCardV1.php index 16af405a..15049893 100644 --- a/src/Product/Fr/IdCard/IdCardV1.php +++ b/src/V1/Product/Fr/IdCard/IdCardV1.php @@ -2,11 +2,11 @@ /** Carte Nationale d'Identité V1. */ -namespace Mindee\Product\Fr\IdCard; +namespace Mindee\V1\Product\Fr\IdCard; -use Mindee\Parsing\Common\Inference; -use Mindee\Parsing\Common\Page; use Mindee\Error\MindeeUnsetException; +use Mindee\V1\Parsing\Common\Inference; +use Mindee\V1\Parsing\Common\Page; /** * Carte Nationale d'Identité API version 1 inference prediction. @@ -33,7 +33,7 @@ public function __construct(array $rawPrediction) foreach ($rawPrediction['pages'] as $page) { try { $this->pages[] = new Page(IdCardV1Page::class, $page); - } catch (MindeeUnsetException $ignored) { + } catch (MindeeUnsetException) { } } } diff --git a/src/Product/Fr/IdCard/IdCardV1Document.php b/src/V1/Product/Fr/IdCard/IdCardV1Document.php similarity index 94% rename from src/Product/Fr/IdCard/IdCardV1Document.php rename to src/V1/Product/Fr/IdCard/IdCardV1Document.php index b47a4705..f6a984da 100644 --- a/src/Product/Fr/IdCard/IdCardV1Document.php +++ b/src/V1/Product/Fr/IdCard/IdCardV1Document.php @@ -1,12 +1,12 @@ mrz1 :MRZ Line 2: $this->mrz2 "; - return SummaryHelper::cleanOutString($outStr); + return SummaryHelperV1::cleanOutString($outStr); } } diff --git a/src/Product/Fr/IdCard/IdCardV1Page.php b/src/V1/Product/Fr/IdCard/IdCardV1Page.php similarity index 82% rename from src/Product/Fr/IdCard/IdCardV1Page.php rename to src/V1/Product/Fr/IdCard/IdCardV1Page.php index 4239fca1..d4907982 100644 --- a/src/Product/Fr/IdCard/IdCardV1Page.php +++ b/src/V1/Product/Fr/IdCard/IdCardV1Page.php @@ -1,9 +1,9 @@ documentSide "; $outStr .= parent::__toString(); - return SummaryHelper::cleanOutString($outStr); + return SummaryHelperV1::cleanOutString($outStr); } } diff --git a/src/Product/Fr/IdCard/IdCardV2.php b/src/V1/Product/Fr/IdCard/IdCardV2.php similarity index 84% rename from src/Product/Fr/IdCard/IdCardV2.php rename to src/V1/Product/Fr/IdCard/IdCardV2.php index a4455598..cc2397a0 100644 --- a/src/Product/Fr/IdCard/IdCardV2.php +++ b/src/V1/Product/Fr/IdCard/IdCardV2.php @@ -2,11 +2,11 @@ /** Carte Nationale d'Identité V2. */ -namespace Mindee\Product\Fr\IdCard; +namespace Mindee\V1\Product\Fr\IdCard; -use Mindee\Parsing\Common\Inference; -use Mindee\Parsing\Common\Page; use Mindee\Error\MindeeUnsetException; +use Mindee\V1\Parsing\Common\Inference; +use Mindee\V1\Parsing\Common\Page; /** * Carte Nationale d'Identité API version 2 inference prediction. @@ -33,7 +33,7 @@ public function __construct(array $rawPrediction) foreach ($rawPrediction['pages'] as $page) { try { $this->pages[] = new Page(IdCardV2Page::class, $page); - } catch (MindeeUnsetException $ignored) { + } catch (MindeeUnsetException) { } } } diff --git a/src/Product/Fr/IdCard/IdCardV2Document.php b/src/V1/Product/Fr/IdCard/IdCardV2Document.php similarity index 95% rename from src/Product/Fr/IdCard/IdCardV2Document.php rename to src/V1/Product/Fr/IdCard/IdCardV2Document.php index 45b38d16..995baea1 100644 --- a/src/Product/Fr/IdCard/IdCardV2Document.php +++ b/src/V1/Product/Fr/IdCard/IdCardV2Document.php @@ -1,12 +1,12 @@ issueDate :Issuing Authority: $this->authority "; - return SummaryHelper::cleanOutString($outStr); + return SummaryHelperV1::cleanOutString($outStr); } } diff --git a/src/Product/Fr/IdCard/IdCardV2Page.php b/src/V1/Product/Fr/IdCard/IdCardV2Page.php similarity index 86% rename from src/Product/Fr/IdCard/IdCardV2Page.php rename to src/V1/Product/Fr/IdCard/IdCardV2Page.php index e96774bf..fe2e40ec 100644 --- a/src/Product/Fr/IdCard/IdCardV2Page.php +++ b/src/V1/Product/Fr/IdCard/IdCardV2Page.php @@ -1,9 +1,9 @@ documentSide "; $outStr .= parent::__toString(); - return SummaryHelper::cleanOutString($outStr); + return SummaryHelperV1::cleanOutString($outStr); } } diff --git a/src/Product/Fr/Payslip/PayslipV3.php b/src/V1/Product/Fr/Payslip/PayslipV3.php similarity index 84% rename from src/Product/Fr/Payslip/PayslipV3.php rename to src/V1/Product/Fr/Payslip/PayslipV3.php index b58461ea..c132823a 100644 --- a/src/Product/Fr/Payslip/PayslipV3.php +++ b/src/V1/Product/Fr/Payslip/PayslipV3.php @@ -2,11 +2,11 @@ /** Payslip V3. */ -namespace Mindee\Product\Fr\Payslip; +namespace Mindee\V1\Product\Fr\Payslip; -use Mindee\Parsing\Common\Inference; -use Mindee\Parsing\Common\Page; use Mindee\Error\MindeeUnsetException; +use Mindee\V1\Parsing\Common\Inference; +use Mindee\V1\Parsing\Common\Page; /** * Payslip API version 3 inference prediction. @@ -33,7 +33,7 @@ public function __construct(array $rawPrediction) foreach ($rawPrediction['pages'] as $page) { try { $this->pages[] = new Page(PayslipV3Document::class, $page); - } catch (MindeeUnsetException $ignored) { + } catch (MindeeUnsetException) { } } } diff --git a/src/Product/Fr/Payslip/PayslipV3BankAccountDetail.php b/src/V1/Product/Fr/Payslip/PayslipV3BankAccountDetail.php similarity index 72% rename from src/Product/Fr/Payslip/PayslipV3BankAccountDetail.php rename to src/V1/Product/Fr/Payslip/PayslipV3BankAccountDetail.php index 7cdbb5a6..0daf4166 100644 --- a/src/Product/Fr/Payslip/PayslipV3BankAccountDetail.php +++ b/src/V1/Product/Fr/Payslip/PayslipV3BankAccountDetail.php @@ -1,10 +1,10 @@ bankName); - $outArr["iban"] = SummaryHelper::formatForDisplay($this->iban); - $outArr["swift"] = SummaryHelper::formatForDisplay($this->swift); + $outArr["bankName"] = SummaryHelperV1::formatForDisplay($this->bankName); + $outArr["iban"] = SummaryHelperV1::formatForDisplay($this->iban); + $outArr["swift"] = SummaryHelperV1::formatForDisplay($this->swift); return $outArr; } @@ -62,9 +62,9 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["bankName"] = SummaryHelper::formatForDisplay($this->bankName); - $outArr["iban"] = SummaryHelper::formatForDisplay($this->iban); - $outArr["swift"] = SummaryHelper::formatForDisplay($this->swift); + $outArr["bankName"] = SummaryHelperV1::formatForDisplay($this->bankName); + $outArr["iban"] = SummaryHelperV1::formatForDisplay($this->iban); + $outArr["swift"] = SummaryHelperV1::formatForDisplay($this->swift); return $outArr; } /** @@ -87,6 +87,6 @@ public function toFieldList(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toFieldList()); + return SummaryHelperV1::cleanOutString($this->toFieldList()); } } diff --git a/src/Product/Fr/Payslip/PayslipV3Document.php b/src/V1/Product/Fr/Payslip/PayslipV3Document.php similarity index 96% rename from src/Product/Fr/Payslip/PayslipV3Document.php rename to src/V1/Product/Fr/Payslip/PayslipV3Document.php index 012dcc82..957911a9 100644 --- a/src/Product/Fr/Payslip/PayslipV3Document.php +++ b/src/V1/Product/Fr/Payslip/PayslipV3Document.php @@ -1,10 +1,10 @@ address); - $outArr["dateOfBirth"] = SummaryHelper::formatForDisplay($this->dateOfBirth); - $outArr["firstName"] = SummaryHelper::formatForDisplay($this->firstName); - $outArr["lastName"] = SummaryHelper::formatForDisplay($this->lastName); - $outArr["phoneNumber"] = SummaryHelper::formatForDisplay($this->phoneNumber); - $outArr["registrationNumber"] = SummaryHelper::formatForDisplay($this->registrationNumber); - $outArr["socialSecurityNumber"] = SummaryHelper::formatForDisplay($this->socialSecurityNumber); + $outArr["address"] = SummaryHelperV1::formatForDisplay($this->address); + $outArr["dateOfBirth"] = SummaryHelperV1::formatForDisplay($this->dateOfBirth); + $outArr["firstName"] = SummaryHelperV1::formatForDisplay($this->firstName); + $outArr["lastName"] = SummaryHelperV1::formatForDisplay($this->lastName); + $outArr["phoneNumber"] = SummaryHelperV1::formatForDisplay($this->phoneNumber); + $outArr["registrationNumber"] = SummaryHelperV1::formatForDisplay($this->registrationNumber); + $outArr["socialSecurityNumber"] = SummaryHelperV1::formatForDisplay($this->socialSecurityNumber); return $outArr; } @@ -86,13 +86,13 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["address"] = SummaryHelper::formatForDisplay($this->address); - $outArr["dateOfBirth"] = SummaryHelper::formatForDisplay($this->dateOfBirth); - $outArr["firstName"] = SummaryHelper::formatForDisplay($this->firstName); - $outArr["lastName"] = SummaryHelper::formatForDisplay($this->lastName); - $outArr["phoneNumber"] = SummaryHelper::formatForDisplay($this->phoneNumber); - $outArr["registrationNumber"] = SummaryHelper::formatForDisplay($this->registrationNumber); - $outArr["socialSecurityNumber"] = SummaryHelper::formatForDisplay($this->socialSecurityNumber); + $outArr["address"] = SummaryHelperV1::formatForDisplay($this->address); + $outArr["dateOfBirth"] = SummaryHelperV1::formatForDisplay($this->dateOfBirth); + $outArr["firstName"] = SummaryHelperV1::formatForDisplay($this->firstName); + $outArr["lastName"] = SummaryHelperV1::formatForDisplay($this->lastName); + $outArr["phoneNumber"] = SummaryHelperV1::formatForDisplay($this->phoneNumber); + $outArr["registrationNumber"] = SummaryHelperV1::formatForDisplay($this->registrationNumber); + $outArr["socialSecurityNumber"] = SummaryHelperV1::formatForDisplay($this->socialSecurityNumber); return $outArr; } /** @@ -119,6 +119,6 @@ public function toFieldList(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toFieldList()); + return SummaryHelperV1::cleanOutString($this->toFieldList()); } } diff --git a/src/Product/Fr/Payslip/PayslipV3Employer.php b/src/V1/Product/Fr/Payslip/PayslipV3Employer.php similarity index 66% rename from src/Product/Fr/Payslip/PayslipV3Employer.php rename to src/V1/Product/Fr/Payslip/PayslipV3Employer.php index a46a7689..ad25e8e3 100644 --- a/src/Product/Fr/Payslip/PayslipV3Employer.php +++ b/src/V1/Product/Fr/Payslip/PayslipV3Employer.php @@ -1,10 +1,10 @@ address); - $outArr["companyId"] = SummaryHelper::formatForDisplay($this->companyId); - $outArr["companySite"] = SummaryHelper::formatForDisplay($this->companySite); - $outArr["nafCode"] = SummaryHelper::formatForDisplay($this->nafCode); - $outArr["name"] = SummaryHelper::formatForDisplay($this->name); - $outArr["phoneNumber"] = SummaryHelper::formatForDisplay($this->phoneNumber); - $outArr["urssafNumber"] = SummaryHelper::formatForDisplay($this->urssafNumber); + $outArr["address"] = SummaryHelperV1::formatForDisplay($this->address); + $outArr["companyId"] = SummaryHelperV1::formatForDisplay($this->companyId); + $outArr["companySite"] = SummaryHelperV1::formatForDisplay($this->companySite); + $outArr["nafCode"] = SummaryHelperV1::formatForDisplay($this->nafCode); + $outArr["name"] = SummaryHelperV1::formatForDisplay($this->name); + $outArr["phoneNumber"] = SummaryHelperV1::formatForDisplay($this->phoneNumber); + $outArr["urssafNumber"] = SummaryHelperV1::formatForDisplay($this->urssafNumber); return $outArr; } @@ -86,13 +86,13 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["address"] = SummaryHelper::formatForDisplay($this->address); - $outArr["companyId"] = SummaryHelper::formatForDisplay($this->companyId); - $outArr["companySite"] = SummaryHelper::formatForDisplay($this->companySite); - $outArr["nafCode"] = SummaryHelper::formatForDisplay($this->nafCode); - $outArr["name"] = SummaryHelper::formatForDisplay($this->name); - $outArr["phoneNumber"] = SummaryHelper::formatForDisplay($this->phoneNumber); - $outArr["urssafNumber"] = SummaryHelper::formatForDisplay($this->urssafNumber); + $outArr["address"] = SummaryHelperV1::formatForDisplay($this->address); + $outArr["companyId"] = SummaryHelperV1::formatForDisplay($this->companyId); + $outArr["companySite"] = SummaryHelperV1::formatForDisplay($this->companySite); + $outArr["nafCode"] = SummaryHelperV1::formatForDisplay($this->nafCode); + $outArr["name"] = SummaryHelperV1::formatForDisplay($this->name); + $outArr["phoneNumber"] = SummaryHelperV1::formatForDisplay($this->phoneNumber); + $outArr["urssafNumber"] = SummaryHelperV1::formatForDisplay($this->urssafNumber); return $outArr; } /** @@ -119,6 +119,6 @@ public function toFieldList(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toFieldList()); + return SummaryHelperV1::cleanOutString($this->toFieldList()); } } diff --git a/src/Product/Fr/Payslip/PayslipV3Employment.php b/src/V1/Product/Fr/Payslip/PayslipV3Employment.php similarity index 66% rename from src/Product/Fr/Payslip/PayslipV3Employment.php rename to src/V1/Product/Fr/Payslip/PayslipV3Employment.php index 2ab159f3..3334b3b5 100644 --- a/src/Product/Fr/Payslip/PayslipV3Employment.php +++ b/src/V1/Product/Fr/Payslip/PayslipV3Employment.php @@ -1,10 +1,10 @@ category); - $outArr["coefficient"] = SummaryHelper::formatForDisplay($this->coefficient); - $outArr["collectiveAgreement"] = SummaryHelper::formatForDisplay($this->collectiveAgreement); - $outArr["jobTitle"] = SummaryHelper::formatForDisplay($this->jobTitle); - $outArr["positionLevel"] = SummaryHelper::formatForDisplay($this->positionLevel); - $outArr["seniorityDate"] = SummaryHelper::formatForDisplay($this->seniorityDate); - $outArr["startDate"] = SummaryHelper::formatForDisplay($this->startDate); + $outArr["category"] = SummaryHelperV1::formatForDisplay($this->category); + $outArr["coefficient"] = SummaryHelperV1::formatForDisplay($this->coefficient); + $outArr["collectiveAgreement"] = SummaryHelperV1::formatForDisplay($this->collectiveAgreement); + $outArr["jobTitle"] = SummaryHelperV1::formatForDisplay($this->jobTitle); + $outArr["positionLevel"] = SummaryHelperV1::formatForDisplay($this->positionLevel); + $outArr["seniorityDate"] = SummaryHelperV1::formatForDisplay($this->seniorityDate); + $outArr["startDate"] = SummaryHelperV1::formatForDisplay($this->startDate); return $outArr; } @@ -86,13 +86,13 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["category"] = SummaryHelper::formatForDisplay($this->category); - $outArr["coefficient"] = SummaryHelper::formatForDisplay($this->coefficient); - $outArr["collectiveAgreement"] = SummaryHelper::formatForDisplay($this->collectiveAgreement); - $outArr["jobTitle"] = SummaryHelper::formatForDisplay($this->jobTitle); - $outArr["positionLevel"] = SummaryHelper::formatForDisplay($this->positionLevel); - $outArr["seniorityDate"] = SummaryHelper::formatForDisplay($this->seniorityDate); - $outArr["startDate"] = SummaryHelper::formatForDisplay($this->startDate); + $outArr["category"] = SummaryHelperV1::formatForDisplay($this->category); + $outArr["coefficient"] = SummaryHelperV1::formatForDisplay($this->coefficient); + $outArr["collectiveAgreement"] = SummaryHelperV1::formatForDisplay($this->collectiveAgreement); + $outArr["jobTitle"] = SummaryHelperV1::formatForDisplay($this->jobTitle); + $outArr["positionLevel"] = SummaryHelperV1::formatForDisplay($this->positionLevel); + $outArr["seniorityDate"] = SummaryHelperV1::formatForDisplay($this->seniorityDate); + $outArr["startDate"] = SummaryHelperV1::formatForDisplay($this->startDate); return $outArr; } /** @@ -119,6 +119,6 @@ public function toFieldList(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toFieldList()); + return SummaryHelperV1::cleanOutString($this->toFieldList()); } } diff --git a/src/Product/Fr/Payslip/PayslipV3PaidTimeOff.php b/src/V1/Product/Fr/Payslip/PayslipV3PaidTimeOff.php similarity index 60% rename from src/Product/Fr/Payslip/PayslipV3PaidTimeOff.php rename to src/V1/Product/Fr/Payslip/PayslipV3PaidTimeOff.php index 25a7fe9c..ec833a74 100644 --- a/src/Product/Fr/Payslip/PayslipV3PaidTimeOff.php +++ b/src/V1/Product/Fr/Payslip/PayslipV3PaidTimeOff.php @@ -1,10 +1,10 @@ accrued); - $outArr["period"] = SummaryHelper::formatForDisplay($this->period, 6); - $outArr["ptoType"] = SummaryHelper::formatForDisplay($this->ptoType, 11); - $outArr["remaining"] = SummaryHelper::formatFloat($this->remaining); - $outArr["used"] = SummaryHelper::formatFloat($this->used); + $outArr["accrued"] = SummaryHelperV1::formatFloat($this->accrued); + $outArr["period"] = SummaryHelperV1::formatForDisplay($this->period, 6); + $outArr["ptoType"] = SummaryHelperV1::formatForDisplay($this->ptoType, 11); + $outArr["remaining"] = SummaryHelperV1::formatFloat($this->remaining); + $outArr["used"] = SummaryHelperV1::formatFloat($this->used); return $outArr; } @@ -77,11 +77,11 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["accrued"] = SummaryHelper::formatFloat($this->accrued); - $outArr["period"] = SummaryHelper::formatForDisplay($this->period); - $outArr["ptoType"] = SummaryHelper::formatForDisplay($this->ptoType); - $outArr["remaining"] = SummaryHelper::formatFloat($this->remaining); - $outArr["used"] = SummaryHelper::formatFloat($this->used); + $outArr["accrued"] = SummaryHelperV1::formatFloat($this->accrued); + $outArr["period"] = SummaryHelperV1::formatForDisplay($this->period); + $outArr["ptoType"] = SummaryHelperV1::formatForDisplay($this->ptoType); + $outArr["remaining"] = SummaryHelperV1::formatFloat($this->remaining); + $outArr["used"] = SummaryHelperV1::formatFloat($this->used); return $outArr; } /** @@ -93,12 +93,12 @@ public function toTableLine(): string { $printable = $this->tablePrintableValues(); $outStr = "| "; - $outStr .= SummaryHelper::padString($printable["accrued"], 9); - $outStr .= SummaryHelper::padString($printable["period"], 6); - $outStr .= SummaryHelper::padString($printable["ptoType"], 11); - $outStr .= SummaryHelper::padString($printable["remaining"], 9); - $outStr .= SummaryHelper::padString($printable["used"], 9); - return rtrim(SummaryHelper::cleanOutString($outStr)); + $outStr .= SummaryHelperV1::padString($printable["accrued"], 9); + $outStr .= SummaryHelperV1::padString($printable["period"], 6); + $outStr .= SummaryHelperV1::padString($printable["ptoType"], 11); + $outStr .= SummaryHelperV1::padString($printable["remaining"], 9); + $outStr .= SummaryHelperV1::padString($printable["used"], 9); + return rtrim(SummaryHelperV1::cleanOutString($outStr)); } /** @@ -106,6 +106,6 @@ public function toTableLine(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toTableLine()); + return SummaryHelperV1::cleanOutString($this->toTableLine()); } } diff --git a/src/Product/Fr/Payslip/PayslipV3PaidTimeOffs.php b/src/V1/Product/Fr/Payslip/PayslipV3PaidTimeOffs.php similarity index 97% rename from src/Product/Fr/Payslip/PayslipV3PaidTimeOffs.php rename to src/V1/Product/Fr/Payslip/PayslipV3PaidTimeOffs.php index 464ca86d..49c44c9e 100644 --- a/src/Product/Fr/Payslip/PayslipV3PaidTimeOffs.php +++ b/src/V1/Product/Fr/Payslip/PayslipV3PaidTimeOffs.php @@ -1,6 +1,6 @@ grossSalary); - $outArr["grossSalaryYtd"] = SummaryHelper::formatFloat($this->grossSalaryYtd); - $outArr["incomeTaxRate"] = SummaryHelper::formatFloat($this->incomeTaxRate); - $outArr["incomeTaxWithheld"] = SummaryHelper::formatFloat($this->incomeTaxWithheld); - $outArr["netPaid"] = SummaryHelper::formatFloat($this->netPaid); - $outArr["netPaidBeforeTax"] = SummaryHelper::formatFloat($this->netPaidBeforeTax); - $outArr["netTaxable"] = SummaryHelper::formatFloat($this->netTaxable); - $outArr["netTaxableYtd"] = SummaryHelper::formatFloat($this->netTaxableYtd); - $outArr["totalCostEmployer"] = SummaryHelper::formatFloat($this->totalCostEmployer); - $outArr["totalTaxesAndDeductions"] = SummaryHelper::formatFloat($this->totalTaxesAndDeductions); + $outArr["grossSalary"] = SummaryHelperV1::formatFloat($this->grossSalary); + $outArr["grossSalaryYtd"] = SummaryHelperV1::formatFloat($this->grossSalaryYtd); + $outArr["incomeTaxRate"] = SummaryHelperV1::formatFloat($this->incomeTaxRate); + $outArr["incomeTaxWithheld"] = SummaryHelperV1::formatFloat($this->incomeTaxWithheld); + $outArr["netPaid"] = SummaryHelperV1::formatFloat($this->netPaid); + $outArr["netPaidBeforeTax"] = SummaryHelperV1::formatFloat($this->netPaidBeforeTax); + $outArr["netTaxable"] = SummaryHelperV1::formatFloat($this->netTaxable); + $outArr["netTaxableYtd"] = SummaryHelperV1::formatFloat($this->netTaxableYtd); + $outArr["totalCostEmployer"] = SummaryHelperV1::formatFloat($this->totalCostEmployer); + $outArr["totalTaxesAndDeductions"] = SummaryHelperV1::formatFloat($this->totalTaxesAndDeductions); return $outArr; } @@ -114,16 +114,16 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["grossSalary"] = SummaryHelper::formatFloat($this->grossSalary); - $outArr["grossSalaryYtd"] = SummaryHelper::formatFloat($this->grossSalaryYtd); - $outArr["incomeTaxRate"] = SummaryHelper::formatFloat($this->incomeTaxRate); - $outArr["incomeTaxWithheld"] = SummaryHelper::formatFloat($this->incomeTaxWithheld); - $outArr["netPaid"] = SummaryHelper::formatFloat($this->netPaid); - $outArr["netPaidBeforeTax"] = SummaryHelper::formatFloat($this->netPaidBeforeTax); - $outArr["netTaxable"] = SummaryHelper::formatFloat($this->netTaxable); - $outArr["netTaxableYtd"] = SummaryHelper::formatFloat($this->netTaxableYtd); - $outArr["totalCostEmployer"] = SummaryHelper::formatFloat($this->totalCostEmployer); - $outArr["totalTaxesAndDeductions"] = SummaryHelper::formatFloat($this->totalTaxesAndDeductions); + $outArr["grossSalary"] = SummaryHelperV1::formatFloat($this->grossSalary); + $outArr["grossSalaryYtd"] = SummaryHelperV1::formatFloat($this->grossSalaryYtd); + $outArr["incomeTaxRate"] = SummaryHelperV1::formatFloat($this->incomeTaxRate); + $outArr["incomeTaxWithheld"] = SummaryHelperV1::formatFloat($this->incomeTaxWithheld); + $outArr["netPaid"] = SummaryHelperV1::formatFloat($this->netPaid); + $outArr["netPaidBeforeTax"] = SummaryHelperV1::formatFloat($this->netPaidBeforeTax); + $outArr["netTaxable"] = SummaryHelperV1::formatFloat($this->netTaxable); + $outArr["netTaxableYtd"] = SummaryHelperV1::formatFloat($this->netTaxableYtd); + $outArr["totalCostEmployer"] = SummaryHelperV1::formatFloat($this->totalCostEmployer); + $outArr["totalTaxesAndDeductions"] = SummaryHelperV1::formatFloat($this->totalTaxesAndDeductions); return $outArr; } /** @@ -153,6 +153,6 @@ public function toFieldList(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toFieldList()); + return SummaryHelperV1::cleanOutString($this->toFieldList()); } } diff --git a/src/Product/Fr/Payslip/PayslipV3PayPeriod.php b/src/V1/Product/Fr/Payslip/PayslipV3PayPeriod.php similarity index 69% rename from src/Product/Fr/Payslip/PayslipV3PayPeriod.php rename to src/V1/Product/Fr/Payslip/PayslipV3PayPeriod.php index 19e9742d..1a6f6f95 100644 --- a/src/Product/Fr/Payslip/PayslipV3PayPeriod.php +++ b/src/V1/Product/Fr/Payslip/PayslipV3PayPeriod.php @@ -1,10 +1,10 @@ endDate); - $outArr["month"] = SummaryHelper::formatForDisplay($this->month); - $outArr["paymentDate"] = SummaryHelper::formatForDisplay($this->paymentDate); - $outArr["startDate"] = SummaryHelper::formatForDisplay($this->startDate); - $outArr["year"] = SummaryHelper::formatForDisplay($this->year); + $outArr["endDate"] = SummaryHelperV1::formatForDisplay($this->endDate); + $outArr["month"] = SummaryHelperV1::formatForDisplay($this->month); + $outArr["paymentDate"] = SummaryHelperV1::formatForDisplay($this->paymentDate); + $outArr["startDate"] = SummaryHelperV1::formatForDisplay($this->startDate); + $outArr["year"] = SummaryHelperV1::formatForDisplay($this->year); return $outArr; } @@ -74,11 +74,11 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["endDate"] = SummaryHelper::formatForDisplay($this->endDate); - $outArr["month"] = SummaryHelper::formatForDisplay($this->month); - $outArr["paymentDate"] = SummaryHelper::formatForDisplay($this->paymentDate); - $outArr["startDate"] = SummaryHelper::formatForDisplay($this->startDate); - $outArr["year"] = SummaryHelper::formatForDisplay($this->year); + $outArr["endDate"] = SummaryHelperV1::formatForDisplay($this->endDate); + $outArr["month"] = SummaryHelperV1::formatForDisplay($this->month); + $outArr["paymentDate"] = SummaryHelperV1::formatForDisplay($this->paymentDate); + $outArr["startDate"] = SummaryHelperV1::formatForDisplay($this->startDate); + $outArr["year"] = SummaryHelperV1::formatForDisplay($this->year); return $outArr; } /** @@ -103,6 +103,6 @@ public function toFieldList(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toFieldList()); + return SummaryHelperV1::cleanOutString($this->toFieldList()); } } diff --git a/src/Product/Fr/Payslip/PayslipV3SalaryDetail.php b/src/V1/Product/Fr/Payslip/PayslipV3SalaryDetail.php similarity index 61% rename from src/Product/Fr/Payslip/PayslipV3SalaryDetail.php rename to src/V1/Product/Fr/Payslip/PayslipV3SalaryDetail.php index 75c93f68..afff2656 100644 --- a/src/Product/Fr/Payslip/PayslipV3SalaryDetail.php +++ b/src/V1/Product/Fr/Payslip/PayslipV3SalaryDetail.php @@ -1,10 +1,10 @@ amount); - $outArr["base"] = SummaryHelper::formatFloat($this->base); - $outArr["description"] = SummaryHelper::formatForDisplay($this->description, 36); - $outArr["number"] = SummaryHelper::formatFloat($this->number); - $outArr["rate"] = SummaryHelper::formatFloat($this->rate); + $outArr["amount"] = SummaryHelperV1::formatFloat($this->amount); + $outArr["base"] = SummaryHelperV1::formatFloat($this->base); + $outArr["description"] = SummaryHelperV1::formatForDisplay($this->description, 36); + $outArr["number"] = SummaryHelperV1::formatFloat($this->number); + $outArr["rate"] = SummaryHelperV1::formatFloat($this->rate); return $outArr; } @@ -78,11 +78,11 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["amount"] = SummaryHelper::formatFloat($this->amount); - $outArr["base"] = SummaryHelper::formatFloat($this->base); - $outArr["description"] = SummaryHelper::formatForDisplay($this->description); - $outArr["number"] = SummaryHelper::formatFloat($this->number); - $outArr["rate"] = SummaryHelper::formatFloat($this->rate); + $outArr["amount"] = SummaryHelperV1::formatFloat($this->amount); + $outArr["base"] = SummaryHelperV1::formatFloat($this->base); + $outArr["description"] = SummaryHelperV1::formatForDisplay($this->description); + $outArr["number"] = SummaryHelperV1::formatFloat($this->number); + $outArr["rate"] = SummaryHelperV1::formatFloat($this->rate); return $outArr; } /** @@ -94,12 +94,12 @@ public function toTableLine(): string { $printable = $this->tablePrintableValues(); $outStr = "| "; - $outStr .= SummaryHelper::padString($printable["amount"], 12); - $outStr .= SummaryHelper::padString($printable["base"], 9); - $outStr .= SummaryHelper::padString($printable["description"], 36); - $outStr .= SummaryHelper::padString($printable["number"], 6); - $outStr .= SummaryHelper::padString($printable["rate"], 9); - return rtrim(SummaryHelper::cleanOutString($outStr)); + $outStr .= SummaryHelperV1::padString($printable["amount"], 12); + $outStr .= SummaryHelperV1::padString($printable["base"], 9); + $outStr .= SummaryHelperV1::padString($printable["description"], 36); + $outStr .= SummaryHelperV1::padString($printable["number"], 6); + $outStr .= SummaryHelperV1::padString($printable["rate"], 9); + return rtrim(SummaryHelperV1::cleanOutString($outStr)); } /** @@ -107,6 +107,6 @@ public function toTableLine(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toTableLine()); + return SummaryHelperV1::cleanOutString($this->toTableLine()); } } diff --git a/src/Product/Fr/Payslip/PayslipV3SalaryDetails.php b/src/V1/Product/Fr/Payslip/PayslipV3SalaryDetails.php similarity index 97% rename from src/Product/Fr/Payslip/PayslipV3SalaryDetails.php rename to src/V1/Product/Fr/Payslip/PayslipV3SalaryDetails.php index 2a8dd8da..074332b3 100644 --- a/src/Product/Fr/Payslip/PayslipV3SalaryDetails.php +++ b/src/V1/Product/Fr/Payslip/PayslipV3SalaryDetails.php @@ -1,6 +1,6 @@ pages[] = new Page(IndianPassportV1Document::class, $page); - } catch (MindeeUnsetException $ignored) { + } catch (MindeeUnsetException) { } } } diff --git a/src/Product/Ind/IndianPassport/IndianPassportV1Document.php b/src/V1/Product/Ind/IndianPassport/IndianPassportV1Document.php similarity index 96% rename from src/Product/Ind/IndianPassport/IndianPassportV1Document.php rename to src/V1/Product/Ind/IndianPassport/IndianPassportV1Document.php index 0de52578..cd7677e2 100644 --- a/src/Product/Ind/IndianPassport/IndianPassportV1Document.php +++ b/src/V1/Product/Ind/IndianPassport/IndianPassportV1Document.php @@ -1,13 +1,13 @@ address3 :File Number: $this->fileNumber "; - return SummaryHelper::cleanOutString($outStr); + return SummaryHelperV1::cleanOutString($outStr); } } diff --git a/src/Product/InternationalId/InternationalIdV2.php b/src/V1/Product/InternationalId/InternationalIdV2.php similarity index 84% rename from src/Product/InternationalId/InternationalIdV2.php rename to src/V1/Product/InternationalId/InternationalIdV2.php index 361ee315..71628ffc 100644 --- a/src/Product/InternationalId/InternationalIdV2.php +++ b/src/V1/Product/InternationalId/InternationalIdV2.php @@ -2,11 +2,11 @@ /** International ID V2. */ -namespace Mindee\Product\InternationalId; +namespace Mindee\V1\Product\InternationalId; -use Mindee\Parsing\Common\Inference; -use Mindee\Parsing\Common\Page; use Mindee\Error\MindeeUnsetException; +use Mindee\V1\Parsing\Common\Inference; +use Mindee\V1\Parsing\Common\Page; /** * International ID API version 2 inference prediction. @@ -33,7 +33,7 @@ public function __construct(array $rawPrediction) foreach ($rawPrediction['pages'] as $page) { try { $this->pages[] = new Page(InternationalIdV2Document::class, $page); - } catch (MindeeUnsetException $ignored) { + } catch (MindeeUnsetException) { } } } diff --git a/src/Product/InternationalId/InternationalIdV2Document.php b/src/V1/Product/InternationalId/InternationalIdV2Document.php similarity index 95% rename from src/Product/InternationalId/InternationalIdV2Document.php rename to src/V1/Product/InternationalId/InternationalIdV2Document.php index 238f52df..e9ca6cf7 100644 --- a/src/Product/InternationalId/InternationalIdV2Document.php +++ b/src/V1/Product/InternationalId/InternationalIdV2Document.php @@ -1,13 +1,13 @@ mrzLine2 :MRZ Line 3: $this->mrzLine3 "; - return SummaryHelper::cleanOutString($outStr); + return SummaryHelperV1::cleanOutString($outStr); } } diff --git a/src/Product/Invoice/InvoiceV4.php b/src/V1/Product/Invoice/InvoiceV4.php similarity index 84% rename from src/Product/Invoice/InvoiceV4.php rename to src/V1/Product/Invoice/InvoiceV4.php index dcdb975d..6a71817d 100644 --- a/src/Product/Invoice/InvoiceV4.php +++ b/src/V1/Product/Invoice/InvoiceV4.php @@ -2,11 +2,11 @@ /** Invoice V4. */ -namespace Mindee\Product\Invoice; +namespace Mindee\V1\Product\Invoice; -use Mindee\Parsing\Common\Inference; -use Mindee\Parsing\Common\Page; use Mindee\Error\MindeeUnsetException; +use Mindee\V1\Parsing\Common\Inference; +use Mindee\V1\Parsing\Common\Page; /** * Invoice API version 4 inference prediction. @@ -33,7 +33,7 @@ public function __construct(array $rawPrediction) foreach ($rawPrediction['pages'] as $page) { try { $this->pages[] = new Page(InvoiceV4Document::class, $page); - } catch (MindeeUnsetException $ignored) { + } catch (MindeeUnsetException) { } } } diff --git a/src/Product/Invoice/InvoiceV4Document.php b/src/V1/Product/Invoice/InvoiceV4Document.php similarity index 95% rename from src/Product/Invoice/InvoiceV4Document.php rename to src/V1/Product/Invoice/InvoiceV4Document.php index c485aa61..d8fad0e8 100644 --- a/src/Product/Invoice/InvoiceV4Document.php +++ b/src/V1/Product/Invoice/InvoiceV4Document.php @@ -1,19 +1,19 @@ category :Line Items: $lineItemsSummary "; - return SummaryHelper::cleanOutString($outStr); + return SummaryHelperV1::cleanOutString($outStr); } } diff --git a/src/Product/Invoice/InvoiceV4LineItem.php b/src/V1/Product/Invoice/InvoiceV4LineItem.php similarity index 55% rename from src/Product/Invoice/InvoiceV4LineItem.php rename to src/V1/Product/Invoice/InvoiceV4LineItem.php index 461fe49e..906d85e8 100644 --- a/src/Product/Invoice/InvoiceV4LineItem.php +++ b/src/V1/Product/Invoice/InvoiceV4LineItem.php @@ -1,10 +1,10 @@ description, 36); - $outArr["productCode"] = SummaryHelper::formatForDisplay($this->productCode); - $outArr["quantity"] = SummaryHelper::formatFloat($this->quantity); - $outArr["taxAmount"] = SummaryHelper::formatFloat($this->taxAmount); - $outArr["taxRate"] = SummaryHelper::formatFloat($this->taxRate); - $outArr["totalAmount"] = SummaryHelper::formatFloat($this->totalAmount); - $outArr["unitMeasure"] = SummaryHelper::formatForDisplay($this->unitMeasure); - $outArr["unitPrice"] = SummaryHelper::formatFloat($this->unitPrice); + $outArr["description"] = SummaryHelperV1::formatForDisplay($this->description, 36); + $outArr["productCode"] = SummaryHelperV1::formatForDisplay($this->productCode); + $outArr["quantity"] = SummaryHelperV1::formatFloat($this->quantity); + $outArr["taxAmount"] = SummaryHelperV1::formatFloat($this->taxAmount); + $outArr["taxRate"] = SummaryHelperV1::formatFloat($this->taxRate); + $outArr["totalAmount"] = SummaryHelperV1::formatFloat($this->totalAmount); + $outArr["unitMeasure"] = SummaryHelperV1::formatForDisplay($this->unitMeasure); + $outArr["unitPrice"] = SummaryHelperV1::formatFloat($this->unitPrice); return $outArr; } @@ -97,14 +97,14 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["description"] = SummaryHelper::formatForDisplay($this->description); - $outArr["productCode"] = SummaryHelper::formatForDisplay($this->productCode); - $outArr["quantity"] = SummaryHelper::formatFloat($this->quantity); - $outArr["taxAmount"] = SummaryHelper::formatFloat($this->taxAmount); - $outArr["taxRate"] = SummaryHelper::formatFloat($this->taxRate); - $outArr["totalAmount"] = SummaryHelper::formatFloat($this->totalAmount); - $outArr["unitMeasure"] = SummaryHelper::formatForDisplay($this->unitMeasure); - $outArr["unitPrice"] = SummaryHelper::formatFloat($this->unitPrice); + $outArr["description"] = SummaryHelperV1::formatForDisplay($this->description); + $outArr["productCode"] = SummaryHelperV1::formatForDisplay($this->productCode); + $outArr["quantity"] = SummaryHelperV1::formatFloat($this->quantity); + $outArr["taxAmount"] = SummaryHelperV1::formatFloat($this->taxAmount); + $outArr["taxRate"] = SummaryHelperV1::formatFloat($this->taxRate); + $outArr["totalAmount"] = SummaryHelperV1::formatFloat($this->totalAmount); + $outArr["unitMeasure"] = SummaryHelperV1::formatForDisplay($this->unitMeasure); + $outArr["unitPrice"] = SummaryHelperV1::formatFloat($this->unitPrice); return $outArr; } /** @@ -116,15 +116,15 @@ public function toTableLine(): string { $printable = $this->tablePrintableValues(); $outStr = "| "; - $outStr .= SummaryHelper::padString($printable["description"], 36); - $outStr .= SummaryHelper::padString($printable["productCode"], 12); - $outStr .= SummaryHelper::padString($printable["quantity"], 8); - $outStr .= SummaryHelper::padString($printable["taxAmount"], 10); - $outStr .= SummaryHelper::padString($printable["taxRate"], 12); - $outStr .= SummaryHelper::padString($printable["totalAmount"], 12); - $outStr .= SummaryHelper::padString($printable["unitMeasure"], 15); - $outStr .= SummaryHelper::padString($printable["unitPrice"], 10); - return rtrim(SummaryHelper::cleanOutString($outStr)); + $outStr .= SummaryHelperV1::padString($printable["description"], 36); + $outStr .= SummaryHelperV1::padString($printable["productCode"], 12); + $outStr .= SummaryHelperV1::padString($printable["quantity"], 8); + $outStr .= SummaryHelperV1::padString($printable["taxAmount"], 10); + $outStr .= SummaryHelperV1::padString($printable["taxRate"], 12); + $outStr .= SummaryHelperV1::padString($printable["totalAmount"], 12); + $outStr .= SummaryHelperV1::padString($printable["unitMeasure"], 15); + $outStr .= SummaryHelperV1::padString($printable["unitPrice"], 10); + return rtrim(SummaryHelperV1::cleanOutString($outStr)); } /** @@ -132,6 +132,6 @@ public function toTableLine(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toTableLine()); + return SummaryHelperV1::cleanOutString($this->toTableLine()); } } diff --git a/src/Product/Invoice/InvoiceV4LineItems.php b/src/V1/Product/Invoice/InvoiceV4LineItems.php similarity index 98% rename from src/Product/Invoice/InvoiceV4LineItems.php rename to src/V1/Product/Invoice/InvoiceV4LineItems.php index e3e399bc..fe934b74 100644 --- a/src/Product/Invoice/InvoiceV4LineItems.php +++ b/src/V1/Product/Invoice/InvoiceV4LineItems.php @@ -1,6 +1,6 @@ pages[] = new Page(InvoiceSplitterV1Document::class, $page); - } catch (MindeeUnsetException $ignored) { + } catch (MindeeUnsetException) { } } } diff --git a/src/Product/InvoiceSplitter/InvoiceSplitterV1Document.php b/src/V1/Product/InvoiceSplitter/InvoiceSplitterV1Document.php similarity index 87% rename from src/Product/InvoiceSplitter/InvoiceSplitterV1Document.php rename to src/V1/Product/InvoiceSplitter/InvoiceSplitterV1Document.php index dccce3ad..e2148b58 100644 --- a/src/Product/InvoiceSplitter/InvoiceSplitterV1Document.php +++ b/src/V1/Product/InvoiceSplitter/InvoiceSplitterV1Document.php @@ -1,10 +1,10 @@ tablePrintableValues(); $outStr = "| "; - $outStr .= SummaryHelper::padString($printable["pageIndexes"], 72); - return rtrim(SummaryHelper::cleanOutString($outStr)); + $outStr .= SummaryHelperV1::padString($printable["pageIndexes"], 72); + return rtrim(SummaryHelperV1::cleanOutString($outStr)); } /** @@ -71,6 +71,6 @@ public function toTableLine(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toTableLine()); + return SummaryHelperV1::cleanOutString($this->toTableLine()); } } diff --git a/src/Product/InvoiceSplitter/InvoiceSplitterV1InvoicePageGroups.php b/src/V1/Product/InvoiceSplitter/InvoiceSplitterV1InvoicePageGroups.php similarity index 97% rename from src/Product/InvoiceSplitter/InvoiceSplitterV1InvoicePageGroups.php rename to src/V1/Product/InvoiceSplitter/InvoiceSplitterV1InvoicePageGroups.php index ea90083b..98c19a51 100644 --- a/src/Product/InvoiceSplitter/InvoiceSplitterV1InvoicePageGroups.php +++ b/src/V1/Product/InvoiceSplitter/InvoiceSplitterV1InvoicePageGroups.php @@ -1,6 +1,6 @@ pages[] = new Page(MultiReceiptsDetectorV1Document::class, $page); - } catch (MindeeUnsetException $ignored) { + } catch (MindeeUnsetException) { } } } diff --git a/src/Product/MultiReceiptsDetector/MultiReceiptsDetectorV1Document.php b/src/V1/Product/MultiReceiptsDetector/MultiReceiptsDetectorV1Document.php similarity index 83% rename from src/Product/MultiReceiptsDetector/MultiReceiptsDetectorV1Document.php rename to src/V1/Product/MultiReceiptsDetector/MultiReceiptsDetectorV1Document.php index 9df25cd1..73ad238c 100644 --- a/src/Product/MultiReceiptsDetector/MultiReceiptsDetectorV1Document.php +++ b/src/V1/Product/MultiReceiptsDetector/MultiReceiptsDetectorV1Document.php @@ -1,11 +1,11 @@ pages[] = new Page(NutritionFactsLabelV1Document::class, $page); - } catch (MindeeUnsetException $ignored) { + } catch (MindeeUnsetException) { } } } diff --git a/src/Product/NutritionFactsLabel/NutritionFactsLabelV1AddedSugar.php b/src/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1AddedSugar.php similarity index 75% rename from src/Product/NutritionFactsLabel/NutritionFactsLabelV1AddedSugar.php rename to src/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1AddedSugar.php index d8b0a3d2..2c24e186 100644 --- a/src/Product/NutritionFactsLabel/NutritionFactsLabelV1AddedSugar.php +++ b/src/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1AddedSugar.php @@ -1,10 +1,10 @@ dailyValue); - $outArr["per100G"] = SummaryHelper::formatFloat($this->per100G); - $outArr["perServing"] = SummaryHelper::formatFloat($this->perServing); + $outArr["dailyValue"] = SummaryHelperV1::formatFloat($this->dailyValue); + $outArr["per100G"] = SummaryHelperV1::formatFloat($this->per100G); + $outArr["perServing"] = SummaryHelperV1::formatFloat($this->perServing); return $outArr; } @@ -65,9 +65,9 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["dailyValue"] = SummaryHelper::formatFloat($this->dailyValue); - $outArr["per100G"] = SummaryHelper::formatFloat($this->per100G); - $outArr["perServing"] = SummaryHelper::formatFloat($this->perServing); + $outArr["dailyValue"] = SummaryHelperV1::formatFloat($this->dailyValue); + $outArr["per100G"] = SummaryHelperV1::formatFloat($this->per100G); + $outArr["perServing"] = SummaryHelperV1::formatFloat($this->perServing); return $outArr; } /** @@ -90,6 +90,6 @@ public function toFieldList(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toFieldList()); + return SummaryHelperV1::cleanOutString($this->toFieldList()); } } diff --git a/src/Product/NutritionFactsLabel/NutritionFactsLabelV1Calorie.php b/src/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1Calorie.php similarity index 75% rename from src/Product/NutritionFactsLabel/NutritionFactsLabelV1Calorie.php rename to src/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1Calorie.php index 48dc38b3..407deef2 100644 --- a/src/Product/NutritionFactsLabel/NutritionFactsLabelV1Calorie.php +++ b/src/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1Calorie.php @@ -1,10 +1,10 @@ dailyValue); - $outArr["per100G"] = SummaryHelper::formatFloat($this->per100G); - $outArr["perServing"] = SummaryHelper::formatFloat($this->perServing); + $outArr["dailyValue"] = SummaryHelperV1::formatFloat($this->dailyValue); + $outArr["per100G"] = SummaryHelperV1::formatFloat($this->per100G); + $outArr["perServing"] = SummaryHelperV1::formatFloat($this->perServing); return $outArr; } @@ -65,9 +65,9 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["dailyValue"] = SummaryHelper::formatFloat($this->dailyValue); - $outArr["per100G"] = SummaryHelper::formatFloat($this->per100G); - $outArr["perServing"] = SummaryHelper::formatFloat($this->perServing); + $outArr["dailyValue"] = SummaryHelperV1::formatFloat($this->dailyValue); + $outArr["per100G"] = SummaryHelperV1::formatFloat($this->per100G); + $outArr["perServing"] = SummaryHelperV1::formatFloat($this->perServing); return $outArr; } /** @@ -90,6 +90,6 @@ public function toFieldList(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toFieldList()); + return SummaryHelperV1::cleanOutString($this->toFieldList()); } } diff --git a/src/Product/NutritionFactsLabel/NutritionFactsLabelV1Cholesterol.php b/src/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1Cholesterol.php similarity index 75% rename from src/Product/NutritionFactsLabel/NutritionFactsLabelV1Cholesterol.php rename to src/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1Cholesterol.php index 593ef85f..e4b77c9d 100644 --- a/src/Product/NutritionFactsLabel/NutritionFactsLabelV1Cholesterol.php +++ b/src/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1Cholesterol.php @@ -1,10 +1,10 @@ dailyValue); - $outArr["per100G"] = SummaryHelper::formatFloat($this->per100G); - $outArr["perServing"] = SummaryHelper::formatFloat($this->perServing); + $outArr["dailyValue"] = SummaryHelperV1::formatFloat($this->dailyValue); + $outArr["per100G"] = SummaryHelperV1::formatFloat($this->per100G); + $outArr["perServing"] = SummaryHelperV1::formatFloat($this->perServing); return $outArr; } @@ -65,9 +65,9 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["dailyValue"] = SummaryHelper::formatFloat($this->dailyValue); - $outArr["per100G"] = SummaryHelper::formatFloat($this->per100G); - $outArr["perServing"] = SummaryHelper::formatFloat($this->perServing); + $outArr["dailyValue"] = SummaryHelperV1::formatFloat($this->dailyValue); + $outArr["per100G"] = SummaryHelperV1::formatFloat($this->per100G); + $outArr["perServing"] = SummaryHelperV1::formatFloat($this->perServing); return $outArr; } /** @@ -90,6 +90,6 @@ public function toFieldList(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toFieldList()); + return SummaryHelperV1::cleanOutString($this->toFieldList()); } } diff --git a/src/Product/NutritionFactsLabel/NutritionFactsLabelV1DietaryFiber.php b/src/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1DietaryFiber.php similarity index 75% rename from src/Product/NutritionFactsLabel/NutritionFactsLabelV1DietaryFiber.php rename to src/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1DietaryFiber.php index bcba21c4..4287dbb3 100644 --- a/src/Product/NutritionFactsLabel/NutritionFactsLabelV1DietaryFiber.php +++ b/src/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1DietaryFiber.php @@ -1,10 +1,10 @@ dailyValue); - $outArr["per100G"] = SummaryHelper::formatFloat($this->per100G); - $outArr["perServing"] = SummaryHelper::formatFloat($this->perServing); + $outArr["dailyValue"] = SummaryHelperV1::formatFloat($this->dailyValue); + $outArr["per100G"] = SummaryHelperV1::formatFloat($this->per100G); + $outArr["perServing"] = SummaryHelperV1::formatFloat($this->perServing); return $outArr; } @@ -65,9 +65,9 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["dailyValue"] = SummaryHelper::formatFloat($this->dailyValue); - $outArr["per100G"] = SummaryHelper::formatFloat($this->per100G); - $outArr["perServing"] = SummaryHelper::formatFloat($this->perServing); + $outArr["dailyValue"] = SummaryHelperV1::formatFloat($this->dailyValue); + $outArr["per100G"] = SummaryHelperV1::formatFloat($this->per100G); + $outArr["perServing"] = SummaryHelperV1::formatFloat($this->perServing); return $outArr; } /** @@ -90,6 +90,6 @@ public function toFieldList(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toFieldList()); + return SummaryHelperV1::cleanOutString($this->toFieldList()); } } diff --git a/src/Product/NutritionFactsLabel/NutritionFactsLabelV1Document.php b/src/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1Document.php similarity index 97% rename from src/Product/NutritionFactsLabel/NutritionFactsLabelV1Document.php rename to src/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1Document.php index 4059714e..94c9e036 100644 --- a/src/Product/NutritionFactsLabel/NutritionFactsLabelV1Document.php +++ b/src/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1Document.php @@ -1,11 +1,11 @@ dailyValue); - $outArr["name"] = SummaryHelper::formatForDisplay($this->name, 20); - $outArr["per100G"] = SummaryHelper::formatFloat($this->per100G); - $outArr["perServing"] = SummaryHelper::formatFloat($this->perServing); - $outArr["unit"] = SummaryHelper::formatForDisplay($this->unit); + $outArr["dailyValue"] = SummaryHelperV1::formatFloat($this->dailyValue); + $outArr["name"] = SummaryHelperV1::formatForDisplay($this->name, 20); + $outArr["per100G"] = SummaryHelperV1::formatFloat($this->per100G); + $outArr["perServing"] = SummaryHelperV1::formatFloat($this->perServing); + $outArr["unit"] = SummaryHelperV1::formatForDisplay($this->unit); return $outArr; } @@ -77,11 +77,11 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["dailyValue"] = SummaryHelper::formatFloat($this->dailyValue); - $outArr["name"] = SummaryHelper::formatForDisplay($this->name); - $outArr["per100G"] = SummaryHelper::formatFloat($this->per100G); - $outArr["perServing"] = SummaryHelper::formatFloat($this->perServing); - $outArr["unit"] = SummaryHelper::formatForDisplay($this->unit); + $outArr["dailyValue"] = SummaryHelperV1::formatFloat($this->dailyValue); + $outArr["name"] = SummaryHelperV1::formatForDisplay($this->name); + $outArr["per100G"] = SummaryHelperV1::formatFloat($this->per100G); + $outArr["perServing"] = SummaryHelperV1::formatFloat($this->perServing); + $outArr["unit"] = SummaryHelperV1::formatForDisplay($this->unit); return $outArr; } /** @@ -93,12 +93,12 @@ public function toTableLine(): string { $printable = $this->tablePrintableValues(); $outStr = "| "; - $outStr .= SummaryHelper::padString($printable["dailyValue"], 11); - $outStr .= SummaryHelper::padString($printable["name"], 20); - $outStr .= SummaryHelper::padString($printable["per100G"], 8); - $outStr .= SummaryHelper::padString($printable["perServing"], 11); - $outStr .= SummaryHelper::padString($printable["unit"], 4); - return rtrim(SummaryHelper::cleanOutString($outStr)); + $outStr .= SummaryHelperV1::padString($printable["dailyValue"], 11); + $outStr .= SummaryHelperV1::padString($printable["name"], 20); + $outStr .= SummaryHelperV1::padString($printable["per100G"], 8); + $outStr .= SummaryHelperV1::padString($printable["perServing"], 11); + $outStr .= SummaryHelperV1::padString($printable["unit"], 4); + return rtrim(SummaryHelperV1::cleanOutString($outStr)); } /** @@ -106,6 +106,6 @@ public function toTableLine(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toTableLine()); + return SummaryHelperV1::cleanOutString($this->toTableLine()); } } diff --git a/src/Product/NutritionFactsLabel/NutritionFactsLabelV1Nutrients.php b/src/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1Nutrients.php similarity index 97% rename from src/Product/NutritionFactsLabel/NutritionFactsLabelV1Nutrients.php rename to src/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1Nutrients.php index 17ae8072..657adba0 100644 --- a/src/Product/NutritionFactsLabel/NutritionFactsLabelV1Nutrients.php +++ b/src/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1Nutrients.php @@ -1,6 +1,6 @@ dailyValue); - $outArr["per100G"] = SummaryHelper::formatFloat($this->per100G); - $outArr["perServing"] = SummaryHelper::formatFloat($this->perServing); + $outArr["dailyValue"] = SummaryHelperV1::formatFloat($this->dailyValue); + $outArr["per100G"] = SummaryHelperV1::formatFloat($this->per100G); + $outArr["perServing"] = SummaryHelperV1::formatFloat($this->perServing); return $outArr; } @@ -65,9 +65,9 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["dailyValue"] = SummaryHelper::formatFloat($this->dailyValue); - $outArr["per100G"] = SummaryHelper::formatFloat($this->per100G); - $outArr["perServing"] = SummaryHelper::formatFloat($this->perServing); + $outArr["dailyValue"] = SummaryHelperV1::formatFloat($this->dailyValue); + $outArr["per100G"] = SummaryHelperV1::formatFloat($this->per100G); + $outArr["perServing"] = SummaryHelperV1::formatFloat($this->perServing); return $outArr; } /** @@ -90,6 +90,6 @@ public function toFieldList(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toFieldList()); + return SummaryHelperV1::cleanOutString($this->toFieldList()); } } diff --git a/src/Product/NutritionFactsLabel/NutritionFactsLabelV1SaturatedFat.php b/src/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1SaturatedFat.php similarity index 75% rename from src/Product/NutritionFactsLabel/NutritionFactsLabelV1SaturatedFat.php rename to src/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1SaturatedFat.php index 25517a74..f2d757f4 100644 --- a/src/Product/NutritionFactsLabel/NutritionFactsLabelV1SaturatedFat.php +++ b/src/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1SaturatedFat.php @@ -1,10 +1,10 @@ dailyValue); - $outArr["per100G"] = SummaryHelper::formatFloat($this->per100G); - $outArr["perServing"] = SummaryHelper::formatFloat($this->perServing); + $outArr["dailyValue"] = SummaryHelperV1::formatFloat($this->dailyValue); + $outArr["per100G"] = SummaryHelperV1::formatFloat($this->per100G); + $outArr["perServing"] = SummaryHelperV1::formatFloat($this->perServing); return $outArr; } @@ -65,9 +65,9 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["dailyValue"] = SummaryHelper::formatFloat($this->dailyValue); - $outArr["per100G"] = SummaryHelper::formatFloat($this->per100G); - $outArr["perServing"] = SummaryHelper::formatFloat($this->perServing); + $outArr["dailyValue"] = SummaryHelperV1::formatFloat($this->dailyValue); + $outArr["per100G"] = SummaryHelperV1::formatFloat($this->per100G); + $outArr["perServing"] = SummaryHelperV1::formatFloat($this->perServing); return $outArr; } /** @@ -90,6 +90,6 @@ public function toFieldList(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toFieldList()); + return SummaryHelperV1::cleanOutString($this->toFieldList()); } } diff --git a/src/Product/NutritionFactsLabel/NutritionFactsLabelV1ServingSize.php b/src/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1ServingSize.php similarity index 76% rename from src/Product/NutritionFactsLabel/NutritionFactsLabelV1ServingSize.php rename to src/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1ServingSize.php index 901d9fe5..5ac392cf 100644 --- a/src/Product/NutritionFactsLabel/NutritionFactsLabelV1ServingSize.php +++ b/src/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1ServingSize.php @@ -1,10 +1,10 @@ amount); - $outArr["unit"] = SummaryHelper::formatForDisplay($this->unit); + $outArr["amount"] = SummaryHelperV1::formatFloat($this->amount); + $outArr["unit"] = SummaryHelperV1::formatForDisplay($this->unit); return $outArr; } @@ -57,8 +57,8 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["amount"] = SummaryHelper::formatFloat($this->amount); - $outArr["unit"] = SummaryHelper::formatForDisplay($this->unit); + $outArr["amount"] = SummaryHelperV1::formatFloat($this->amount); + $outArr["unit"] = SummaryHelperV1::formatForDisplay($this->unit); return $outArr; } /** @@ -80,6 +80,6 @@ public function toFieldList(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toFieldList()); + return SummaryHelperV1::cleanOutString($this->toFieldList()); } } diff --git a/src/Product/NutritionFactsLabel/NutritionFactsLabelV1Sodium.php b/src/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1Sodium.php similarity index 73% rename from src/Product/NutritionFactsLabel/NutritionFactsLabelV1Sodium.php rename to src/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1Sodium.php index f7d897d2..5df61a13 100644 --- a/src/Product/NutritionFactsLabel/NutritionFactsLabelV1Sodium.php +++ b/src/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1Sodium.php @@ -1,10 +1,10 @@ dailyValue); - $outArr["per100G"] = SummaryHelper::formatFloat($this->per100G); - $outArr["perServing"] = SummaryHelper::formatFloat($this->perServing); - $outArr["unit"] = SummaryHelper::formatForDisplay($this->unit); + $outArr["dailyValue"] = SummaryHelperV1::formatFloat($this->dailyValue); + $outArr["per100G"] = SummaryHelperV1::formatFloat($this->per100G); + $outArr["perServing"] = SummaryHelperV1::formatFloat($this->perServing); + $outArr["unit"] = SummaryHelperV1::formatForDisplay($this->unit); return $outArr; } @@ -71,10 +71,10 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["dailyValue"] = SummaryHelper::formatFloat($this->dailyValue); - $outArr["per100G"] = SummaryHelper::formatFloat($this->per100G); - $outArr["perServing"] = SummaryHelper::formatFloat($this->perServing); - $outArr["unit"] = SummaryHelper::formatForDisplay($this->unit); + $outArr["dailyValue"] = SummaryHelperV1::formatFloat($this->dailyValue); + $outArr["per100G"] = SummaryHelperV1::formatFloat($this->per100G); + $outArr["perServing"] = SummaryHelperV1::formatFloat($this->perServing); + $outArr["unit"] = SummaryHelperV1::formatForDisplay($this->unit); return $outArr; } /** @@ -98,6 +98,6 @@ public function toFieldList(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toFieldList()); + return SummaryHelperV1::cleanOutString($this->toFieldList()); } } diff --git a/src/Product/NutritionFactsLabel/NutritionFactsLabelV1TotalCarbohydrate.php b/src/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1TotalCarbohydrate.php similarity index 75% rename from src/Product/NutritionFactsLabel/NutritionFactsLabelV1TotalCarbohydrate.php rename to src/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1TotalCarbohydrate.php index 51de30f7..e96e1b1e 100644 --- a/src/Product/NutritionFactsLabel/NutritionFactsLabelV1TotalCarbohydrate.php +++ b/src/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1TotalCarbohydrate.php @@ -1,10 +1,10 @@ dailyValue); - $outArr["per100G"] = SummaryHelper::formatFloat($this->per100G); - $outArr["perServing"] = SummaryHelper::formatFloat($this->perServing); + $outArr["dailyValue"] = SummaryHelperV1::formatFloat($this->dailyValue); + $outArr["per100G"] = SummaryHelperV1::formatFloat($this->per100G); + $outArr["perServing"] = SummaryHelperV1::formatFloat($this->perServing); return $outArr; } @@ -65,9 +65,9 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["dailyValue"] = SummaryHelper::formatFloat($this->dailyValue); - $outArr["per100G"] = SummaryHelper::formatFloat($this->per100G); - $outArr["perServing"] = SummaryHelper::formatFloat($this->perServing); + $outArr["dailyValue"] = SummaryHelperV1::formatFloat($this->dailyValue); + $outArr["per100G"] = SummaryHelperV1::formatFloat($this->per100G); + $outArr["perServing"] = SummaryHelperV1::formatFloat($this->perServing); return $outArr; } /** @@ -90,6 +90,6 @@ public function toFieldList(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toFieldList()); + return SummaryHelperV1::cleanOutString($this->toFieldList()); } } diff --git a/src/Product/NutritionFactsLabel/NutritionFactsLabelV1TotalFat.php b/src/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1TotalFat.php similarity index 75% rename from src/Product/NutritionFactsLabel/NutritionFactsLabelV1TotalFat.php rename to src/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1TotalFat.php index af421e6c..aab692bb 100644 --- a/src/Product/NutritionFactsLabel/NutritionFactsLabelV1TotalFat.php +++ b/src/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1TotalFat.php @@ -1,10 +1,10 @@ dailyValue); - $outArr["per100G"] = SummaryHelper::formatFloat($this->per100G); - $outArr["perServing"] = SummaryHelper::formatFloat($this->perServing); + $outArr["dailyValue"] = SummaryHelperV1::formatFloat($this->dailyValue); + $outArr["per100G"] = SummaryHelperV1::formatFloat($this->per100G); + $outArr["perServing"] = SummaryHelperV1::formatFloat($this->perServing); return $outArr; } @@ -65,9 +65,9 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["dailyValue"] = SummaryHelper::formatFloat($this->dailyValue); - $outArr["per100G"] = SummaryHelper::formatFloat($this->per100G); - $outArr["perServing"] = SummaryHelper::formatFloat($this->perServing); + $outArr["dailyValue"] = SummaryHelperV1::formatFloat($this->dailyValue); + $outArr["per100G"] = SummaryHelperV1::formatFloat($this->per100G); + $outArr["perServing"] = SummaryHelperV1::formatFloat($this->perServing); return $outArr; } /** @@ -90,6 +90,6 @@ public function toFieldList(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toFieldList()); + return SummaryHelperV1::cleanOutString($this->toFieldList()); } } diff --git a/src/Product/NutritionFactsLabel/NutritionFactsLabelV1TotalSugar.php b/src/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1TotalSugar.php similarity index 75% rename from src/Product/NutritionFactsLabel/NutritionFactsLabelV1TotalSugar.php rename to src/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1TotalSugar.php index cd122c34..a490add6 100644 --- a/src/Product/NutritionFactsLabel/NutritionFactsLabelV1TotalSugar.php +++ b/src/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1TotalSugar.php @@ -1,10 +1,10 @@ dailyValue); - $outArr["per100G"] = SummaryHelper::formatFloat($this->per100G); - $outArr["perServing"] = SummaryHelper::formatFloat($this->perServing); + $outArr["dailyValue"] = SummaryHelperV1::formatFloat($this->dailyValue); + $outArr["per100G"] = SummaryHelperV1::formatFloat($this->per100G); + $outArr["perServing"] = SummaryHelperV1::formatFloat($this->perServing); return $outArr; } @@ -65,9 +65,9 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["dailyValue"] = SummaryHelper::formatFloat($this->dailyValue); - $outArr["per100G"] = SummaryHelper::formatFloat($this->per100G); - $outArr["perServing"] = SummaryHelper::formatFloat($this->perServing); + $outArr["dailyValue"] = SummaryHelperV1::formatFloat($this->dailyValue); + $outArr["per100G"] = SummaryHelperV1::formatFloat($this->per100G); + $outArr["perServing"] = SummaryHelperV1::formatFloat($this->perServing); return $outArr; } /** @@ -90,6 +90,6 @@ public function toFieldList(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toFieldList()); + return SummaryHelperV1::cleanOutString($this->toFieldList()); } } diff --git a/src/Product/NutritionFactsLabel/NutritionFactsLabelV1TransFat.php b/src/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1TransFat.php similarity index 75% rename from src/Product/NutritionFactsLabel/NutritionFactsLabelV1TransFat.php rename to src/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1TransFat.php index e3aded8f..5b34306c 100644 --- a/src/Product/NutritionFactsLabel/NutritionFactsLabelV1TransFat.php +++ b/src/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1TransFat.php @@ -1,10 +1,10 @@ dailyValue); - $outArr["per100G"] = SummaryHelper::formatFloat($this->per100G); - $outArr["perServing"] = SummaryHelper::formatFloat($this->perServing); + $outArr["dailyValue"] = SummaryHelperV1::formatFloat($this->dailyValue); + $outArr["per100G"] = SummaryHelperV1::formatFloat($this->per100G); + $outArr["perServing"] = SummaryHelperV1::formatFloat($this->perServing); return $outArr; } @@ -65,9 +65,9 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["dailyValue"] = SummaryHelper::formatFloat($this->dailyValue); - $outArr["per100G"] = SummaryHelper::formatFloat($this->per100G); - $outArr["perServing"] = SummaryHelper::formatFloat($this->perServing); + $outArr["dailyValue"] = SummaryHelperV1::formatFloat($this->dailyValue); + $outArr["per100G"] = SummaryHelperV1::formatFloat($this->per100G); + $outArr["perServing"] = SummaryHelperV1::formatFloat($this->perServing); return $outArr; } /** @@ -90,6 +90,6 @@ public function toFieldList(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toFieldList()); + return SummaryHelperV1::cleanOutString($this->toFieldList()); } } diff --git a/src/Product/Passport/PassportV1.php b/src/V1/Product/Passport/PassportV1.php similarity index 84% rename from src/Product/Passport/PassportV1.php rename to src/V1/Product/Passport/PassportV1.php index 1a45b867..ef460a7b 100644 --- a/src/Product/Passport/PassportV1.php +++ b/src/V1/Product/Passport/PassportV1.php @@ -2,11 +2,11 @@ /** Passport V1. */ -namespace Mindee\Product\Passport; +namespace Mindee\V1\Product\Passport; -use Mindee\Parsing\Common\Inference; -use Mindee\Parsing\Common\Page; use Mindee\Error\MindeeUnsetException; +use Mindee\V1\Parsing\Common\Inference; +use Mindee\V1\Parsing\Common\Page; /** * Passport API version 1 inference prediction. @@ -33,7 +33,7 @@ public function __construct(array $rawPrediction) foreach ($rawPrediction['pages'] as $page) { try { $this->pages[] = new Page(PassportV1Document::class, $page); - } catch (MindeeUnsetException $ignored) { + } catch (MindeeUnsetException) { } } } diff --git a/src/Product/Passport/PassportV1Document.php b/src/V1/Product/Passport/PassportV1Document.php similarity index 94% rename from src/Product/Passport/PassportV1Document.php rename to src/V1/Product/Passport/PassportV1Document.php index ed39a67e..a7c6712a 100644 --- a/src/Product/Passport/PassportV1Document.php +++ b/src/V1/Product/Passport/PassportV1Document.php @@ -1,12 +1,12 @@ mrz1 :MRZ Line 2: $this->mrz2 "; - return SummaryHelper::cleanOutString($outStr); + return SummaryHelperV1::cleanOutString($outStr); } } diff --git a/src/Product/Receipt/ReceiptV5.php b/src/V1/Product/Receipt/ReceiptV5.php similarity index 84% rename from src/Product/Receipt/ReceiptV5.php rename to src/V1/Product/Receipt/ReceiptV5.php index 681a87f4..d6e29029 100644 --- a/src/Product/Receipt/ReceiptV5.php +++ b/src/V1/Product/Receipt/ReceiptV5.php @@ -2,11 +2,11 @@ /** Receipt V5. */ -namespace Mindee\Product\Receipt; +namespace Mindee\V1\Product\Receipt; -use Mindee\Parsing\Common\Inference; -use Mindee\Parsing\Common\Page; use Mindee\Error\MindeeUnsetException; +use Mindee\V1\Parsing\Common\Inference; +use Mindee\V1\Parsing\Common\Page; /** * Receipt API version 5 inference prediction. @@ -33,7 +33,7 @@ public function __construct(array $rawPrediction) foreach ($rawPrediction['pages'] as $page) { try { $this->pages[] = new Page(ReceiptV5Document::class, $page); - } catch (MindeeUnsetException $ignored) { + } catch (MindeeUnsetException) { } } } diff --git a/src/Product/Receipt/ReceiptV5Document.php b/src/V1/Product/Receipt/ReceiptV5Document.php similarity index 93% rename from src/Product/Receipt/ReceiptV5Document.php rename to src/V1/Product/Receipt/ReceiptV5Document.php index fca27398..611aad53 100644 --- a/src/Product/Receipt/ReceiptV5Document.php +++ b/src/V1/Product/Receipt/ReceiptV5Document.php @@ -1,17 +1,17 @@ receiptNumber :Line Items: $lineItemsSummary "; - return SummaryHelper::cleanOutString($outStr); + return SummaryHelperV1::cleanOutString($outStr); } } diff --git a/src/Product/Receipt/ReceiptV5LineItem.php b/src/V1/Product/Receipt/ReceiptV5LineItem.php similarity index 61% rename from src/Product/Receipt/ReceiptV5LineItem.php rename to src/V1/Product/Receipt/ReceiptV5LineItem.php index 4d184697..ca0978c9 100644 --- a/src/Product/Receipt/ReceiptV5LineItem.php +++ b/src/V1/Product/Receipt/ReceiptV5LineItem.php @@ -1,10 +1,10 @@ description, 36); - $outArr["quantity"] = SummaryHelper::formatFloat($this->quantity); - $outArr["totalAmount"] = SummaryHelper::formatFloat($this->totalAmount); - $outArr["unitPrice"] = SummaryHelper::formatFloat($this->unitPrice); + $outArr["description"] = SummaryHelperV1::formatForDisplay($this->description, 36); + $outArr["quantity"] = SummaryHelperV1::formatFloat($this->quantity); + $outArr["totalAmount"] = SummaryHelperV1::formatFloat($this->totalAmount); + $outArr["unitPrice"] = SummaryHelperV1::formatFloat($this->unitPrice); return $outArr; } @@ -71,10 +71,10 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["description"] = SummaryHelper::formatForDisplay($this->description); - $outArr["quantity"] = SummaryHelper::formatFloat($this->quantity); - $outArr["totalAmount"] = SummaryHelper::formatFloat($this->totalAmount); - $outArr["unitPrice"] = SummaryHelper::formatFloat($this->unitPrice); + $outArr["description"] = SummaryHelperV1::formatForDisplay($this->description); + $outArr["quantity"] = SummaryHelperV1::formatFloat($this->quantity); + $outArr["totalAmount"] = SummaryHelperV1::formatFloat($this->totalAmount); + $outArr["unitPrice"] = SummaryHelperV1::formatFloat($this->unitPrice); return $outArr; } /** @@ -86,11 +86,11 @@ public function toTableLine(): string { $printable = $this->tablePrintableValues(); $outStr = "| "; - $outStr .= SummaryHelper::padString($printable["description"], 36); - $outStr .= SummaryHelper::padString($printable["quantity"], 8); - $outStr .= SummaryHelper::padString($printable["totalAmount"], 12); - $outStr .= SummaryHelper::padString($printable["unitPrice"], 10); - return rtrim(SummaryHelper::cleanOutString($outStr)); + $outStr .= SummaryHelperV1::padString($printable["description"], 36); + $outStr .= SummaryHelperV1::padString($printable["quantity"], 8); + $outStr .= SummaryHelperV1::padString($printable["totalAmount"], 12); + $outStr .= SummaryHelperV1::padString($printable["unitPrice"], 10); + return rtrim(SummaryHelperV1::cleanOutString($outStr)); } /** @@ -98,6 +98,6 @@ public function toTableLine(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toTableLine()); + return SummaryHelperV1::cleanOutString($this->toTableLine()); } } diff --git a/src/Product/Receipt/ReceiptV5LineItems.php b/src/V1/Product/Receipt/ReceiptV5LineItems.php similarity index 98% rename from src/Product/Receipt/ReceiptV5LineItems.php rename to src/V1/Product/Receipt/ReceiptV5LineItems.php index f684ff43..a6ac2077 100644 --- a/src/Product/Receipt/ReceiptV5LineItems.php +++ b/src/V1/Product/Receipt/ReceiptV5LineItems.php @@ -1,6 +1,6 @@ pages[] = new Page(ResumeV1Document::class, $page); - } catch (MindeeUnsetException $ignored) { + } catch (MindeeUnsetException) { } } } diff --git a/src/Product/Resume/ResumeV1Certificate.php b/src/V1/Product/Resume/ResumeV1Certificate.php similarity index 61% rename from src/Product/Resume/ResumeV1Certificate.php rename to src/V1/Product/Resume/ResumeV1Certificate.php index 48e12144..eb98e64c 100644 --- a/src/Product/Resume/ResumeV1Certificate.php +++ b/src/V1/Product/Resume/ResumeV1Certificate.php @@ -1,10 +1,10 @@ grade, 10); - $outArr["name"] = SummaryHelper::formatForDisplay($this->name, 30); - $outArr["provider"] = SummaryHelper::formatForDisplay($this->provider, 25); - $outArr["year"] = SummaryHelper::formatForDisplay($this->year); + $outArr["grade"] = SummaryHelperV1::formatForDisplay($this->grade, 10); + $outArr["name"] = SummaryHelperV1::formatForDisplay($this->name, 30); + $outArr["provider"] = SummaryHelperV1::formatForDisplay($this->provider, 25); + $outArr["year"] = SummaryHelperV1::formatForDisplay($this->year); return $outArr; } @@ -68,10 +68,10 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["grade"] = SummaryHelper::formatForDisplay($this->grade); - $outArr["name"] = SummaryHelper::formatForDisplay($this->name); - $outArr["provider"] = SummaryHelper::formatForDisplay($this->provider); - $outArr["year"] = SummaryHelper::formatForDisplay($this->year); + $outArr["grade"] = SummaryHelperV1::formatForDisplay($this->grade); + $outArr["name"] = SummaryHelperV1::formatForDisplay($this->name); + $outArr["provider"] = SummaryHelperV1::formatForDisplay($this->provider); + $outArr["year"] = SummaryHelperV1::formatForDisplay($this->year); return $outArr; } /** @@ -83,11 +83,11 @@ public function toTableLine(): string { $printable = $this->tablePrintableValues(); $outStr = "| "; - $outStr .= SummaryHelper::padString($printable["grade"], 10); - $outStr .= SummaryHelper::padString($printable["name"], 30); - $outStr .= SummaryHelper::padString($printable["provider"], 25); - $outStr .= SummaryHelper::padString($printable["year"], 4); - return rtrim(SummaryHelper::cleanOutString($outStr)); + $outStr .= SummaryHelperV1::padString($printable["grade"], 10); + $outStr .= SummaryHelperV1::padString($printable["name"], 30); + $outStr .= SummaryHelperV1::padString($printable["provider"], 25); + $outStr .= SummaryHelperV1::padString($printable["year"], 4); + return rtrim(SummaryHelperV1::cleanOutString($outStr)); } /** @@ -95,6 +95,6 @@ public function toTableLine(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toTableLine()); + return SummaryHelperV1::cleanOutString($this->toTableLine()); } } diff --git a/src/Product/Resume/ResumeV1Certificates.php b/src/V1/Product/Resume/ResumeV1Certificates.php similarity index 98% rename from src/Product/Resume/ResumeV1Certificates.php rename to src/V1/Product/Resume/ResumeV1Certificates.php index c13366f1..1313135d 100644 --- a/src/Product/Resume/ResumeV1Certificates.php +++ b/src/V1/Product/Resume/ResumeV1Certificates.php @@ -1,6 +1,6 @@ degreeDomain, 15); - $outArr["degreeType"] = SummaryHelper::formatForDisplay($this->degreeType, 25); - $outArr["endMonth"] = SummaryHelper::formatForDisplay($this->endMonth); - $outArr["endYear"] = SummaryHelper::formatForDisplay($this->endYear); - $outArr["school"] = SummaryHelper::formatForDisplay($this->school, 25); - $outArr["startMonth"] = SummaryHelper::formatForDisplay($this->startMonth); - $outArr["startYear"] = SummaryHelper::formatForDisplay($this->startYear); + $outArr["degreeDomain"] = SummaryHelperV1::formatForDisplay($this->degreeDomain, 15); + $outArr["degreeType"] = SummaryHelperV1::formatForDisplay($this->degreeType, 25); + $outArr["endMonth"] = SummaryHelperV1::formatForDisplay($this->endMonth); + $outArr["endYear"] = SummaryHelperV1::formatForDisplay($this->endYear); + $outArr["school"] = SummaryHelperV1::formatForDisplay($this->school, 25); + $outArr["startMonth"] = SummaryHelperV1::formatForDisplay($this->startMonth); + $outArr["startYear"] = SummaryHelperV1::formatForDisplay($this->startYear); return $outArr; } @@ -86,13 +86,13 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["degreeDomain"] = SummaryHelper::formatForDisplay($this->degreeDomain); - $outArr["degreeType"] = SummaryHelper::formatForDisplay($this->degreeType); - $outArr["endMonth"] = SummaryHelper::formatForDisplay($this->endMonth); - $outArr["endYear"] = SummaryHelper::formatForDisplay($this->endYear); - $outArr["school"] = SummaryHelper::formatForDisplay($this->school); - $outArr["startMonth"] = SummaryHelper::formatForDisplay($this->startMonth); - $outArr["startYear"] = SummaryHelper::formatForDisplay($this->startYear); + $outArr["degreeDomain"] = SummaryHelperV1::formatForDisplay($this->degreeDomain); + $outArr["degreeType"] = SummaryHelperV1::formatForDisplay($this->degreeType); + $outArr["endMonth"] = SummaryHelperV1::formatForDisplay($this->endMonth); + $outArr["endYear"] = SummaryHelperV1::formatForDisplay($this->endYear); + $outArr["school"] = SummaryHelperV1::formatForDisplay($this->school); + $outArr["startMonth"] = SummaryHelperV1::formatForDisplay($this->startMonth); + $outArr["startYear"] = SummaryHelperV1::formatForDisplay($this->startYear); return $outArr; } /** @@ -104,14 +104,14 @@ public function toTableLine(): string { $printable = $this->tablePrintableValues(); $outStr = "| "; - $outStr .= SummaryHelper::padString($printable["degreeDomain"], 15); - $outStr .= SummaryHelper::padString($printable["degreeType"], 25); - $outStr .= SummaryHelper::padString($printable["endMonth"], 9); - $outStr .= SummaryHelper::padString($printable["endYear"], 8); - $outStr .= SummaryHelper::padString($printable["school"], 25); - $outStr .= SummaryHelper::padString($printable["startMonth"], 11); - $outStr .= SummaryHelper::padString($printable["startYear"], 10); - return rtrim(SummaryHelper::cleanOutString($outStr)); + $outStr .= SummaryHelperV1::padString($printable["degreeDomain"], 15); + $outStr .= SummaryHelperV1::padString($printable["degreeType"], 25); + $outStr .= SummaryHelperV1::padString($printable["endMonth"], 9); + $outStr .= SummaryHelperV1::padString($printable["endYear"], 8); + $outStr .= SummaryHelperV1::padString($printable["school"], 25); + $outStr .= SummaryHelperV1::padString($printable["startMonth"], 11); + $outStr .= SummaryHelperV1::padString($printable["startYear"], 10); + return rtrim(SummaryHelperV1::cleanOutString($outStr)); } /** @@ -119,6 +119,6 @@ public function toTableLine(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toTableLine()); + return SummaryHelperV1::cleanOutString($this->toTableLine()); } } diff --git a/src/Product/Resume/ResumeV1Educations.php b/src/V1/Product/Resume/ResumeV1Educations.php similarity index 98% rename from src/Product/Resume/ResumeV1Educations.php rename to src/V1/Product/Resume/ResumeV1Educations.php index 6549826c..22517e93 100644 --- a/src/Product/Resume/ResumeV1Educations.php +++ b/src/V1/Product/Resume/ResumeV1Educations.php @@ -1,6 +1,6 @@ language); - $outArr["level"] = SummaryHelper::formatForDisplay($this->level, 20); + $outArr["language"] = SummaryHelperV1::formatForDisplay($this->language); + $outArr["level"] = SummaryHelperV1::formatForDisplay($this->level, 20); return $outArr; } @@ -56,8 +56,8 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["language"] = SummaryHelper::formatForDisplay($this->language); - $outArr["level"] = SummaryHelper::formatForDisplay($this->level); + $outArr["language"] = SummaryHelperV1::formatForDisplay($this->language); + $outArr["level"] = SummaryHelperV1::formatForDisplay($this->level); return $outArr; } /** @@ -69,9 +69,9 @@ public function toTableLine(): string { $printable = $this->tablePrintableValues(); $outStr = "| "; - $outStr .= SummaryHelper::padString($printable["language"], 8); - $outStr .= SummaryHelper::padString($printable["level"], 20); - return rtrim(SummaryHelper::cleanOutString($outStr)); + $outStr .= SummaryHelperV1::padString($printable["language"], 8); + $outStr .= SummaryHelperV1::padString($printable["level"], 20); + return rtrim(SummaryHelperV1::cleanOutString($outStr)); } /** @@ -79,6 +79,6 @@ public function toTableLine(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toTableLine()); + return SummaryHelperV1::cleanOutString($this->toTableLine()); } } diff --git a/src/Product/Resume/ResumeV1Languages.php b/src/V1/Product/Resume/ResumeV1Languages.php similarity index 97% rename from src/Product/Resume/ResumeV1Languages.php rename to src/V1/Product/Resume/ResumeV1Languages.php index 612a5ad7..dcdfba37 100644 --- a/src/Product/Resume/ResumeV1Languages.php +++ b/src/V1/Product/Resume/ResumeV1Languages.php @@ -1,6 +1,6 @@ contractType, 15); - $outArr["department"] = SummaryHelper::formatForDisplay($this->department, 10); - $outArr["description"] = SummaryHelper::formatForDisplay($this->description, 36); - $outArr["employer"] = SummaryHelper::formatForDisplay($this->employer, 25); - $outArr["endMonth"] = SummaryHelper::formatForDisplay($this->endMonth); - $outArr["endYear"] = SummaryHelper::formatForDisplay($this->endYear); - $outArr["role"] = SummaryHelper::formatForDisplay($this->role, 20); - $outArr["startMonth"] = SummaryHelper::formatForDisplay($this->startMonth); - $outArr["startYear"] = SummaryHelper::formatForDisplay($this->startYear); + $outArr["contractType"] = SummaryHelperV1::formatForDisplay($this->contractType, 15); + $outArr["department"] = SummaryHelperV1::formatForDisplay($this->department, 10); + $outArr["description"] = SummaryHelperV1::formatForDisplay($this->description, 36); + $outArr["employer"] = SummaryHelperV1::formatForDisplay($this->employer, 25); + $outArr["endMonth"] = SummaryHelperV1::formatForDisplay($this->endMonth); + $outArr["endYear"] = SummaryHelperV1::formatForDisplay($this->endYear); + $outArr["role"] = SummaryHelperV1::formatForDisplay($this->role, 20); + $outArr["startMonth"] = SummaryHelperV1::formatForDisplay($this->startMonth); + $outArr["startYear"] = SummaryHelperV1::formatForDisplay($this->startYear); return $outArr; } @@ -98,15 +98,15 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["contractType"] = SummaryHelper::formatForDisplay($this->contractType); - $outArr["department"] = SummaryHelper::formatForDisplay($this->department); - $outArr["description"] = SummaryHelper::formatForDisplay($this->description); - $outArr["employer"] = SummaryHelper::formatForDisplay($this->employer); - $outArr["endMonth"] = SummaryHelper::formatForDisplay($this->endMonth); - $outArr["endYear"] = SummaryHelper::formatForDisplay($this->endYear); - $outArr["role"] = SummaryHelper::formatForDisplay($this->role); - $outArr["startMonth"] = SummaryHelper::formatForDisplay($this->startMonth); - $outArr["startYear"] = SummaryHelper::formatForDisplay($this->startYear); + $outArr["contractType"] = SummaryHelperV1::formatForDisplay($this->contractType); + $outArr["department"] = SummaryHelperV1::formatForDisplay($this->department); + $outArr["description"] = SummaryHelperV1::formatForDisplay($this->description); + $outArr["employer"] = SummaryHelperV1::formatForDisplay($this->employer); + $outArr["endMonth"] = SummaryHelperV1::formatForDisplay($this->endMonth); + $outArr["endYear"] = SummaryHelperV1::formatForDisplay($this->endYear); + $outArr["role"] = SummaryHelperV1::formatForDisplay($this->role); + $outArr["startMonth"] = SummaryHelperV1::formatForDisplay($this->startMonth); + $outArr["startYear"] = SummaryHelperV1::formatForDisplay($this->startYear); return $outArr; } /** @@ -118,16 +118,16 @@ public function toTableLine(): string { $printable = $this->tablePrintableValues(); $outStr = "| "; - $outStr .= SummaryHelper::padString($printable["contractType"], 15); - $outStr .= SummaryHelper::padString($printable["department"], 10); - $outStr .= SummaryHelper::padString($printable["description"], 36); - $outStr .= SummaryHelper::padString($printable["employer"], 25); - $outStr .= SummaryHelper::padString($printable["endMonth"], 9); - $outStr .= SummaryHelper::padString($printable["endYear"], 8); - $outStr .= SummaryHelper::padString($printable["role"], 20); - $outStr .= SummaryHelper::padString($printable["startMonth"], 11); - $outStr .= SummaryHelper::padString($printable["startYear"], 10); - return rtrim(SummaryHelper::cleanOutString($outStr)); + $outStr .= SummaryHelperV1::padString($printable["contractType"], 15); + $outStr .= SummaryHelperV1::padString($printable["department"], 10); + $outStr .= SummaryHelperV1::padString($printable["description"], 36); + $outStr .= SummaryHelperV1::padString($printable["employer"], 25); + $outStr .= SummaryHelperV1::padString($printable["endMonth"], 9); + $outStr .= SummaryHelperV1::padString($printable["endYear"], 8); + $outStr .= SummaryHelperV1::padString($printable["role"], 20); + $outStr .= SummaryHelperV1::padString($printable["startMonth"], 11); + $outStr .= SummaryHelperV1::padString($printable["startYear"], 10); + return rtrim(SummaryHelperV1::cleanOutString($outStr)); } /** @@ -135,6 +135,6 @@ public function toTableLine(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toTableLine()); + return SummaryHelperV1::cleanOutString($this->toTableLine()); } } diff --git a/src/Product/Resume/ResumeV1ProfessionalExperiences.php b/src/V1/Product/Resume/ResumeV1ProfessionalExperiences.php similarity index 98% rename from src/Product/Resume/ResumeV1ProfessionalExperiences.php rename to src/V1/Product/Resume/ResumeV1ProfessionalExperiences.php index 84cfecca..31ff483b 100644 --- a/src/Product/Resume/ResumeV1ProfessionalExperiences.php +++ b/src/V1/Product/Resume/ResumeV1ProfessionalExperiences.php @@ -1,6 +1,6 @@ name, 20); - $outArr["url"] = SummaryHelper::formatForDisplay($this->url, 50); + $outArr["name"] = SummaryHelperV1::formatForDisplay($this->name, 20); + $outArr["url"] = SummaryHelperV1::formatForDisplay($this->url, 50); return $outArr; } @@ -56,8 +56,8 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["name"] = SummaryHelper::formatForDisplay($this->name); - $outArr["url"] = SummaryHelper::formatForDisplay($this->url); + $outArr["name"] = SummaryHelperV1::formatForDisplay($this->name); + $outArr["url"] = SummaryHelperV1::formatForDisplay($this->url); return $outArr; } /** @@ -69,9 +69,9 @@ public function toTableLine(): string { $printable = $this->tablePrintableValues(); $outStr = "| "; - $outStr .= SummaryHelper::padString($printable["name"], 20); - $outStr .= SummaryHelper::padString($printable["url"], 50); - return rtrim(SummaryHelper::cleanOutString($outStr)); + $outStr .= SummaryHelperV1::padString($printable["name"], 20); + $outStr .= SummaryHelperV1::padString($printable["url"], 50); + return rtrim(SummaryHelperV1::cleanOutString($outStr)); } /** @@ -79,6 +79,6 @@ public function toTableLine(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toTableLine()); + return SummaryHelperV1::cleanOutString($this->toTableLine()); } } diff --git a/src/Product/Resume/ResumeV1SocialNetworksUrls.php b/src/V1/Product/Resume/ResumeV1SocialNetworksUrls.php similarity index 98% rename from src/Product/Resume/ResumeV1SocialNetworksUrls.php rename to src/V1/Product/Resume/ResumeV1SocialNetworksUrls.php index 9b9b0a13..29f484c9 100644 --- a/src/Product/Resume/ResumeV1SocialNetworksUrls.php +++ b/src/V1/Product/Resume/ResumeV1SocialNetworksUrls.php @@ -1,6 +1,6 @@ pages[] = new Page(BankCheckV1Page::class, $page); - } catch (MindeeUnsetException $ignored) { + } catch (MindeeUnsetException) { } } } diff --git a/src/Product/Us/BankCheck/BankCheckV1Document.php b/src/V1/Product/Us/BankCheck/BankCheckV1Document.php similarity index 90% rename from src/Product/Us/BankCheck/BankCheckV1Document.php rename to src/V1/Product/Us/BankCheck/BankCheckV1Document.php index 9bfe9113..539b78d4 100644 --- a/src/Product/Us/BankCheck/BankCheckV1Document.php +++ b/src/V1/Product/Us/BankCheck/BankCheckV1Document.php @@ -1,13 +1,13 @@ accountNumber :Check Number: $this->checkNumber "; - return SummaryHelper::cleanOutString($outStr); + return SummaryHelperV1::cleanOutString($outStr); } } diff --git a/src/Product/Us/BankCheck/BankCheckV1Page.php b/src/V1/Product/Us/BankCheck/BankCheckV1Page.php similarity index 88% rename from src/Product/Us/BankCheck/BankCheckV1Page.php rename to src/V1/Product/Us/BankCheck/BankCheckV1Page.php index 8642f35c..84e11b4a 100644 --- a/src/Product/Us/BankCheck/BankCheckV1Page.php +++ b/src/V1/Product/Us/BankCheck/BankCheckV1Page.php @@ -1,9 +1,9 @@ pages[] = new Page(HealthcareCardV1Document::class, $page); - } catch (MindeeUnsetException $ignored) { + } catch (MindeeUnsetException) { } } } diff --git a/src/Product/Us/HealthcareCard/HealthcareCardV1Copay.php b/src/V1/Product/Us/HealthcareCard/HealthcareCardV1Copay.php similarity index 66% rename from src/Product/Us/HealthcareCard/HealthcareCardV1Copay.php rename to src/V1/Product/Us/HealthcareCard/HealthcareCardV1Copay.php index 8fc4287a..80de5388 100644 --- a/src/Product/Us/HealthcareCard/HealthcareCardV1Copay.php +++ b/src/V1/Product/Us/HealthcareCard/HealthcareCardV1Copay.php @@ -1,10 +1,10 @@ serviceFees); - $outArr["serviceName"] = SummaryHelper::formatForDisplay($this->serviceName, 20); + $outArr["serviceFees"] = SummaryHelperV1::formatFloat($this->serviceFees); + $outArr["serviceName"] = SummaryHelperV1::formatForDisplay($this->serviceName, 20); return $outArr; } @@ -57,8 +57,8 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["serviceFees"] = SummaryHelper::formatFloat($this->serviceFees); - $outArr["serviceName"] = SummaryHelper::formatForDisplay($this->serviceName); + $outArr["serviceFees"] = SummaryHelperV1::formatFloat($this->serviceFees); + $outArr["serviceName"] = SummaryHelperV1::formatForDisplay($this->serviceName); return $outArr; } /** @@ -70,9 +70,9 @@ public function toTableLine(): string { $printable = $this->tablePrintableValues(); $outStr = "| "; - $outStr .= SummaryHelper::padString($printable["serviceFees"], 12); - $outStr .= SummaryHelper::padString($printable["serviceName"], 20); - return rtrim(SummaryHelper::cleanOutString($outStr)); + $outStr .= SummaryHelperV1::padString($printable["serviceFees"], 12); + $outStr .= SummaryHelperV1::padString($printable["serviceName"], 20); + return rtrim(SummaryHelperV1::cleanOutString($outStr)); } /** @@ -80,6 +80,6 @@ public function toTableLine(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toTableLine()); + return SummaryHelperV1::cleanOutString($this->toTableLine()); } } diff --git a/src/Product/Us/HealthcareCard/HealthcareCardV1Copays.php b/src/V1/Product/Us/HealthcareCard/HealthcareCardV1Copays.php similarity index 97% rename from src/Product/Us/HealthcareCard/HealthcareCardV1Copays.php rename to src/V1/Product/Us/HealthcareCard/HealthcareCardV1Copays.php index 0722d305..29bfbe0c 100644 --- a/src/Product/Us/HealthcareCard/HealthcareCardV1Copays.php +++ b/src/V1/Product/Us/HealthcareCard/HealthcareCardV1Copays.php @@ -1,6 +1,6 @@ enrollmentDate "; - return SummaryHelper::cleanOutString($outStr); + return SummaryHelperV1::cleanOutString($outStr); } } diff --git a/src/Product/Us/UsMail/UsMailV3.php b/src/V1/Product/Us/UsMail/UsMailV3.php similarity index 84% rename from src/Product/Us/UsMail/UsMailV3.php rename to src/V1/Product/Us/UsMail/UsMailV3.php index eee81dd3..0dd5ed7b 100644 --- a/src/Product/Us/UsMail/UsMailV3.php +++ b/src/V1/Product/Us/UsMail/UsMailV3.php @@ -2,11 +2,11 @@ /** US Mail V3. */ -namespace Mindee\Product\Us\UsMail; +namespace Mindee\V1\Product\Us\UsMail; -use Mindee\Parsing\Common\Inference; -use Mindee\Parsing\Common\Page; use Mindee\Error\MindeeUnsetException; +use Mindee\V1\Parsing\Common\Inference; +use Mindee\V1\Parsing\Common\Page; /** * US Mail API version 3 inference prediction. @@ -33,7 +33,7 @@ public function __construct(array $rawPrediction) foreach ($rawPrediction['pages'] as $page) { try { $this->pages[] = new Page(UsMailV3Document::class, $page); - } catch (MindeeUnsetException $ignored) { + } catch (MindeeUnsetException) { } } } diff --git a/src/Product/Us/UsMail/UsMailV3Document.php b/src/V1/Product/Us/UsMail/UsMailV3Document.php similarity index 91% rename from src/Product/Us/UsMail/UsMailV3Document.php rename to src/V1/Product/Us/UsMail/UsMailV3Document.php index c83f9bcb..09b9a8ba 100644 --- a/src/Product/Us/UsMail/UsMailV3Document.php +++ b/src/V1/Product/Us/UsMail/UsMailV3Document.php @@ -1,12 +1,12 @@ isReturnToSender "; - return SummaryHelper::cleanOutString($outStr); + return SummaryHelperV1::cleanOutString($outStr); } } diff --git a/src/Product/Us/UsMail/UsMailV3RecipientAddress.php b/src/V1/Product/Us/UsMail/UsMailV3RecipientAddress.php similarity index 54% rename from src/Product/Us/UsMail/UsMailV3RecipientAddress.php rename to src/V1/Product/Us/UsMail/UsMailV3RecipientAddress.php index 472de2ef..d57d7c84 100644 --- a/src/Product/Us/UsMail/UsMailV3RecipientAddress.php +++ b/src/V1/Product/Us/UsMail/UsMailV3RecipientAddress.php @@ -1,10 +1,10 @@ city, 15); - $outArr["complete"] = SummaryHelper::formatForDisplay($this->complete, 35); - $outArr["isAddressChange"] = SummaryHelper::formatForDisplay($this->isAddressChange); - $outArr["postalCode"] = SummaryHelper::formatForDisplay($this->postalCode); - $outArr["privateMailboxNumber"] = SummaryHelper::formatForDisplay($this->privateMailboxNumber); - $outArr["state"] = SummaryHelper::formatForDisplay($this->state); - $outArr["street"] = SummaryHelper::formatForDisplay($this->street, 25); - $outArr["unit"] = SummaryHelper::formatForDisplay($this->unit, 15); + $outArr["city"] = SummaryHelperV1::formatForDisplay($this->city, 15); + $outArr["complete"] = SummaryHelperV1::formatForDisplay($this->complete, 35); + $outArr["isAddressChange"] = SummaryHelperV1::formatForDisplay($this->isAddressChange); + $outArr["postalCode"] = SummaryHelperV1::formatForDisplay($this->postalCode); + $outArr["privateMailboxNumber"] = SummaryHelperV1::formatForDisplay($this->privateMailboxNumber); + $outArr["state"] = SummaryHelperV1::formatForDisplay($this->state); + $outArr["street"] = SummaryHelperV1::formatForDisplay($this->street, 25); + $outArr["unit"] = SummaryHelperV1::formatForDisplay($this->unit, 15); return $outArr; } @@ -92,14 +92,14 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["city"] = SummaryHelper::formatForDisplay($this->city); - $outArr["complete"] = SummaryHelper::formatForDisplay($this->complete); - $outArr["isAddressChange"] = SummaryHelper::formatForDisplay($this->isAddressChange); - $outArr["postalCode"] = SummaryHelper::formatForDisplay($this->postalCode); - $outArr["privateMailboxNumber"] = SummaryHelper::formatForDisplay($this->privateMailboxNumber); - $outArr["state"] = SummaryHelper::formatForDisplay($this->state); - $outArr["street"] = SummaryHelper::formatForDisplay($this->street); - $outArr["unit"] = SummaryHelper::formatForDisplay($this->unit); + $outArr["city"] = SummaryHelperV1::formatForDisplay($this->city); + $outArr["complete"] = SummaryHelperV1::formatForDisplay($this->complete); + $outArr["isAddressChange"] = SummaryHelperV1::formatForDisplay($this->isAddressChange); + $outArr["postalCode"] = SummaryHelperV1::formatForDisplay($this->postalCode); + $outArr["privateMailboxNumber"] = SummaryHelperV1::formatForDisplay($this->privateMailboxNumber); + $outArr["state"] = SummaryHelperV1::formatForDisplay($this->state); + $outArr["street"] = SummaryHelperV1::formatForDisplay($this->street); + $outArr["unit"] = SummaryHelperV1::formatForDisplay($this->unit); return $outArr; } /** @@ -111,15 +111,15 @@ public function toTableLine(): string { $printable = $this->tablePrintableValues(); $outStr = "| "; - $outStr .= SummaryHelper::padString($printable["city"], 15); - $outStr .= SummaryHelper::padString($printable["complete"], 35); - $outStr .= SummaryHelper::padString($printable["isAddressChange"], 17); - $outStr .= SummaryHelper::padString($printable["postalCode"], 11); - $outStr .= SummaryHelper::padString($printable["privateMailboxNumber"], 22); - $outStr .= SummaryHelper::padString($printable["state"], 5); - $outStr .= SummaryHelper::padString($printable["street"], 25); - $outStr .= SummaryHelper::padString($printable["unit"], 15); - return rtrim(SummaryHelper::cleanOutString($outStr)); + $outStr .= SummaryHelperV1::padString($printable["city"], 15); + $outStr .= SummaryHelperV1::padString($printable["complete"], 35); + $outStr .= SummaryHelperV1::padString($printable["isAddressChange"], 17); + $outStr .= SummaryHelperV1::padString($printable["postalCode"], 11); + $outStr .= SummaryHelperV1::padString($printable["privateMailboxNumber"], 22); + $outStr .= SummaryHelperV1::padString($printable["state"], 5); + $outStr .= SummaryHelperV1::padString($printable["street"], 25); + $outStr .= SummaryHelperV1::padString($printable["unit"], 15); + return rtrim(SummaryHelperV1::cleanOutString($outStr)); } /** @@ -127,6 +127,6 @@ public function toTableLine(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toTableLine()); + return SummaryHelperV1::cleanOutString($this->toTableLine()); } } diff --git a/src/Product/Us/UsMail/UsMailV3RecipientAddresses.php b/src/V1/Product/Us/UsMail/UsMailV3RecipientAddresses.php similarity index 98% rename from src/Product/Us/UsMail/UsMailV3RecipientAddresses.php rename to src/V1/Product/Us/UsMail/UsMailV3RecipientAddresses.php index 42e4c573..378a30ce 100644 --- a/src/Product/Us/UsMail/UsMailV3RecipientAddresses.php +++ b/src/V1/Product/Us/UsMail/UsMailV3RecipientAddresses.php @@ -1,6 +1,6 @@ city, 15); - $outArr["complete"] = SummaryHelper::formatForDisplay($this->complete, 35); - $outArr["postalCode"] = SummaryHelper::formatForDisplay($this->postalCode); - $outArr["state"] = SummaryHelper::formatForDisplay($this->state); - $outArr["street"] = SummaryHelper::formatForDisplay($this->street, 25); + $outArr["city"] = SummaryHelperV1::formatForDisplay($this->city, 15); + $outArr["complete"] = SummaryHelperV1::formatForDisplay($this->complete, 35); + $outArr["postalCode"] = SummaryHelperV1::formatForDisplay($this->postalCode); + $outArr["state"] = SummaryHelperV1::formatForDisplay($this->state); + $outArr["street"] = SummaryHelperV1::formatForDisplay($this->street, 25); return $outArr; } @@ -74,11 +74,11 @@ private function tablePrintableValues(): array private function printableValues(): array { $outArr = []; - $outArr["city"] = SummaryHelper::formatForDisplay($this->city); - $outArr["complete"] = SummaryHelper::formatForDisplay($this->complete); - $outArr["postalCode"] = SummaryHelper::formatForDisplay($this->postalCode); - $outArr["state"] = SummaryHelper::formatForDisplay($this->state); - $outArr["street"] = SummaryHelper::formatForDisplay($this->street); + $outArr["city"] = SummaryHelperV1::formatForDisplay($this->city); + $outArr["complete"] = SummaryHelperV1::formatForDisplay($this->complete); + $outArr["postalCode"] = SummaryHelperV1::formatForDisplay($this->postalCode); + $outArr["state"] = SummaryHelperV1::formatForDisplay($this->state); + $outArr["street"] = SummaryHelperV1::formatForDisplay($this->street); return $outArr; } /** @@ -103,6 +103,6 @@ public function toFieldList(): string */ public function __toString(): string { - return SummaryHelper::cleanOutString($this->toFieldList()); + return SummaryHelperV1::cleanOutString($this->toFieldList()); } } diff --git a/src/V2/Client.php b/src/V2/Client.php index 06957169..857e3470 100644 --- a/src/V2/Client.php +++ b/src/V2/Client.php @@ -7,8 +7,8 @@ use Mindee\Input\InputSource; use Mindee\V2\ClientOptions\BaseParameters; use Mindee\V2\HTTP\MindeeAPIV2; -use Mindee\V2\Parsing\BaseResponse; -use Mindee\V2\Parsing\InferenceResponse; +use Mindee\V2\Parsing\Inference\BaseResponse; +use Mindee\V2\Parsing\Inference\InferenceResponse; use Mindee\V2\Parsing\JobResponse; use Mindee\V2\Product\Extraction\Params\InferenceParameters; diff --git a/src/V2/FileOperations/Split.php b/src/V2/FileOperations/Split.php index 43a076e2..2d0371c1 100644 --- a/src/V2/FileOperations/Split.php +++ b/src/V2/FileOperations/Split.php @@ -3,8 +3,8 @@ namespace Mindee\V2\FileOperations; use Mindee\Error\MindeeInputException; -use Mindee\Extraction\ExtractedPdf; -use Mindee\Extraction\PdfExtractor; +use Mindee\Extraction\ExtractedPDF; +use Mindee\Extraction\PDFExtractor; use Mindee\Input\LocalInputSource; /** @@ -49,9 +49,9 @@ public static function expandRange(int $start, int $end): array * * @param int[] $split Split range to extract. * - * @return ExtractedPdf 2D array of extracted pages + * @return ExtractedPDF 2D array of extracted pages */ - public function extractSingleSplit(array $split): ExtractedPdf + public function extractSingleSplit(array $split): ExtractedPDF { return $this->extractSplits([$split])[0]; } @@ -65,7 +65,7 @@ public function extractSingleSplit(array $split): ExtractedPdf */ public function extractSplits(array $splits): SplitFiles { - $pdfExtractor = new PdfExtractor($this->localInput); + $pdfExtractor = new PDFExtractor($this->localInput); $expandedPageIndexes = array_map(fn (array $split) => self::expandRange($split[0], $split[1]), $splits); return new SplitFiles(...$pdfExtractor->extractSubDocuments($expandedPageIndexes)); diff --git a/src/V2/FileOperations/SplitFiles.php b/src/V2/FileOperations/SplitFiles.php index b9fefd66..fe2935ce 100644 --- a/src/V2/FileOperations/SplitFiles.php +++ b/src/V2/FileOperations/SplitFiles.php @@ -3,21 +3,21 @@ namespace Mindee\V2\FileOperations; use Mindee\Error\MindeeException; -use Mindee\Extraction\ExtractedPdf; +use Mindee\Extraction\ExtractedPDF; /** * Split files collection wrapper. * - * * @extends \ArrayObject + * * @extends \ArrayObject */ class SplitFiles extends \ArrayObject { /** * Builds a new SplitFiles collection. * - * @param ExtractedPdf ...$items Items. + * @param ExtractedPDF ...$items Items. */ - public function __construct(ExtractedPdf ...$items) + public function __construct(ExtractedPDF ...$items) { parent::__construct($items); } diff --git a/src/V2/HTTP/MindeeAPIV2.php b/src/V2/HTTP/MindeeAPIV2.php index 2d69cfe6..90aa7cd5 100644 --- a/src/V2/HTTP/MindeeAPIV2.php +++ b/src/V2/HTTP/MindeeAPIV2.php @@ -17,9 +17,9 @@ use Mindee\Input\LocalInputSource; use Mindee\Input\URLInputSource; use Mindee\V2\ClientOptions\BaseParameters; -use Mindee\V2\Parsing\BaseResponse; use Mindee\V2\Parsing\ErrorResponse; -use Mindee\V2\Parsing\InferenceResponse; +use Mindee\V2\Parsing\Inference\BaseResponse; +use Mindee\V2\Parsing\Inference\InferenceResponse; use Mindee\V2\Parsing\JobResponse; use ReflectionClass; use ReflectionException; diff --git a/src/V2/Parsing/BaseInference.php b/src/V2/Parsing/BaseInference.php index 1461d213..7f396a69 100644 --- a/src/V2/Parsing/BaseInference.php +++ b/src/V2/Parsing/BaseInference.php @@ -3,6 +3,9 @@ namespace Mindee\V2\Parsing; use Mindee\Parsing\Common\SummaryHelper; +use Mindee\V2\Parsing\Inference\InferenceFile; +use Mindee\V2\Parsing\Inference\InferenceJob; +use Mindee\V2\Parsing\Inference\InferenceModel; /** * Base for all inference-based V2 products. diff --git a/src/Error/ErrorItem.php b/src/V2/Parsing/ErrorItem.php similarity index 94% rename from src/Error/ErrorItem.php rename to src/V2/Parsing/ErrorItem.php index fc2e96d8..1d5304b3 100644 --- a/src/Error/ErrorItem.php +++ b/src/V2/Parsing/ErrorItem.php @@ -1,6 +1,6 @@ rag = isset( $serverResponse['rag'] - ) ? new RagMetadata($serverResponse['rag']) : null; + ) ? new RAGMetadata($serverResponse['rag']) : null; } /** diff --git a/src/V2/Parsing/RagMetadata.php b/src/V2/Parsing/Inference/RAGMetadata.php similarity index 87% rename from src/V2/Parsing/RagMetadata.php rename to src/V2/Parsing/Inference/RAGMetadata.php index 45ceca56..56b56a13 100644 --- a/src/V2/Parsing/RagMetadata.php +++ b/src/V2/Parsing/Inference/RAGMetadata.php @@ -1,11 +1,11 @@ expectException(MindeeUnhandledException::class); $inputObj = new PathInput(\TestingUtilities::getFileTypesDir() . "/pdf/blank.pdf"); - new PdfExtractor($inputObj); + new PDFExtractor($inputObj); } public function testNoExtractedImage() { @@ -34,11 +34,11 @@ public function testNoExtractedImage() $saveFormat = "pdf"; new ExtractedImage($inputImage, $filename, $saveFormat, 0, 0); } - public function testNoExtractedPdf() + public function testNoExtractedPDF() { $this->expectException(MindeeUnhandledException::class); $inputImage = ""; $filename = "dummy"; - new ExtractedPdf($inputImage, $filename); + new ExtractedPDF($inputImage, $filename); } } diff --git a/tests/Dependencies/DependencyCheckerPdfTest.php b/tests/Dependencies/DependencyCheckerPDFTest.php similarity index 85% rename from tests/Dependencies/DependencyCheckerPdfTest.php rename to tests/Dependencies/DependencyCheckerPDFTest.php index ff3f59b3..4fa6b1d0 100644 --- a/tests/Dependencies/DependencyCheckerPdfTest.php +++ b/tests/Dependencies/DependencyCheckerPDFTest.php @@ -2,10 +2,10 @@ namespace Dependencies; -use Mindee\Parsing\DependencyChecker; +use Mindee\Dependency\DependencyChecker; use PHPUnit\Framework\TestCase; -class DependencyCheckerPdfTest extends TestCase { +class DependencyCheckerPDFTest extends TestCase { public function testGhostScriptDependency() { $this->expectNotToPerformAssertions(); DependencyChecker::isGhostscriptAvailable(); diff --git a/tests/Input/LocalInputSourceTest.php b/tests/Input/LocalInputSourceTest.php index c02bf6ec..c2648307 100644 --- a/tests/Input/LocalInputSourceTest.php +++ b/tests/Input/LocalInputSourceTest.php @@ -19,6 +19,7 @@ use setasign\Fpdi\PdfParser\PdfParserException; use setasign\Fpdi\PdfReader\PdfReaderException; +use TestingUtilities; use const Mindee\V1\HTTP\API_KEY_ENV_NAME; use const Mindee\Input\KEEP_ONLY; use const Mindee\Input\REMOVE; @@ -40,20 +41,20 @@ protected function tearDown(): void putenv(API_KEY_ENV_NAME . '=' . $this->oldKey); $filesToDelete = [ - \TestingUtilities::getRootDataDir() . "/output/compress_indirect.jpg", - \TestingUtilities::getRootDataDir() . "/output/compress100.jpg", - \TestingUtilities::getRootDataDir() . "/output/compress85.jpg", - \TestingUtilities::getRootDataDir() . "/output/compress50.jpg", - \TestingUtilities::getRootDataDir() . "/output/compress10.jpg", - \TestingUtilities::getRootDataDir() . "/output/compress1.jpg", - \TestingUtilities::getRootDataDir() . "/output/not_compressed.pdf", - \TestingUtilities::getRootDataDir() . "/output/compress_indirect.pdf", - \TestingUtilities::getRootDataDir() . "/output/not_compressed_multipage.pdf", - \TestingUtilities::getRootDataDir() . "/output/compress_direct_85.pdf", - \TestingUtilities::getRootDataDir() . "/output/compress_direct_75.pdf", - \TestingUtilities::getRootDataDir() . "/output/compress_direct_50.pdf", - \TestingUtilities::getRootDataDir() . "/output/compress_direct_10.pdf", - \TestingUtilities::getRootDataDir() . "/output/text_multipage.pdf" + TestingUtilities::getRootDataDir() . "/output/compress_indirect.jpg", + TestingUtilities::getRootDataDir() . "/output/compress100.jpg", + TestingUtilities::getRootDataDir() . "/output/compress85.jpg", + TestingUtilities::getRootDataDir() . "/output/compress50.jpg", + TestingUtilities::getRootDataDir() . "/output/compress10.jpg", + TestingUtilities::getRootDataDir() . "/output/compress1.jpg", + TestingUtilities::getRootDataDir() . "/output/not_compressed.pdf", + TestingUtilities::getRootDataDir() . "/output/compress_indirect.pdf", + TestingUtilities::getRootDataDir() . "/output/not_compressed_multipage.pdf", + TestingUtilities::getRootDataDir() . "/output/compress_direct_85.pdf", + TestingUtilities::getRootDataDir() . "/output/compress_direct_75.pdf", + TestingUtilities::getRootDataDir() . "/output/compress_direct_50.pdf", + TestingUtilities::getRootDataDir() . "/output/compress_direct_10.pdf", + TestingUtilities::getRootDataDir() . "/output/text_multipage.pdf" ]; foreach ($filesToDelete as $file) { @@ -66,20 +67,20 @@ protected function tearDown(): void public function testPDFCountPages() { - $inputObj = new PathInput(\TestingUtilities::getFileTypesDir() . "/pdf/multipage.pdf"); + $inputObj = new PathInput(TestingUtilities::getFileTypesDir() . "/pdf/multipage.pdf"); $this->assertEquals(12, $inputObj->getPageCount()); } public function testPDFReconstructOK() { - $inputObj = new PathInput(\TestingUtilities::getFileTypesDir() . "/pdf/multipage.pdf"); + $inputObj = new PathInput(TestingUtilities::getFileTypesDir() . "/pdf/multipage.pdf"); $inputObj->applyPageOptions(new PageOptions([0, 1, 2, 3, 4], KEEP_ONLY, 2)); $this->assertEquals(5, $inputObj->getPageCount()); } public function testPDFReadContents() { - $inputDoc = new PathInput(\TestingUtilities::getFileTypesDir() . "/pdf/multipage.pdf"); + $inputDoc = new PathInput(TestingUtilities::getFileTypesDir() . "/pdf/multipage.pdf"); $contents = $inputDoc->readContents(); $this->assertEquals("multipage.pdf", $contents[0]); } @@ -89,13 +90,13 @@ public function testPDFReadContents() */ public function testPDFCutNPages(array $indexes) { - $inputObj = new PathInput(\TestingUtilities::getFileTypesDir() . "/pdf/multipage.pdf"); + $inputObj = new PathInput(TestingUtilities::getFileTypesDir() . "/pdf/multipage.pdf"); $inputObj->applyPageOptions(new PageOptions($indexes, KEEP_ONLY, 2)); try { $basePdf = new FPDI(); $cutPdf = new FPDI(); $pageCountCutPdf = $cutPdf->setSourceFile( - \TestingUtilities::getFileTypesDir() . "/pdf/multipage_cut-" . count($indexes) . ".pdf" + TestingUtilities::getFileTypesDir() . "/pdf/multipage_cut-" . count($indexes) . ".pdf" ); $pageCountBasePdf = $basePdf->setSourceFile($inputObj->fileObject->getFilename()); $basePdf->Close(); @@ -106,7 +107,7 @@ public function testPDFCutNPages(array $indexes) $basePdf = new FPDI(); $cutPdf = new FPDI(); for ($pageNumber = 0; $pageNumber < $pageCountBasePdf; $pageNumber++) { - $cutPdf->setSourceFile(\TestingUtilities::getFileTypesDir() . "/pdf/multipage_cut-" . count($indexes) . ".pdf"); + $cutPdf->setSourceFile(TestingUtilities::getFileTypesDir() . "/pdf/multipage_cut-" . count($indexes) . ".pdf"); $basePdf->setSourceFile($inputObj->fileObject->getFilename()); $cutPdf->AddPage(); $cutPdf->useTemplate($cutPdf->importPage($pageNumber + 1)); @@ -134,14 +135,14 @@ public function pageIndexesProvider() public function testPDFKeep5FirstPages() { - $inputObj = new PathInput(\TestingUtilities::getFileTypesDir() . "/pdf/multipage.pdf"); + $inputObj = new PathInput(TestingUtilities::getFileTypesDir() . "/pdf/multipage.pdf"); $inputObj->applyPageOptions(new PageOptions([0, 1, 2, 3, 4], KEEP_ONLY, 2)); $this->assertEquals(5, $inputObj->getPageCount()); } public function testPDFKeepInvalidPages() { - $inputObj = new PathInput(\TestingUtilities::getFileTypesDir() . "/pdf/multipage.pdf"); + $inputObj = new PathInput(TestingUtilities::getFileTypesDir() . "/pdf/multipage.pdf"); $inputObj->applyPageOptions(new PageOptions([0, 1, 17], KEEP_ONLY, 2)); $this->assertEquals(2, $inputObj->getPageCount()); } @@ -149,35 +150,35 @@ public function testPDFKeepInvalidPages() public function testPDFRemove5LastPages() { - $inputObj = new PathInput(\TestingUtilities::getFileTypesDir() . "/pdf/multipage.pdf"); + $inputObj = new PathInput(TestingUtilities::getFileTypesDir() . "/pdf/multipage.pdf"); $inputObj->applyPageOptions(new PageOptions([-5, -4, -3, -2, -1], REMOVE, 2)); $this->assertEquals(7, $inputObj->getPageCount()); } public function testPDFRemove5FirstPages() { - $inputObj = new PathInput(\TestingUtilities::getFileTypesDir() . "/pdf/multipage.pdf"); + $inputObj = new PathInput(TestingUtilities::getFileTypesDir() . "/pdf/multipage.pdf"); $inputObj->applyPageOptions(new PageOptions([0, 1, 2, 3, 4], REMOVE, 2)); $this->assertEquals(7, $inputObj->getPageCount()); } public function testPDFRemoveInvalidPages() { - $inputObj = new PathInput(\TestingUtilities::getFileTypesDir() . "/pdf/multipage.pdf"); + $inputObj = new PathInput(TestingUtilities::getFileTypesDir() . "/pdf/multipage.pdf"); $inputObj->applyPageOptions(new PageOptions([16], REMOVE, 2)); $this->assertEquals(12, $inputObj->getPageCount()); } public function testPDFKeepNoPages() { - $inputObj = new PathInput(\TestingUtilities::getFileTypesDir() . "/pdf/multipage.pdf"); + $inputObj = new PathInput(TestingUtilities::getFileTypesDir() . "/pdf/multipage.pdf"); $this->expectException(MindeePDFException::class); $inputObj->applyPageOptions(new PageOptions([], KEEP_ONLY, 2)); } public function testPDFRemoveAllPages() { - $inputObj = new PathInput(\TestingUtilities::getFileTypesDir() . "/pdf/multipage.pdf"); + $inputObj = new PathInput(TestingUtilities::getFileTypesDir() . "/pdf/multipage.pdf"); $this->expectException(MindeePDFException::class); $pageOptions = new PageOptions(range(0, $inputObj->getPageCount() - 1), REMOVE, 2); $inputObj->applyPageOptions(pageOptions: $pageOptions); @@ -185,8 +186,8 @@ public function testPDFRemoveAllPages() public function testPDFInputFromFile() { - $fileContents = file_get_contents(\TestingUtilities::getFileTypesDir() . "/pdf/multipage.pdf"); - $fileRef = fopen(\TestingUtilities::getFileTypesDir() . "/pdf/multipage.pdf", "r"); + $fileContents = file_get_contents(TestingUtilities::getFileTypesDir() . "/pdf/multipage.pdf"); + $fileRef = fopen(TestingUtilities::getFileTypesDir() . "/pdf/multipage.pdf", "r"); $inputDoc = new FileInput($fileRef); $contents = $inputDoc->readContents(); $this->assertEquals("multipage.pdf", $contents[0]); @@ -195,7 +196,7 @@ public function testPDFInputFromFile() public function testPDFInputFromBytes() { - $pdfBytes = file_get_contents(\TestingUtilities::getFileTypesDir() . "/pdf/multipage.pdf"); + $pdfBytes = file_get_contents(TestingUtilities::getFileTypesDir() . "/pdf/multipage.pdf"); $inputDoc = new BytesInput($pdfBytes, "dummy.pdf"); $contents = $inputDoc->readContents(); $this->assertEquals("dummy.pdf", $contents[0]); @@ -204,54 +205,54 @@ public function testPDFInputFromBytes() public function testInputFromRawb64String() { - $pdfBytes = file_get_contents(\TestingUtilities::getFileTypesDir() . "/receipt.txt"); + $pdfBytes = file_get_contents(TestingUtilities::getFileTypesDir() . "/receipt.txt"); $inputDoc = new Base64Input($pdfBytes, "dummy.pdf"); $contents = $inputDoc->readContents(); $this->assertEquals("dummy.pdf", $contents[0]); $this->assertEquals(str_replace("\n", "", $pdfBytes), str_replace("\n", "", base64_encode($contents[1]))); } - public function testShouldNotRaiseMimeErrorForBrokenFixablePdf() + public function testShouldNotRaiseMimeErrorForBrokenFixablePDF() { $this->expectNotToPerformAssertions(); - $this->dummyClient->sourceFromPath(\TestingUtilities::getFileTypesDir() . '/pdf/broken_fixable.pdf', true); + $this->dummyClient->sourceFromPath(TestingUtilities::getFileTypesDir() . '/pdf/broken_fixable.pdf', true); } - public function testShouldRaiseErrorForBrokenUnfixablePdf() + public function testShouldRaiseErrorForBrokenUnfixablePDF() { $this->expectException(MindeeSourceException::class); - $this->dummyClient->sourceFromPath(\TestingUtilities::getFileTypesDir() . '/pdf/broken_unfixable.pdf', true); + $this->dummyClient->sourceFromPath(TestingUtilities::getFileTypesDir() . '/pdf/broken_unfixable.pdf', true); } - public function testShouldSendCorrectResultsForBrokenFixableInvoicePdf() + public function testShouldSendCorrectResultsForBrokenFixableInvoicePDF() { $sourceDocOriginal = $this->dummyClient->sourceFromPath( - \TestingUtilities::getV1DataDir() . '/products/invoices/invoice.pdf' + TestingUtilities::getV1DataDir() . '/products/invoices/invoice.pdf' ); - $sourceDocFixed = $this->dummyClient->sourceFromPath(\TestingUtilities::getFileTypesDir() . '/pdf/broken_invoice.pdf', true); + $sourceDocFixed = $this->dummyClient->sourceFromPath(TestingUtilities::getFileTypesDir() . '/pdf/broken_invoice.pdf', true); $this->assertEquals($sourceDocFixed->readContents()[1], $sourceDocOriginal->readContents()[1]); } public function testImageQualityCompressionFromInputSource() { - $receiptInput = $this->dummyClient->sourceFromPath(\TestingUtilities::getFileTypesDir() . '/receipt.jpg'); + $receiptInput = $this->dummyClient->sourceFromPath(TestingUtilities::getFileTypesDir() . '/receipt.jpg'); $receiptInput->compress(80); file_put_contents( - \TestingUtilities::getRootDataDir() . "/output/compress_indirect.jpg", + TestingUtilities::getRootDataDir() . "/output/compress_indirect.jpg", file_get_contents($receiptInput->fileObject->getFilename()) ); - $sizeOriginal = filesize(\TestingUtilities::getFileTypesDir() . '/receipt.jpg'); - $sizeCompressed = filesize(\TestingUtilities::getRootDataDir() . "/output/compress_indirect.jpg"); + $sizeOriginal = filesize(TestingUtilities::getFileTypesDir() . '/receipt.jpg'); + $sizeCompressed = filesize(TestingUtilities::getRootDataDir() . "/output/compress_indirect.jpg"); $this->assertGreaterThan($sizeCompressed, $sizeOriginal); } public function testDirectImageQualityCompression() { - $receiptInput = $this->dummyClient->sourceFromPath(\TestingUtilities::getFileTypesDir() . '/receipt.jpg'); - $sizeOriginal = filesize(\TestingUtilities::getFileTypesDir() . '/receipt.jpg'); + $receiptInput = $this->dummyClient->sourceFromPath(TestingUtilities::getFileTypesDir() . '/receipt.jpg'); + $sizeOriginal = filesize(TestingUtilities::getFileTypesDir() . '/receipt.jpg'); $compresses = [ 100 => ImageCompressor::compress($receiptInput->fileObject, 100), 85 => ImageCompressor::compress($receiptInput->fileObject), @@ -261,11 +262,11 @@ public function testDirectImageQualityCompression() ]; $outputFiles = [ - 100 => \TestingUtilities::getRootDataDir() . "/output/compress100.jpg", - 85 => \TestingUtilities::getRootDataDir() . "/output/compress85.jpg", - 50 => \TestingUtilities::getRootDataDir() . "/output/compress50.jpg", - 10 => \TestingUtilities::getRootDataDir() . "/output/compress10.jpg", - 1 => \TestingUtilities::getRootDataDir() . "/output/compress1.jpg", + 100 => TestingUtilities::getRootDataDir() . "/output/compress100.jpg", + 85 => TestingUtilities::getRootDataDir() . "/output/compress85.jpg", + 50 => TestingUtilities::getRootDataDir() . "/output/compress50.jpg", + 10 => TestingUtilities::getRootDataDir() . "/output/compress10.jpg", + 1 => TestingUtilities::getRootDataDir() . "/output/compress1.jpg", ]; $compressSize = []; @@ -285,9 +286,9 @@ public function testDirectImageQualityCompression() public function testPDFSourceText() { - $imageInput = $this->dummyClient->sourceFromPath(\TestingUtilities::getFileTypesDir() . '/receipt.jpg'); - $pdfEmptyInput = $this->dummyClient->sourceFromPath(\TestingUtilities::getFileTypesDir() . '/pdf/blank_1.pdf'); - $pdfSourceText = $this->dummyClient->sourceFromPath(\TestingUtilities::getFileTypesDir() . '/pdf/multipage.pdf'); + $imageInput = $this->dummyClient->sourceFromPath(TestingUtilities::getFileTypesDir() . '/receipt.jpg'); + $pdfEmptyInput = $this->dummyClient->sourceFromPath(TestingUtilities::getFileTypesDir() . '/pdf/blank_1.pdf'); + $pdfSourceText = $this->dummyClient->sourceFromPath(TestingUtilities::getFileTypesDir() . '/pdf/multipage.pdf'); $this->assertTrue($pdfSourceText->hasSourceText(), "Source text should be properly detected."); $this->assertFalse($pdfEmptyInput->hasSourceText(), "Empty PDFs should not have source text detected."); $this->assertFalse($imageInput->hasSourceText(), "An image should not have any text."); @@ -296,33 +297,33 @@ public function testPDFSourceText() public function testCompressPDFFromInputSource() { $pdfInput = $this->dummyClient->sourceFromPath( - \TestingUtilities::getFileTypesDir() . "/pdf/not_blank_image_only.pdf" + TestingUtilities::getFileTypesDir() . "/pdf/not_blank_image_only.pdf" ); $this->assertFalse($pdfInput->hasSourceText()); file_put_contents( - \TestingUtilities::getRootDataDir() . "/output/not_compressed.pdf", + TestingUtilities::getRootDataDir() . "/output/not_compressed.pdf", file_get_contents($pdfInput->fileObject->getFilename()) ); - $sizeOriginal = filesize(\TestingUtilities::getFileTypesDir() . '/pdf/not_blank_image_only.pdf'); - $sizeIgnored = filesize(\TestingUtilities::getRootDataDir() . "/output/not_compressed.pdf"); + $sizeOriginal = filesize(TestingUtilities::getFileTypesDir() . '/pdf/not_blank_image_only.pdf'); + $sizeIgnored = filesize(TestingUtilities::getRootDataDir() . "/output/not_compressed.pdf"); $this->assertEquals($sizeIgnored, $sizeOriginal); $pdfInput->compress(90, null, null, true, false); file_put_contents( - \TestingUtilities::getRootDataDir() . "/output/compress_indirect.pdf", + TestingUtilities::getRootDataDir() . "/output/compress_indirect.pdf", file_get_contents($pdfInput->fileObject->getFilename()) ); - $sizeCompressed = filesize(\TestingUtilities::getRootDataDir() . '/output/compress_indirect.pdf'); + $sizeCompressed = filesize(TestingUtilities::getRootDataDir() . '/output/compress_indirect.pdf'); $this->assertLessThan($sizeOriginal, $sizeCompressed); } public function testCompressPDFFromCompressor() { $pdfInput = $this->dummyClient->sourceFromPath( - \TestingUtilities::getV1DataDir() . '/products/invoice_splitter/default_sample.pdf' + TestingUtilities::getV1DataDir() . '/products/invoice_splitter/default_sample.pdf' ); - $sizeOriginal = filesize(\TestingUtilities::getV1DataDir() . '/products/invoice_splitter/default_sample.pdf'); + $sizeOriginal = filesize(TestingUtilities::getV1DataDir() . '/products/invoice_splitter/default_sample.pdf'); $this->assertFalse($pdfInput->hasSourceText()); $pdfCompresses = [ @@ -332,10 +333,10 @@ public function testCompressPDFFromCompressor() 10 => PDFCompressor::compress($pdfInput->fileObject, 10), ]; $outputFiles = [ - 85 => \TestingUtilities::getRootDataDir() . "/output/compress_direct_85.pdf", - 75 => \TestingUtilities::getRootDataDir() . "/output/compress_direct_75.pdf", - 50 => \TestingUtilities::getRootDataDir() . "/output/compress_direct_50.pdf", - 10 => \TestingUtilities::getRootDataDir() . "/output/compress_direct_10.pdf", + 85 => TestingUtilities::getRootDataDir() . "/output/compress_direct_85.pdf", + 75 => TestingUtilities::getRootDataDir() . "/output/compress_direct_75.pdf", + 50 => TestingUtilities::getRootDataDir() . "/output/compress_direct_50.pdf", + 10 => TestingUtilities::getRootDataDir() . "/output/compress_direct_10.pdf", ]; $compressSize = []; @@ -356,25 +357,25 @@ public function testSourceTextPDFCompression() { $pdfInput = $this->dummyClient->sourceFromPath( - \TestingUtilities::getFileTypesDir() . "/pdf/multipage.pdf" + TestingUtilities::getFileTypesDir() . "/pdf/multipage.pdf" ); $this->assertTrue($pdfInput->hasSourceText()); $pdfInput->compress(5, null, null, true, false); file_put_contents( - \TestingUtilities::getRootDataDir() . "/output/text_multipage.pdf", + TestingUtilities::getRootDataDir() . "/output/text_multipage.pdf", file_get_contents($pdfInput->fileObject->getFilename()) ); - $sizeOriginal = filesize(\TestingUtilities::getFileTypesDir() . "/pdf/multipage.pdf"); - $sizeTextCompressed = filesize(\TestingUtilities::getRootDataDir() . "/output/text_multipage.pdf"); + $sizeOriginal = filesize(TestingUtilities::getFileTypesDir() . "/pdf/multipage.pdf"); + $sizeTextCompressed = filesize(TestingUtilities::getRootDataDir() . "/output/text_multipage.pdf"); $this->assertEquals($sizeTextCompressed, $sizeOriginal); // Note: Greater size when compressed is expected due to original not having any images, so the operation will // be aborted. $this->assertEquals( str_repeat('*', 650), - implode('', str_replace(" ", "", PDFUtils::extractPagesTextElements(\TestingUtilities::getRootDataDir() . "/output/text_multipage.pdf"))) + implode('', str_replace(" ", "", PDFUtils::extractPagesTextElements(TestingUtilities::getRootDataDir() . "/output/text_multipage.pdf"))) ); } } diff --git a/tests/V1/Error/MindeeHttpExceptionTest.php b/tests/V1/Error/MindeeHttpExceptionTest.php index fbd68d16..1a248b0e 100644 --- a/tests/V1/Error/MindeeHttpExceptionTest.php +++ b/tests/V1/Error/MindeeHttpExceptionTest.php @@ -5,8 +5,8 @@ use Mindee\Error\MindeeHttpClientException; use Mindee\Error\MindeeHttpException; use Mindee\Input\PathInput; -use Mindee\Product\Invoice\InvoiceV4; use Mindee\V1\Client; +use Mindee\V1\Product\Invoice\InvoiceV4; use PHPUnit\Framework\TestCase; class MindeeHttpExceptionTest extends TestCase diff --git a/tests/V1/Extraction/ImageExtractorTest.php b/tests/V1/Extraction/ImageExtractorTest.php index 6d8a08fd..d38c2451 100644 --- a/tests/V1/Extraction/ImageExtractorTest.php +++ b/tests/V1/Extraction/ImageExtractorTest.php @@ -4,10 +4,10 @@ use Mindee\Input\LocalResponse; use Mindee\Input\PathInput; -use Mindee\Product\BarcodeReader\BarcodeReaderV1; -use Mindee\Product\MultiReceiptsDetector\MultiReceiptsDetectorV1; use Mindee\V1\Client; use Mindee\V1\Image\ImageExtractor; +use Mindee\V1\Product\BarcodeReader\BarcodeReaderV1; +use Mindee\V1\Product\MultiReceiptsDetector\MultiReceiptsDetectorV1; use PHPUnit\Framework\TestCase; class ImageExtractorTest extends TestCase @@ -82,7 +82,7 @@ public function testGivenAnImageShouldExtractValueFields() } } - public function testGivenAPdfShouldExtractPositionFields() + public function testGivenAPDFShouldExtractPositionFields() { $imageInput = new PathInput( \TestingUtilities::getV1DataDir() . "/products/multi_receipts_detector/multipage_sample.pdf" diff --git a/tests/V1/Extraction/InvoiceSplitterAutoExtractionTestFunctional.php b/tests/V1/Extraction/InvoiceSplitterAutoExtractionTestFunctional.php index 941b55af..ea698572 100644 --- a/tests/V1/Extraction/InvoiceSplitterAutoExtractionTestFunctional.php +++ b/tests/V1/Extraction/InvoiceSplitterAutoExtractionTestFunctional.php @@ -2,18 +2,18 @@ namespace V1\Extraction; -use Mindee\Extraction\PdfExtractor; +use Mindee\Extraction\PDFExtractor; use Mindee\Input\PathInput; -use Mindee\Parsing\Common\Document; -use Mindee\Product\Invoice\InvoiceV4; -use Mindee\Product\InvoiceSplitter\InvoiceSplitterV1; use Mindee\V1\Client; +use Mindee\V1\Parsing\Common\Document; +use Mindee\V1\Product\Invoice\InvoiceV4; +use Mindee\V1\Product\InvoiceSplitter\InvoiceSplitterV1; use PHPUnit\Framework\TestCase; use TestingUtilities; require_once(__DIR__ . "/../../TestingUtilities.php"); -class PdfExtractorTest extends TestCase +class PDFExtractorTest extends TestCase { private const PRODUCT_DATA_DIR = '/tests/resources/products'; @@ -30,7 +30,7 @@ private function prepareInvoiceReturn(string $rstFilePath, Document $invoicePred * @test * @group functional */ - public function testPdfShouldExtractInvoicesStrict() + public function testPDFShouldExtractInvoicesStrict() { $client = new Client(); $invoiceSplitterInput = new PathInput( @@ -38,7 +38,7 @@ public function testPdfShouldExtractInvoicesStrict() ); $response = $client->enqueueAndParse(InvoiceSplitterV1::class, $invoiceSplitterInput); $inference = $response->document->inference; - $pdfExtractor = new PdfExtractor($invoiceSplitterInput); + $pdfExtractor = new PDFExtractor($invoiceSplitterInput); $this->assertEquals(2, $pdfExtractor->getPageCount()); $extractedPdfsStrict = $pdfExtractor->extractInvoices($inference->prediction->invoicePageGroups); diff --git a/tests/V1/Extraction/PdfExtractorTest.php b/tests/V1/Extraction/PDFExtractorTest.php similarity index 89% rename from tests/V1/Extraction/PdfExtractorTest.php rename to tests/V1/Extraction/PDFExtractorTest.php index e2b007f7..4a16da31 100644 --- a/tests/V1/Extraction/PdfExtractorTest.php +++ b/tests/V1/Extraction/PDFExtractorTest.php @@ -3,14 +3,14 @@ namespace V1\Extraction; -use Mindee\Extraction\PdfExtractor; +use Mindee\Extraction\PDFExtractor; use Mindee\Input\LocalResponse; use Mindee\Input\PathInput; -use Mindee\Product\InvoiceSplitter\InvoiceSplitterV1; use Mindee\V1\Client; +use Mindee\V1\Product\InvoiceSplitter\InvoiceSplitterV1; use PHPUnit\Framework\TestCase; -class PdfExtractorTest extends TestCase +class PDFExtractorTest extends TestCase { private Client $dummyClient; @@ -23,8 +23,8 @@ public function testGivenAnImageShouldExtractAPDF() { $jpg = \TestingUtilities::getV1DataDir() . "/products/invoices/default_sample.jpg"; $localInput = new PathInput($jpg); - $this->assertFalse($localInput->isPdf()); - $extractor = new PdfExtractor($localInput); + $this->assertFalse($localInput->isPDF()); + $extractor = new PDFExtractor($localInput); $this->assertEquals(1, $extractor->getPageCount()); } @@ -37,7 +37,7 @@ public function testGivenAPDFShouldExtractInvoicesNoStrict() $response = $this->getPrediction(); $this->assertNotNull($response); $inference = $response->document->inference; - $extractor = new PdfExtractor($pdf); + $extractor = new PDFExtractor($pdf); $this->assertEquals(5, $extractor->getPageCount()); $extractedPDFSNoStrict = $extractor->extractInvoices($inference->prediction->invoicePageGroups); @@ -60,7 +60,7 @@ public function testGivenAPDFShouldExtractInvoicesStrict() $this->assertNotNull($response); $inference = $response->document->inference; - $extractor = new PdfExtractor($pdf); + $extractor = new PDFExtractor($pdf); $this->assertEquals(5, $extractor->getPageCount()); $extractedPDFStrict = $extractor->extractInvoices($inference->prediction->invoicePageGroups, true); diff --git a/tests/V1/Http/MindeeApiTest.php b/tests/V1/Http/MindeeApiTest.php index 8695011e..5776a4a8 100644 --- a/tests/V1/Http/MindeeApiTest.php +++ b/tests/V1/Http/MindeeApiTest.php @@ -3,8 +3,8 @@ namespace V1\Http; use Mindee\Error\MindeeException; -use Mindee\Product\InvoiceSplitter\InvoiceSplitterV1; use Mindee\V1\HTTP\MindeeAPI; +use Mindee\V1\Product\InvoiceSplitter\InvoiceSplitterV1; use PHPUnit\Framework\TestCase; use const Mindee\V1\HTTP\API_KEY_ENV_NAME; diff --git a/tests/V1/Input/URLInputSourceTestFunctional.php b/tests/V1/Input/URLInputSourceTestFunctional.php index 596e8043..20800724 100644 --- a/tests/V1/Input/URLInputSourceTestFunctional.php +++ b/tests/V1/Input/URLInputSourceTestFunctional.php @@ -2,8 +2,8 @@ namespace V1\Input; -use Mindee\Product\Invoice\InvoiceV4; use Mindee\V1\Client; +use Mindee\V1\Product\Invoice\InvoiceV4; use PHPUnit\Framework\TestCase; class URLInputSourceTestFunctional extends TestCase diff --git a/tests/V1/Parsing/Common/AsyncPredictResponseTest.php b/tests/V1/Parsing/Common/AsyncPredictResponseTest.php index de3e8f41..4911915c 100644 --- a/tests/V1/Parsing/Common/AsyncPredictResponseTest.php +++ b/tests/V1/Parsing/Common/AsyncPredictResponseTest.php @@ -2,9 +2,9 @@ namespace V1\Parsing\Common; -use Mindee\Parsing\Common\AsyncPredictResponse; -use Mindee\Product\InvoiceSplitter\InvoiceSplitterV1; use Mindee\V1\HTTP\ResponseValidation; +use Mindee\V1\Parsing\Common\AsyncPredictResponse; +use Mindee\V1\Product\InvoiceSplitter\InvoiceSplitterV1; use PHPUnit\Framework\TestCase; class AsyncPredictResponseTest extends TestCase diff --git a/tests/V1/Parsing/Common/Extras/CropperExtraTest.php b/tests/V1/Parsing/Common/Extras/CropperExtraTest.php index daf6fd75..7805073a 100644 --- a/tests/V1/Parsing/Common/Extras/CropperExtraTest.php +++ b/tests/V1/Parsing/Common/Extras/CropperExtraTest.php @@ -2,9 +2,9 @@ namespace V1\Parsing\Common\Extras; -use Mindee\Parsing\Common\Document; -use Mindee\Product\Receipt\ReceiptV5; use Mindee\V1\ClientOptions\PredictOptions; +use Mindee\V1\Parsing\Common\Document; +use Mindee\V1\Product\Receipt\ReceiptV5; use PHPUnit\Framework\TestCase; class CropperExtraTest extends TestCase diff --git a/tests/V1/Parsing/Common/Extras/ExtrasIntegrationFunctional.php b/tests/V1/Parsing/Common/Extras/ExtrasIntegrationFunctional.php index 976f1d69..35486c32 100644 --- a/tests/V1/Parsing/Common/Extras/ExtrasIntegrationFunctional.php +++ b/tests/V1/Parsing/Common/Extras/ExtrasIntegrationFunctional.php @@ -2,11 +2,11 @@ namespace V1\Parsing\Common\Extras; -use Mindee\Product\InternationalId\InternationalIdV2; -use Mindee\Product\Invoice\InvoiceV4; use Mindee\V1\Client; use Mindee\V1\ClientOptions\PredictMethodOptions; use Mindee\V1\ClientOptions\PredictOptions; +use Mindee\V1\Product\InternationalId\InternationalIdV2; +use Mindee\V1\Product\Invoice\InvoiceV4; use PHPUnit\Framework\TestCase; class ExtrasIntegrationFunctional extends TestCase diff --git a/tests/V1/Parsing/Common/Extras/FullTextOcrExtraTest.php b/tests/V1/Parsing/Common/Extras/FullTextOcrExtraTest.php index 964826ac..efeeece1 100644 --- a/tests/V1/Parsing/Common/Extras/FullTextOcrExtraTest.php +++ b/tests/V1/Parsing/Common/Extras/FullTextOcrExtraTest.php @@ -2,7 +2,7 @@ namespace V1\Parsing\Common\Extras; -use Mindee\Product\InternationalId\InternationalIdV2; +use Mindee\V1\Product\InternationalId\InternationalIdV2; use PHPUnit\Framework\TestCase; class FullTextOCRTest extends TestCase diff --git a/tests/V1/Parsing/Common/Ocr/OcrTest.php b/tests/V1/Parsing/Common/OCR/OCRTest.php similarity index 88% rename from tests/V1/Parsing/Common/Ocr/OcrTest.php rename to tests/V1/Parsing/Common/OCR/OCRTest.php index 0fd958d3..334bd12f 100644 --- a/tests/V1/Parsing/Common/Ocr/OcrTest.php +++ b/tests/V1/Parsing/Common/OCR/OCRTest.php @@ -1,19 +1,19 @@ ocrObject = new Ocr($jsonData["document"]["ocr"]); + $this->ocrObject = new OCR($jsonData["document"]["ocr"]); } public function testResponse() { diff --git a/tests/V1/Parsing/Common/PredictResponseTest.php b/tests/V1/Parsing/Common/PredictResponseTest.php index ebcd8359..aa2bd5db 100644 --- a/tests/V1/Parsing/Common/PredictResponseTest.php +++ b/tests/V1/Parsing/Common/PredictResponseTest.php @@ -2,9 +2,9 @@ namespace V1\Parsing\Common; -use Mindee\Parsing\Common\PredictResponse; -use Mindee\Product\Invoice\InvoiceV4; -use Mindee\Product\Invoice\InvoiceV4Document; +use Mindee\V1\Parsing\Common\PredictResponse; +use Mindee\V1\Product\Invoice\InvoiceV4; +use Mindee\V1\Product\Invoice\InvoiceV4Document; use PHPUnit\Framework\TestCase; class PredictResponseTest extends TestCase diff --git a/tests/V1/Product/BarcodeReader/BarcodeReaderV1Test.php b/tests/V1/Product/BarcodeReader/BarcodeReaderV1Test.php index a3302b99..6ee6fc17 100644 --- a/tests/V1/Product/BarcodeReader/BarcodeReaderV1Test.php +++ b/tests/V1/Product/BarcodeReader/BarcodeReaderV1Test.php @@ -2,8 +2,8 @@ namespace V1\Product\BarcodeReader; -use Mindee\Parsing\Common\Document; use Mindee\Product\BarcodeReader; +use Mindee\V1\Parsing\Common\Document; use PHPUnit\Framework\TestCase; class BarcodeReaderV1Test extends TestCase @@ -19,8 +19,8 @@ protected function setUp(): void $emptyDocFile = file_get_contents($productDir . "empty.json"); $completeDocJSON = json_decode($completeDocFile, true); $emptyDocJSON = json_decode($emptyDocFile, true); - $this->completeDoc = new Document(BarcodeReader\BarcodeReaderV1::class, $completeDocJSON["document"]); - $this->emptyDoc = new Document(BarcodeReader\BarcodeReaderV1::class, $emptyDocJSON["document"]); + $this->completeDoc = new Document(\Mindee\V1\Product\BarcodeReader\BarcodeReaderV1::class, $completeDocJSON["document"]); + $this->emptyDoc = new Document(\Mindee\V1\Product\BarcodeReader\BarcodeReaderV1::class, $emptyDocJSON["document"]); $this->completeDocReference = file_get_contents($productDir . "summary_full.rst"); } diff --git a/tests/V1/Product/BillOfLading/BillOfLadingV1Test.php b/tests/V1/Product/BillOfLading/BillOfLadingV1Test.php index 9970cdc8..1eb0e60b 100644 --- a/tests/V1/Product/BillOfLading/BillOfLadingV1Test.php +++ b/tests/V1/Product/BillOfLading/BillOfLadingV1Test.php @@ -2,8 +2,8 @@ namespace V1\Product\BillOfLading; -use Mindee\Parsing\Common\Document; use Mindee\Product\BillOfLading; +use Mindee\V1\Parsing\Common\Document; use PHPUnit\Framework\TestCase; class BillOfLadingV1Test extends TestCase @@ -19,8 +19,8 @@ protected function setUp(): void $emptyDocFile = file_get_contents($productDir . "empty.json"); $completeDocJSON = json_decode($completeDocFile, true); $emptyDocJSON = json_decode($emptyDocFile, true); - $this->completeDoc = new Document(BillOfLading\BillOfLadingV1::class, $completeDocJSON["document"]); - $this->emptyDoc = new Document(BillOfLading\BillOfLadingV1::class, $emptyDocJSON["document"]); + $this->completeDoc = new Document(\Mindee\V1\Product\BillOfLading\BillOfLadingV1::class, $completeDocJSON["document"]); + $this->emptyDoc = new Document(\Mindee\V1\Product\BillOfLading\BillOfLadingV1::class, $emptyDocJSON["document"]); $this->completeDocReference = file_get_contents($productDir . "summary_full.rst"); } diff --git a/tests/V1/Product/BusinessCard/BusinessCardV1Test.php b/tests/V1/Product/BusinessCard/BusinessCardV1Test.php index cbfcf915..9096142b 100644 --- a/tests/V1/Product/BusinessCard/BusinessCardV1Test.php +++ b/tests/V1/Product/BusinessCard/BusinessCardV1Test.php @@ -2,8 +2,8 @@ namespace V1\Product\BusinessCard; -use Mindee\Parsing\Common\Document; use Mindee\Product\BusinessCard; +use Mindee\V1\Parsing\Common\Document; use PHPUnit\Framework\TestCase; class BusinessCardV1Test extends TestCase @@ -19,8 +19,8 @@ protected function setUp(): void $emptyDocFile = file_get_contents($productDir . "empty.json"); $completeDocJSON = json_decode($completeDocFile, true); $emptyDocJSON = json_decode($emptyDocFile, true); - $this->completeDoc = new Document(BusinessCard\BusinessCardV1::class, $completeDocJSON["document"]); - $this->emptyDoc = new Document(BusinessCard\BusinessCardV1::class, $emptyDocJSON["document"]); + $this->completeDoc = new Document(\Mindee\V1\Product\BusinessCard\BusinessCardV1::class, $completeDocJSON["document"]); + $this->emptyDoc = new Document(\Mindee\V1\Product\BusinessCard\BusinessCardV1::class, $emptyDocJSON["document"]); $this->completeDocReference = file_get_contents($productDir . "summary_full.rst"); } diff --git a/tests/V1/Product/Cropper/CropperV1Test.php b/tests/V1/Product/Cropper/CropperV1Test.php index 2807bd2d..cb081218 100644 --- a/tests/V1/Product/Cropper/CropperV1Test.php +++ b/tests/V1/Product/Cropper/CropperV1Test.php @@ -2,9 +2,9 @@ namespace V1\Product\Cropper; -use Mindee\Parsing\Common\Document; -use Mindee\Parsing\Common\Page; use Mindee\Product\Cropper; +use Mindee\V1\Parsing\Common\Document; +use Mindee\V1\Parsing\Common\Page; use PHPUnit\Framework\TestCase; class CropperV1Test extends TestCase @@ -22,9 +22,9 @@ protected function setUp(): void $emptyDocFile = file_get_contents($productDir . "empty.json"); $completeDocJSON = json_decode($completeDocFile, true); $emptyDocJSON = json_decode($emptyDocFile, true); - $this->completeDoc = new Document(Cropper\CropperV1::class, $completeDocJSON["document"]); - $this->emptyDoc = new Document(Cropper\CropperV1::class, $emptyDocJSON["document"]); - $this->completePage0 = new Page(Cropper\CropperV1Page::class, $completeDocJSON["document"]["inference"]["pages"][0]); + $this->completeDoc = new Document(\Mindee\V1\Product\Cropper\CropperV1::class, $completeDocJSON["document"]); + $this->emptyDoc = new Document(\Mindee\V1\Product\Cropper\CropperV1::class, $emptyDocJSON["document"]); + $this->completePage0 = new Page(\Mindee\V1\Product\Cropper\CropperV1Page::class, $completeDocJSON["document"]["inference"]["pages"][0]); $this->completeDocReference = file_get_contents($productDir . "summary_full.rst"); $this->completePage0Reference = file_get_contents($productDir . "summary_page0.rst"); } diff --git a/tests/V1/Product/DeliveryNote/DeliveryNoteV1Test.php b/tests/V1/Product/DeliveryNote/DeliveryNoteV1Test.php index 2ff3f366..083b6c47 100644 --- a/tests/V1/Product/DeliveryNote/DeliveryNoteV1Test.php +++ b/tests/V1/Product/DeliveryNote/DeliveryNoteV1Test.php @@ -2,8 +2,8 @@ namespace V1\Product\DeliveryNote; -use Mindee\Parsing\Common\Document; use Mindee\Product\DeliveryNote; +use Mindee\V1\Parsing\Common\Document; use PHPUnit\Framework\TestCase; class DeliveryNoteV1Test extends TestCase @@ -19,8 +19,8 @@ protected function setUp(): void $emptyDocFile = file_get_contents($productDir . "empty.json"); $completeDocJSON = json_decode($completeDocFile, true); $emptyDocJSON = json_decode($emptyDocFile, true); - $this->completeDoc = new Document(DeliveryNote\DeliveryNoteV1::class, $completeDocJSON["document"]); - $this->emptyDoc = new Document(DeliveryNote\DeliveryNoteV1::class, $emptyDocJSON["document"]); + $this->completeDoc = new Document(\Mindee\V1\Product\DeliveryNote\DeliveryNoteV1::class, $completeDocJSON["document"]); + $this->emptyDoc = new Document(\Mindee\V1\Product\DeliveryNote\DeliveryNoteV1::class, $emptyDocJSON["document"]); $this->completeDocReference = file_get_contents($productDir . "summary_full.rst"); } diff --git a/tests/V1/Product/DriverLicense/DriverLicenseV1Test.php b/tests/V1/Product/DriverLicense/DriverLicenseV1Test.php index 729fb748..18722d57 100644 --- a/tests/V1/Product/DriverLicense/DriverLicenseV1Test.php +++ b/tests/V1/Product/DriverLicense/DriverLicenseV1Test.php @@ -2,8 +2,8 @@ namespace V1\Product\DriverLicense; -use Mindee\Parsing\Common\Document; use Mindee\Product\DriverLicense; +use Mindee\V1\Parsing\Common\Document; use PHPUnit\Framework\TestCase; class DriverLicenseV1Test extends TestCase @@ -19,8 +19,8 @@ protected function setUp(): void $emptyDocFile = file_get_contents($productDir . "empty.json"); $completeDocJSON = json_decode($completeDocFile, true); $emptyDocJSON = json_decode($emptyDocFile, true); - $this->completeDoc = new Document(DriverLicense\DriverLicenseV1::class, $completeDocJSON["document"]); - $this->emptyDoc = new Document(DriverLicense\DriverLicenseV1::class, $emptyDocJSON["document"]); + $this->completeDoc = new Document(\Mindee\V1\Product\DriverLicense\DriverLicenseV1::class, $completeDocJSON["document"]); + $this->emptyDoc = new Document(\Mindee\V1\Product\DriverLicense\DriverLicenseV1::class, $emptyDocJSON["document"]); $this->completeDocReference = file_get_contents($productDir . "summary_full.rst"); } diff --git a/tests/V1/Product/FinancialDocument/FinancialDocumentV1Test.php b/tests/V1/Product/FinancialDocument/FinancialDocumentV1Test.php index 6182e57b..c26adc17 100644 --- a/tests/V1/Product/FinancialDocument/FinancialDocumentV1Test.php +++ b/tests/V1/Product/FinancialDocument/FinancialDocumentV1Test.php @@ -2,9 +2,9 @@ namespace V1\Product\FinancialDocument; -use Mindee\Parsing\Common\Document; -use Mindee\Parsing\Common\Page; use Mindee\Product\FinancialDocument; +use Mindee\V1\Parsing\Common\Document; +use Mindee\V1\Parsing\Common\Page; use PHPUnit\Framework\TestCase; class FinancialDocumentV1Test extends TestCase @@ -28,11 +28,11 @@ protected function setUp(): void $completeDocJSONInvoice = json_decode($completeDocFileInvoice, true); $completeDocJSONReceipt = json_decode($completeDocFileReceipt, true); $emptyDocJSON = json_decode($emptyDocFile, true); - $this->completeDocInvoice = new Document(FinancialDocument\FinancialDocumentV1::class, $completeDocJSONInvoice["document"]); - $this->completeDocReceipt = new Document(FinancialDocument\FinancialDocumentV1::class, $completeDocJSONReceipt["document"]); - $this->emptyDoc = new Document(FinancialDocument\FinancialDocumentV1::class, $emptyDocJSON["document"]); - $this->completePage0Invoice = new Page(FinancialDocument\FinancialDocumentV1Document::class, $completeDocJSONInvoice["document"]["inference"]["pages"][0]); - $this->completePage0Receipt = new Page(FinancialDocument\FinancialDocumentV1Document::class, $completeDocJSONReceipt["document"]["inference"]["pages"][0]); + $this->completeDocInvoice = new Document(\Mindee\V1\Product\FinancialDocument\FinancialDocumentV1::class, $completeDocJSONInvoice["document"]); + $this->completeDocReceipt = new Document(\Mindee\V1\Product\FinancialDocument\FinancialDocumentV1::class, $completeDocJSONReceipt["document"]); + $this->emptyDoc = new Document(\Mindee\V1\Product\FinancialDocument\FinancialDocumentV1::class, $emptyDocJSON["document"]); + $this->completePage0Invoice = new Page(\Mindee\V1\Product\FinancialDocument\FinancialDocumentV1Document::class, $completeDocJSONInvoice["document"]["inference"]["pages"][0]); + $this->completePage0Receipt = new Page(\Mindee\V1\Product\FinancialDocument\FinancialDocumentV1Document::class, $completeDocJSONReceipt["document"]["inference"]["pages"][0]); $this->completeDocReferenceInvoice = file_get_contents($productDir . "summary_full_invoice.rst"); $this->completeDocReferenceReceipt = file_get_contents($productDir . "summary_full_receipt.rst"); $this->completePage0ReferenceInvoice = file_get_contents($productDir . "summary_page0_invoice.rst"); diff --git a/tests/V1/Product/Fr/BankAccountDetails/BankAccountDetailsV1Test.php b/tests/V1/Product/Fr/BankAccountDetails/BankAccountDetailsV1Test.php index 0a06bfd2..0afebde3 100644 --- a/tests/V1/Product/Fr/BankAccountDetails/BankAccountDetailsV1Test.php +++ b/tests/V1/Product/Fr/BankAccountDetails/BankAccountDetailsV1Test.php @@ -2,8 +2,8 @@ namespace V1\Product\Fr\BankAccountDetails; -use Mindee\Parsing\Common\Document; use Mindee\Product\Fr\BankAccountDetails; +use Mindee\V1\Parsing\Common\Document; use PHPUnit\Framework\TestCase; class BankAccountDetailsV1Test extends TestCase @@ -19,8 +19,8 @@ protected function setUp(): void $emptyDocFile = file_get_contents($productDir . "empty.json"); $completeDocJSON = json_decode($completeDocFile, true); $emptyDocJSON = json_decode($emptyDocFile, true); - $this->completeDoc = new Document(BankAccountDetails\BankAccountDetailsV1::class, $completeDocJSON["document"]); - $this->emptyDoc = new Document(BankAccountDetails\BankAccountDetailsV1::class, $emptyDocJSON["document"]); + $this->completeDoc = new Document(\Mindee\V1\Product\Fr\BankAccountDetails\BankAccountDetailsV1::class, $completeDocJSON["document"]); + $this->emptyDoc = new Document(\Mindee\V1\Product\Fr\BankAccountDetails\BankAccountDetailsV1::class, $emptyDocJSON["document"]); $this->completeDocReference = file_get_contents($productDir . "summary_full.rst"); } diff --git a/tests/V1/Product/Fr/BankAccountDetails/BankAccountDetailsV2Test.php b/tests/V1/Product/Fr/BankAccountDetails/BankAccountDetailsV2Test.php index 3e6d129e..7b92f2ca 100644 --- a/tests/V1/Product/Fr/BankAccountDetails/BankAccountDetailsV2Test.php +++ b/tests/V1/Product/Fr/BankAccountDetails/BankAccountDetailsV2Test.php @@ -2,8 +2,8 @@ namespace V1\Product\Fr\BankAccountDetails; -use Mindee\Parsing\Common\Document; use Mindee\Product\Fr\BankAccountDetails; +use Mindee\V1\Parsing\Common\Document; use PHPUnit\Framework\TestCase; class BankAccountDetailsV2Test extends TestCase @@ -19,8 +19,8 @@ protected function setUp(): void $emptyDocFile = file_get_contents($productDir . "empty.json"); $completeDocJSON = json_decode($completeDocFile, true); $emptyDocJSON = json_decode($emptyDocFile, true); - $this->completeDoc = new Document(BankAccountDetails\BankAccountDetailsV2::class, $completeDocJSON["document"]); - $this->emptyDoc = new Document(BankAccountDetails\BankAccountDetailsV2::class, $emptyDocJSON["document"]); + $this->completeDoc = new Document(\Mindee\V1\Product\Fr\BankAccountDetails\BankAccountDetailsV2::class, $completeDocJSON["document"]); + $this->emptyDoc = new Document(\Mindee\V1\Product\Fr\BankAccountDetails\BankAccountDetailsV2::class, $emptyDocJSON["document"]); $this->completeDocReference = file_get_contents($productDir . "summary_full.rst"); } diff --git a/tests/V1/Product/Fr/CarteGrise/CarteGriseV1Test.php b/tests/V1/Product/Fr/CarteGrise/CarteGriseV1Test.php index ce17ea28..57d859ad 100644 --- a/tests/V1/Product/Fr/CarteGrise/CarteGriseV1Test.php +++ b/tests/V1/Product/Fr/CarteGrise/CarteGriseV1Test.php @@ -2,8 +2,8 @@ namespace V1\Product\Fr\CarteGrise; -use Mindee\Parsing\Common\Document; use Mindee\Product\Fr\CarteGrise; +use Mindee\V1\Parsing\Common\Document; use PHPUnit\Framework\TestCase; class CarteGriseV1Test extends TestCase @@ -19,8 +19,8 @@ protected function setUp(): void $emptyDocFile = file_get_contents($productDir . "empty.json"); $completeDocJSON = json_decode($completeDocFile, true); $emptyDocJSON = json_decode($emptyDocFile, true); - $this->completeDoc = new Document(CarteGrise\CarteGriseV1::class, $completeDocJSON["document"]); - $this->emptyDoc = new Document(CarteGrise\CarteGriseV1::class, $emptyDocJSON["document"]); + $this->completeDoc = new Document(\Mindee\V1\Product\Fr\CarteGrise\CarteGriseV1::class, $completeDocJSON["document"]); + $this->emptyDoc = new Document(\Mindee\V1\Product\Fr\CarteGrise\CarteGriseV1::class, $emptyDocJSON["document"]); $this->completeDocReference = file_get_contents($productDir . "summary_full.rst"); } diff --git a/tests/V1/Product/Fr/EnergyBill/EnergyBillV1Test.php b/tests/V1/Product/Fr/EnergyBill/EnergyBillV1Test.php index 20c64e57..1d8166e0 100644 --- a/tests/V1/Product/Fr/EnergyBill/EnergyBillV1Test.php +++ b/tests/V1/Product/Fr/EnergyBill/EnergyBillV1Test.php @@ -2,8 +2,8 @@ namespace V1\Product\Fr\EnergyBill; -use Mindee\Parsing\Common\Document; use Mindee\Product\Fr\EnergyBill; +use Mindee\V1\Parsing\Common\Document; use PHPUnit\Framework\TestCase; class EnergyBillV1Test extends TestCase @@ -19,8 +19,8 @@ protected function setUp(): void $emptyDocFile = file_get_contents($productDir . "empty.json"); $completeDocJSON = json_decode($completeDocFile, true); $emptyDocJSON = json_decode($emptyDocFile, true); - $this->completeDoc = new Document(EnergyBill\EnergyBillV1::class, $completeDocJSON["document"]); - $this->emptyDoc = new Document(EnergyBill\EnergyBillV1::class, $emptyDocJSON["document"]); + $this->completeDoc = new Document(\Mindee\V1\Product\Fr\EnergyBill\EnergyBillV1::class, $completeDocJSON["document"]); + $this->emptyDoc = new Document(\Mindee\V1\Product\Fr\EnergyBill\EnergyBillV1::class, $emptyDocJSON["document"]); $this->completeDocReference = file_get_contents($productDir . "summary_full.rst"); } diff --git a/tests/V1/Product/Fr/HealthCard/HealthCardV1Test.php b/tests/V1/Product/Fr/HealthCard/HealthCardV1Test.php index b9e53ab8..802e6d2c 100644 --- a/tests/V1/Product/Fr/HealthCard/HealthCardV1Test.php +++ b/tests/V1/Product/Fr/HealthCard/HealthCardV1Test.php @@ -2,8 +2,8 @@ namespace V1\Product\Fr\HealthCard; -use Mindee\Parsing\Common\Document; use Mindee\Product\Fr\HealthCard; +use Mindee\V1\Parsing\Common\Document; use PHPUnit\Framework\TestCase; class HealthCardV1Test extends TestCase @@ -19,8 +19,8 @@ protected function setUp(): void $emptyDocFile = file_get_contents($productDir . "empty.json"); $completeDocJSON = json_decode($completeDocFile, true); $emptyDocJSON = json_decode($emptyDocFile, true); - $this->completeDoc = new Document(HealthCard\HealthCardV1::class, $completeDocJSON["document"]); - $this->emptyDoc = new Document(HealthCard\HealthCardV1::class, $emptyDocJSON["document"]); + $this->completeDoc = new Document(\Mindee\V1\Product\Fr\HealthCard\HealthCardV1::class, $completeDocJSON["document"]); + $this->emptyDoc = new Document(\Mindee\V1\Product\Fr\HealthCard\HealthCardV1::class, $emptyDocJSON["document"]); $this->completeDocReference = file_get_contents($productDir . "summary_full.rst"); } diff --git a/tests/V1/Product/Fr/IdCard/IdCardV1Test.php b/tests/V1/Product/Fr/IdCard/IdCardV1Test.php index 41e5060f..0fecdcb8 100644 --- a/tests/V1/Product/Fr/IdCard/IdCardV1Test.php +++ b/tests/V1/Product/Fr/IdCard/IdCardV1Test.php @@ -2,9 +2,9 @@ namespace V1\Product\Fr\IdCard; -use Mindee\Parsing\Common\Document; -use Mindee\Parsing\Common\Page; use Mindee\Product\Fr\IdCard; +use Mindee\V1\Parsing\Common\Document; +use Mindee\V1\Parsing\Common\Page; use PHPUnit\Framework\TestCase; class IdCardV1Test extends TestCase @@ -22,9 +22,9 @@ protected function setUp(): void $emptyDocFile = file_get_contents($productDir . "empty.json"); $completeDocJSON = json_decode($completeDocFile, true); $emptyDocJSON = json_decode($emptyDocFile, true); - $this->completeDoc = new Document(IdCard\IdCardV1::class, $completeDocJSON["document"]); - $this->emptyDoc = new Document(IdCard\IdCardV1::class, $emptyDocJSON["document"]); - $this->completePage0 = new Page(IdCard\IdCardV1Page::class, $completeDocJSON["document"]["inference"]["pages"][0]); + $this->completeDoc = new Document(\Mindee\V1\Product\Fr\IdCard\IdCardV1::class, $completeDocJSON["document"]); + $this->emptyDoc = new Document(\Mindee\V1\Product\Fr\IdCard\IdCardV1::class, $emptyDocJSON["document"]); + $this->completePage0 = new Page(\Mindee\V1\Product\Fr\IdCard\IdCardV1Page::class, $completeDocJSON["document"]["inference"]["pages"][0]); $this->completeDocReference = file_get_contents($productDir . "summary_full.rst"); $this->completePage0Reference = file_get_contents($productDir . "summary_page0.rst"); } diff --git a/tests/V1/Product/Fr/IdCard/IdCardV2Test.php b/tests/V1/Product/Fr/IdCard/IdCardV2Test.php index 74bdf21b..13716008 100644 --- a/tests/V1/Product/Fr/IdCard/IdCardV2Test.php +++ b/tests/V1/Product/Fr/IdCard/IdCardV2Test.php @@ -2,9 +2,9 @@ namespace V1\Product\Fr\IdCard; -use Mindee\Parsing\Common\Document; -use Mindee\Parsing\Common\Page; use Mindee\Product\Fr\IdCard; +use Mindee\V1\Parsing\Common\Document; +use Mindee\V1\Parsing\Common\Page; use PHPUnit\Framework\TestCase; class IdCardV2Test extends TestCase @@ -22,9 +22,9 @@ protected function setUp(): void $emptyDocFile = file_get_contents($productDir . "empty.json"); $completeDocJSON = json_decode($completeDocFile, true); $emptyDocJSON = json_decode($emptyDocFile, true); - $this->completeDoc = new Document(IdCard\IdCardV2::class, $completeDocJSON["document"]); - $this->emptyDoc = new Document(IdCard\IdCardV2::class, $emptyDocJSON["document"]); - $this->completePage0 = new Page(IdCard\IdCardV2Page::class, $completeDocJSON["document"]["inference"]["pages"][0]); + $this->completeDoc = new Document(\Mindee\V1\Product\Fr\IdCard\IdCardV2::class, $completeDocJSON["document"]); + $this->emptyDoc = new Document(\Mindee\V1\Product\Fr\IdCard\IdCardV2::class, $emptyDocJSON["document"]); + $this->completePage0 = new Page(\Mindee\V1\Product\Fr\IdCard\IdCardV2Page::class, $completeDocJSON["document"]["inference"]["pages"][0]); $this->completeDocReference = file_get_contents($productDir . "summary_full.rst"); $this->completePage0Reference = file_get_contents($productDir . "summary_page0.rst"); } diff --git a/tests/V1/Product/Fr/Payslip/PayslipV3Test.php b/tests/V1/Product/Fr/Payslip/PayslipV3Test.php index 1dd77e2d..0fb56070 100644 --- a/tests/V1/Product/Fr/Payslip/PayslipV3Test.php +++ b/tests/V1/Product/Fr/Payslip/PayslipV3Test.php @@ -2,8 +2,8 @@ namespace V1\Product\Fr\Payslip; -use Mindee\Parsing\Common\Document; use Mindee\Product\Fr\Payslip; +use Mindee\V1\Parsing\Common\Document; use PHPUnit\Framework\TestCase; class PayslipV3Test extends TestCase @@ -19,8 +19,8 @@ protected function setUp(): void $emptyDocFile = file_get_contents($productDir . "empty.json"); $completeDocJSON = json_decode($completeDocFile, true); $emptyDocJSON = json_decode($emptyDocFile, true); - $this->completeDoc = new Document(Payslip\PayslipV3::class, $completeDocJSON["document"]); - $this->emptyDoc = new Document(Payslip\PayslipV3::class, $emptyDocJSON["document"]); + $this->completeDoc = new Document(\Mindee\V1\Product\Fr\Payslip\PayslipV3::class, $completeDocJSON["document"]); + $this->emptyDoc = new Document(\Mindee\V1\Product\Fr\Payslip\PayslipV3::class, $emptyDocJSON["document"]); $this->completeDocReference = file_get_contents($productDir . "summary_full.rst"); } diff --git a/tests/V1/Product/Generated/GeneratedV1Test.php b/tests/V1/Product/Generated/GeneratedV1Test.php index 3b812293..25dac487 100644 --- a/tests/V1/Product/Generated/GeneratedV1Test.php +++ b/tests/V1/Product/Generated/GeneratedV1Test.php @@ -2,14 +2,14 @@ namespace V1\Product\Generated; -use Mindee\Parsing\Common\Document; -use Mindee\Parsing\Common\Page; -use Mindee\Parsing\Generated\GeneratedListField; -use Mindee\Parsing\Generated\GeneratedObjectField; -use Mindee\Parsing\Standard\PositionField; -use Mindee\Parsing\Standard\StringField; -use Mindee\Product\Generated\GeneratedV1; -use Mindee\Product\Generated\GeneratedV1Page; +use Mindee\V1\Parsing\Common\Document; +use Mindee\V1\Parsing\Common\Page; +use Mindee\V1\Parsing\Generated\GeneratedListField; +use Mindee\V1\Parsing\Generated\GeneratedObjectField; +use Mindee\V1\Parsing\Standard\PositionField; +use Mindee\V1\Parsing\Standard\StringField; +use Mindee\V1\Product\Generated\GeneratedV1; +use Mindee\V1\Product\Generated\GeneratedV1Page; use PHPUnit\Framework\TestCase; diff --git a/tests/V1/Product/Ind/IndianPassport/IndianPassportV1Test.php b/tests/V1/Product/Ind/IndianPassport/IndianPassportV1Test.php index 09e8735e..ffa89d39 100644 --- a/tests/V1/Product/Ind/IndianPassport/IndianPassportV1Test.php +++ b/tests/V1/Product/Ind/IndianPassport/IndianPassportV1Test.php @@ -2,8 +2,8 @@ namespace V1\Product\Ind\IndianPassport; -use Mindee\Parsing\Common\Document; use Mindee\Product\Ind\IndianPassport; +use Mindee\V1\Parsing\Common\Document; use PHPUnit\Framework\TestCase; class IndianPassportV1Test extends TestCase @@ -19,8 +19,8 @@ protected function setUp(): void $emptyDocFile = file_get_contents($productDir . "empty.json"); $completeDocJSON = json_decode($completeDocFile, true); $emptyDocJSON = json_decode($emptyDocFile, true); - $this->completeDoc = new Document(IndianPassport\IndianPassportV1::class, $completeDocJSON["document"]); - $this->emptyDoc = new Document(IndianPassport\IndianPassportV1::class, $emptyDocJSON["document"]); + $this->completeDoc = new Document(\Mindee\V1\Product\Ind\IndianPassport\IndianPassportV1::class, $completeDocJSON["document"]); + $this->emptyDoc = new Document(\Mindee\V1\Product\Ind\IndianPassport\IndianPassportV1::class, $emptyDocJSON["document"]); $this->completeDocReference = file_get_contents($productDir . "summary_full.rst"); } diff --git a/tests/V1/Product/InternationalId/InternationalIdV2Test.php b/tests/V1/Product/InternationalId/InternationalIdV2Test.php index 82aeb855..f83381f9 100644 --- a/tests/V1/Product/InternationalId/InternationalIdV2Test.php +++ b/tests/V1/Product/InternationalId/InternationalIdV2Test.php @@ -2,8 +2,8 @@ namespace V1\Product\InternationalId; -use Mindee\Parsing\Common\Document; use Mindee\Product\InternationalId; +use Mindee\V1\Parsing\Common\Document; use PHPUnit\Framework\TestCase; class InternationalIdV2Test extends TestCase @@ -19,8 +19,8 @@ protected function setUp(): void $emptyDocFile = file_get_contents($productDir . "empty.json"); $completeDocJSON = json_decode($completeDocFile, true); $emptyDocJSON = json_decode($emptyDocFile, true); - $this->completeDoc = new Document(InternationalId\InternationalIdV2::class, $completeDocJSON["document"]); - $this->emptyDoc = new Document(InternationalId\InternationalIdV2::class, $emptyDocJSON["document"]); + $this->completeDoc = new Document(\Mindee\V1\Product\InternationalId\InternationalIdV2::class, $completeDocJSON["document"]); + $this->emptyDoc = new Document(\Mindee\V1\Product\InternationalId\InternationalIdV2::class, $emptyDocJSON["document"]); $this->completeDocReference = file_get_contents($productDir . "summary_full.rst"); } diff --git a/tests/V1/Product/Invoice/InvoiceV4Test.php b/tests/V1/Product/Invoice/InvoiceV4Test.php index 5595e6c4..c81b7367 100644 --- a/tests/V1/Product/Invoice/InvoiceV4Test.php +++ b/tests/V1/Product/Invoice/InvoiceV4Test.php @@ -2,8 +2,8 @@ namespace V1\Product\Invoice; -use Mindee\Parsing\Common\Document; use Mindee\Product\Invoice; +use Mindee\V1\Parsing\Common\Document; use PHPUnit\Framework\TestCase; class InvoiceV4Test extends TestCase @@ -19,8 +19,8 @@ protected function setUp(): void $emptyDocFile = file_get_contents($productDir . "empty.json"); $completeDocJSON = json_decode($completeDocFile, true); $emptyDocJSON = json_decode($emptyDocFile, true); - $this->completeDoc = new Document(Invoice\InvoiceV4::class, $completeDocJSON["document"]); - $this->emptyDoc = new Document(Invoice\InvoiceV4::class, $emptyDocJSON["document"]); + $this->completeDoc = new Document(\Mindee\V1\Product\Invoice\InvoiceV4::class, $completeDocJSON["document"]); + $this->emptyDoc = new Document(\Mindee\V1\Product\Invoice\InvoiceV4::class, $emptyDocJSON["document"]); $this->completeDocReference = file_get_contents($productDir . "summary_full.rst"); } diff --git a/tests/V1/Product/InvoiceSplitter/InvoiceSplitterV1Test.php b/tests/V1/Product/InvoiceSplitter/InvoiceSplitterV1Test.php index 81d953cd..f931b1c7 100644 --- a/tests/V1/Product/InvoiceSplitter/InvoiceSplitterV1Test.php +++ b/tests/V1/Product/InvoiceSplitter/InvoiceSplitterV1Test.php @@ -2,8 +2,8 @@ namespace V1\Product\InvoiceSplitter; -use Mindee\Parsing\Common\Document; use Mindee\Product\InvoiceSplitter; +use Mindee\V1\Parsing\Common\Document; use PHPUnit\Framework\TestCase; class InvoiceSplitterV1Test extends TestCase @@ -19,8 +19,8 @@ protected function setUp(): void $emptyDocFile = file_get_contents($productDir . "empty.json"); $completeDocJSON = json_decode($completeDocFile, true); $emptyDocJSON = json_decode($emptyDocFile, true); - $this->completeDoc = new Document(InvoiceSplitter\InvoiceSplitterV1::class, $completeDocJSON["document"]); - $this->emptyDoc = new Document(InvoiceSplitter\InvoiceSplitterV1::class, $emptyDocJSON["document"]); + $this->completeDoc = new Document(\Mindee\V1\Product\InvoiceSplitter\InvoiceSplitterV1::class, $completeDocJSON["document"]); + $this->emptyDoc = new Document(\Mindee\V1\Product\InvoiceSplitter\InvoiceSplitterV1::class, $emptyDocJSON["document"]); $this->completeDocReference = file_get_contents($productDir . "summary_full.rst"); } diff --git a/tests/V1/Product/MultiReceiptsDetector/MultiReceiptsDetectorV1Test.php b/tests/V1/Product/MultiReceiptsDetector/MultiReceiptsDetectorV1Test.php index d16f66f6..fa738fc4 100644 --- a/tests/V1/Product/MultiReceiptsDetector/MultiReceiptsDetectorV1Test.php +++ b/tests/V1/Product/MultiReceiptsDetector/MultiReceiptsDetectorV1Test.php @@ -2,8 +2,8 @@ namespace V1\Product\MultiReceiptsDetector; -use Mindee\Parsing\Common\Document; use Mindee\Product\MultiReceiptsDetector; +use Mindee\V1\Parsing\Common\Document; use PHPUnit\Framework\TestCase; class MultiReceiptsDetectorV1Test extends TestCase @@ -19,8 +19,8 @@ protected function setUp(): void $emptyDocFile = file_get_contents($productDir . "empty.json"); $completeDocJSON = json_decode($completeDocFile, true); $emptyDocJSON = json_decode($emptyDocFile, true); - $this->completeDoc = new Document(MultiReceiptsDetector\MultiReceiptsDetectorV1::class, $completeDocJSON["document"]); - $this->emptyDoc = new Document(MultiReceiptsDetector\MultiReceiptsDetectorV1::class, $emptyDocJSON["document"]); + $this->completeDoc = new Document(\Mindee\V1\Product\MultiReceiptsDetector\MultiReceiptsDetectorV1::class, $completeDocJSON["document"]); + $this->emptyDoc = new Document(\Mindee\V1\Product\MultiReceiptsDetector\MultiReceiptsDetectorV1::class, $emptyDocJSON["document"]); $this->completeDocReference = file_get_contents($productDir . "summary_full.rst"); } diff --git a/tests/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1Test.php b/tests/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1Test.php index ead37651..b5593e22 100644 --- a/tests/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1Test.php +++ b/tests/V1/Product/NutritionFactsLabel/NutritionFactsLabelV1Test.php @@ -2,8 +2,8 @@ namespace V1\Product\NutritionFactsLabel; -use Mindee\Parsing\Common\Document; use Mindee\Product\NutritionFactsLabel; +use Mindee\V1\Parsing\Common\Document; use PHPUnit\Framework\TestCase; class NutritionFactsLabelV1Test extends TestCase @@ -19,8 +19,8 @@ protected function setUp(): void $emptyDocFile = file_get_contents($productDir . "empty.json"); $completeDocJSON = json_decode($completeDocFile, true); $emptyDocJSON = json_decode($emptyDocFile, true); - $this->completeDoc = new Document(NutritionFactsLabel\NutritionFactsLabelV1::class, $completeDocJSON["document"]); - $this->emptyDoc = new Document(NutritionFactsLabel\NutritionFactsLabelV1::class, $emptyDocJSON["document"]); + $this->completeDoc = new Document(\Mindee\V1\Product\NutritionFactsLabel\NutritionFactsLabelV1::class, $completeDocJSON["document"]); + $this->emptyDoc = new Document(\Mindee\V1\Product\NutritionFactsLabel\NutritionFactsLabelV1::class, $emptyDocJSON["document"]); $this->completeDocReference = file_get_contents($productDir . "summary_full.rst"); } diff --git a/tests/V1/Product/Passport/PassportV1Test.php b/tests/V1/Product/Passport/PassportV1Test.php index 7408188c..d3748026 100644 --- a/tests/V1/Product/Passport/PassportV1Test.php +++ b/tests/V1/Product/Passport/PassportV1Test.php @@ -2,8 +2,8 @@ namespace V1\Product\Passport; -use Mindee\Parsing\Common\Document; use Mindee\Product\Passport; +use Mindee\V1\Parsing\Common\Document; use PHPUnit\Framework\TestCase; class PassportV1Test extends TestCase @@ -19,8 +19,8 @@ protected function setUp(): void $emptyDocFile = file_get_contents($productDir . "empty.json"); $completeDocJSON = json_decode($completeDocFile, true); $emptyDocJSON = json_decode($emptyDocFile, true); - $this->completeDoc = new Document(Passport\PassportV1::class, $completeDocJSON["document"]); - $this->emptyDoc = new Document(Passport\PassportV1::class, $emptyDocJSON["document"]); + $this->completeDoc = new Document(\Mindee\V1\Product\Passport\PassportV1::class, $completeDocJSON["document"]); + $this->emptyDoc = new Document(\Mindee\V1\Product\Passport\PassportV1::class, $emptyDocJSON["document"]); $this->completeDocReference = file_get_contents($productDir . "summary_full.rst"); } diff --git a/tests/V1/Product/Receipt/ReceiptV5Test.php b/tests/V1/Product/Receipt/ReceiptV5Test.php index 7e282df1..d92c110e 100644 --- a/tests/V1/Product/Receipt/ReceiptV5Test.php +++ b/tests/V1/Product/Receipt/ReceiptV5Test.php @@ -2,8 +2,8 @@ namespace V1\Product\Receipt; -use Mindee\Parsing\Common\Document; use Mindee\Product\Receipt; +use Mindee\V1\Parsing\Common\Document; use PHPUnit\Framework\TestCase; class ReceiptV5Test extends TestCase @@ -19,8 +19,8 @@ protected function setUp(): void $emptyDocFile = file_get_contents($productDir . "empty.json"); $completeDocJSON = json_decode($completeDocFile, true); $emptyDocJSON = json_decode($emptyDocFile, true); - $this->completeDoc = new Document(Receipt\ReceiptV5::class, $completeDocJSON["document"]); - $this->emptyDoc = new Document(Receipt\ReceiptV5::class, $emptyDocJSON["document"]); + $this->completeDoc = new Document(\Mindee\V1\Product\Receipt\ReceiptV5::class, $completeDocJSON["document"]); + $this->emptyDoc = new Document(\Mindee\V1\Product\Receipt\ReceiptV5::class, $emptyDocJSON["document"]); $this->completeDocReference = file_get_contents($productDir . "summary_full.rst"); } diff --git a/tests/V1/Product/Resume/ResumeV1Test.php b/tests/V1/Product/Resume/ResumeV1Test.php index 876d4551..39ff71de 100644 --- a/tests/V1/Product/Resume/ResumeV1Test.php +++ b/tests/V1/Product/Resume/ResumeV1Test.php @@ -2,8 +2,8 @@ namespace V1\Product\Resume; -use Mindee\Parsing\Common\Document; use Mindee\Product\Resume; +use Mindee\V1\Parsing\Common\Document; use PHPUnit\Framework\TestCase; class ResumeV1Test extends TestCase @@ -19,8 +19,8 @@ protected function setUp(): void $emptyDocFile = file_get_contents($productDir . "empty.json"); $completeDocJSON = json_decode($completeDocFile, true); $emptyDocJSON = json_decode($emptyDocFile, true); - $this->completeDoc = new Document(Resume\ResumeV1::class, $completeDocJSON["document"]); - $this->emptyDoc = new Document(Resume\ResumeV1::class, $emptyDocJSON["document"]); + $this->completeDoc = new Document(\Mindee\V1\Product\Resume\ResumeV1::class, $completeDocJSON["document"]); + $this->emptyDoc = new Document(\Mindee\V1\Product\Resume\ResumeV1::class, $emptyDocJSON["document"]); $this->completeDocReference = file_get_contents($productDir . "summary_full.rst"); } diff --git a/tests/V1/Product/Us/BankCheck/BankCheckV1Test.php b/tests/V1/Product/Us/BankCheck/BankCheckV1Test.php index 50b7162f..e20c40cf 100644 --- a/tests/V1/Product/Us/BankCheck/BankCheckV1Test.php +++ b/tests/V1/Product/Us/BankCheck/BankCheckV1Test.php @@ -2,9 +2,9 @@ namespace V1\Product\Us\BankCheck; -use Mindee\Parsing\Common\Document; -use Mindee\Parsing\Common\Page; use Mindee\Product\Us\BankCheck; +use Mindee\V1\Parsing\Common\Document; +use Mindee\V1\Parsing\Common\Page; use PHPUnit\Framework\TestCase; class BankCheckV1Test extends TestCase @@ -22,9 +22,9 @@ protected function setUp(): void $emptyDocFile = file_get_contents($productDir . "empty.json"); $completeDocJSON = json_decode($completeDocFile, true); $emptyDocJSON = json_decode($emptyDocFile, true); - $this->completeDoc = new Document(BankCheck\BankCheckV1::class, $completeDocJSON["document"]); - $this->emptyDoc = new Document(BankCheck\BankCheckV1::class, $emptyDocJSON["document"]); - $this->completePage0 = new Page(BankCheck\BankCheckV1Page::class, $completeDocJSON["document"]["inference"]["pages"][0]); + $this->completeDoc = new Document(\Mindee\V1\Product\Us\BankCheck\BankCheckV1::class, $completeDocJSON["document"]); + $this->emptyDoc = new Document(\Mindee\V1\Product\Us\BankCheck\BankCheckV1::class, $emptyDocJSON["document"]); + $this->completePage0 = new Page(\Mindee\V1\Product\Us\BankCheck\BankCheckV1Page::class, $completeDocJSON["document"]["inference"]["pages"][0]); $this->completeDocReference = file_get_contents($productDir . "summary_full.rst"); $this->completePage0Reference = file_get_contents($productDir . "summary_page0.rst"); } diff --git a/tests/V1/Product/Us/HealthcareCard/HealthcareCardV1Test.php b/tests/V1/Product/Us/HealthcareCard/HealthcareCardV1Test.php index 48d3fe02..3f09a552 100644 --- a/tests/V1/Product/Us/HealthcareCard/HealthcareCardV1Test.php +++ b/tests/V1/Product/Us/HealthcareCard/HealthcareCardV1Test.php @@ -2,8 +2,8 @@ namespace V1\Product\Us\HealthcareCard; -use Mindee\Parsing\Common\Document; use Mindee\Product\Us\HealthcareCard; +use Mindee\V1\Parsing\Common\Document; use PHPUnit\Framework\TestCase; class HealthcareCardV1Test extends TestCase @@ -19,8 +19,8 @@ protected function setUp(): void $emptyDocFile = file_get_contents($productDir . "empty.json"); $completeDocJSON = json_decode($completeDocFile, true); $emptyDocJSON = json_decode($emptyDocFile, true); - $this->completeDoc = new Document(HealthcareCard\HealthcareCardV1::class, $completeDocJSON["document"]); - $this->emptyDoc = new Document(HealthcareCard\HealthcareCardV1::class, $emptyDocJSON["document"]); + $this->completeDoc = new Document(\Mindee\V1\Product\Us\HealthcareCard\HealthcareCardV1::class, $completeDocJSON["document"]); + $this->emptyDoc = new Document(\Mindee\V1\Product\Us\HealthcareCard\HealthcareCardV1::class, $emptyDocJSON["document"]); $this->completeDocReference = file_get_contents($productDir . "summary_full.rst"); } diff --git a/tests/V1/Product/Us/UsMail/UsMailV3Test.php b/tests/V1/Product/Us/UsMail/UsMailV3Test.php index 38172d24..e3a70c24 100644 --- a/tests/V1/Product/Us/UsMail/UsMailV3Test.php +++ b/tests/V1/Product/Us/UsMail/UsMailV3Test.php @@ -2,8 +2,8 @@ namespace V1\Product\Us\UsMail; -use Mindee\Parsing\Common\Document; use Mindee\Product\Us\UsMail; +use Mindee\V1\Parsing\Common\Document; use PHPUnit\Framework\TestCase; class UsMailV3Test extends TestCase @@ -19,8 +19,8 @@ protected function setUp(): void $emptyDocFile = file_get_contents($productDir . "empty.json"); $completeDocJSON = json_decode($completeDocFile, true); $emptyDocJSON = json_decode($emptyDocFile, true); - $this->completeDoc = new Document(UsMail\UsMailV3::class, $completeDocJSON["document"]); - $this->emptyDoc = new Document(UsMail\UsMailV3::class, $emptyDocJSON["document"]); + $this->completeDoc = new Document(\Mindee\V1\Product\Us\UsMail\UsMailV3::class, $completeDocJSON["document"]); + $this->emptyDoc = new Document(\Mindee\V1\Product\Us\UsMail\UsMailV3::class, $emptyDocJSON["document"]); $this->completeDocReference = file_get_contents($productDir . "summary_full.rst"); } diff --git a/tests/V1/Standard/AmountFieldTest.php b/tests/V1/Standard/AmountFieldTest.php index 314c19ae..cf3f654b 100644 --- a/tests/V1/Standard/AmountFieldTest.php +++ b/tests/V1/Standard/AmountFieldTest.php @@ -2,7 +2,7 @@ namespace V1\Standard; -use Mindee\Parsing\Standard\AmountField; +use Mindee\V1\Parsing\Standard\AmountField; use PHPUnit\Framework\TestCase; class AmountFieldTest extends TestCase diff --git a/tests/V1/Standard/ClassificationFieldTest.php b/tests/V1/Standard/ClassificationFieldTest.php index 9f4d1846..78f11227 100644 --- a/tests/V1/Standard/ClassificationFieldTest.php +++ b/tests/V1/Standard/ClassificationFieldTest.php @@ -2,7 +2,7 @@ namespace V1\Standard; -use Mindee\Parsing\Standard\ClassificationField; +use Mindee\V1\Parsing\Standard\ClassificationField; use PHPUnit\Framework\TestCase; class ClassificationFieldTest extends TestCase diff --git a/tests/V1/Standard/CompanyRegistrationFieldTest.php b/tests/V1/Standard/CompanyRegistrationFieldTest.php index 2d0445b9..15b7e5d5 100644 --- a/tests/V1/Standard/CompanyRegistrationFieldTest.php +++ b/tests/V1/Standard/CompanyRegistrationFieldTest.php @@ -2,7 +2,7 @@ namespace V1\Standard; -use Mindee\Parsing\Standard\CompanyRegistrationField; +use Mindee\V1\Parsing\Standard\CompanyRegistrationField; use PHPUnit\Framework\TestCase; class CompanyRegistrationFieldTest extends TestCase diff --git a/tests/V1/Standard/DateFieldTest.php b/tests/V1/Standard/DateFieldTest.php index bd76e60b..3f55410a 100644 --- a/tests/V1/Standard/DateFieldTest.php +++ b/tests/V1/Standard/DateFieldTest.php @@ -2,7 +2,7 @@ namespace V1\Standard; -use Mindee\Parsing\Standard\DateField; +use Mindee\V1\Parsing\Standard\DateField; use PHPUnit\Framework\TestCase; class DateFieldTest extends TestCase diff --git a/tests/V1/Standard/LocaleFieldTest.php b/tests/V1/Standard/LocaleFieldTest.php index e162309a..48805178 100644 --- a/tests/V1/Standard/LocaleFieldTest.php +++ b/tests/V1/Standard/LocaleFieldTest.php @@ -2,7 +2,7 @@ namespace V1\Standard; -use Mindee\Parsing\Standard\LocaleField; +use Mindee\V1\Parsing\Standard\LocaleField; use PHPUnit\Framework\TestCase; class LocaleFieldTest extends TestCase diff --git a/tests/V1/Standard/PaymentDetailsFieldTest.php b/tests/V1/Standard/PaymentDetailsFieldTest.php index edc14dc8..785e7468 100644 --- a/tests/V1/Standard/PaymentDetailsFieldTest.php +++ b/tests/V1/Standard/PaymentDetailsFieldTest.php @@ -2,7 +2,7 @@ namespace V1\Standard; -use Mindee\Parsing\Standard\PaymentDetailsField; +use Mindee\V1\Parsing\Standard\PaymentDetailsField; use PHPUnit\Framework\TestCase; class PaymentDetailsFieldTest extends TestCase diff --git a/tests/V1/Standard/PositionFieldTest.php b/tests/V1/Standard/PositionFieldTest.php index 009e60e6..509a2a9f 100644 --- a/tests/V1/Standard/PositionFieldTest.php +++ b/tests/V1/Standard/PositionFieldTest.php @@ -2,7 +2,7 @@ namespace V1\Standard; -use Mindee\Parsing\Standard\PositionField; +use Mindee\V1\Parsing\Standard\PositionField; use PHPUnit\Framework\TestCase; class PositionFieldTest extends TestCase diff --git a/tests/V1/Standard/StringFieldTest.php b/tests/V1/Standard/StringFieldTest.php index c3fe246c..f60d38bc 100644 --- a/tests/V1/Standard/StringFieldTest.php +++ b/tests/V1/Standard/StringFieldTest.php @@ -2,7 +2,7 @@ namespace V1\Standard; -use Mindee\Parsing\Standard\StringField; +use Mindee\V1\Parsing\Standard\StringField; use PHPUnit\Framework\TestCase; class StringFieldTest extends TestCase diff --git a/tests/V1/Standard/TaxesTest.php b/tests/V1/Standard/TaxesTest.php index 7afed0aa..3e30a21a 100644 --- a/tests/V1/Standard/TaxesTest.php +++ b/tests/V1/Standard/TaxesTest.php @@ -2,7 +2,7 @@ namespace V1\Standard; -use Mindee\Parsing\Standard\TaxField; +use Mindee\V1\Parsing\Standard\TaxField; use PHPUnit\Framework\TestCase; class TaxesTest extends TestCase diff --git a/tests/V1/Workflow/WorkflowTest.php b/tests/V1/Workflow/WorkflowTest.php index ab9dd5bd..d6ed6a65 100644 --- a/tests/V1/Workflow/WorkflowTest.php +++ b/tests/V1/Workflow/WorkflowTest.php @@ -2,8 +2,8 @@ namespace V1\Workflow; -use Mindee\Parsing\Common\WorkflowResponse; -use Mindee\Product\Generated\GeneratedV1; +use Mindee\V1\Parsing\Common\WorkflowResponse; +use Mindee\V1\Product\Generated\GeneratedV1; use PHPUnit\Framework\TestCase; use TestingUtilities; diff --git a/tests/V1/Workflow/WorkflowTestFunctional.php b/tests/V1/Workflow/WorkflowTestFunctional.php index 7da42cbf..9e99d3de 100644 --- a/tests/V1/Workflow/WorkflowTestFunctional.php +++ b/tests/V1/Workflow/WorkflowTestFunctional.php @@ -2,10 +2,10 @@ namespace V1\Workflow; -use Mindee\Product\FinancialDocument\FinancialDocumentV1; use Mindee\V1\Client; use Mindee\V1\ClientOptions\PredictMethodOptions; use Mindee\V1\ClientOptions\WorkflowOptions; +use Mindee\V1\Product\FinancialDocument\FinancialDocumentV1; use PHPUnit\Framework\TestCase; require_once(__DIR__ . "/../../TestingUtilities.php"); diff --git a/tests/V2/ClientV2Test.php b/tests/V2/ClientV2Test.php index c3c72650..91360e5e 100644 --- a/tests/V2/ClientV2Test.php +++ b/tests/V2/ClientV2Test.php @@ -8,7 +8,7 @@ use Mindee\Input\PathInput; use Mindee\V2\Client; use Mindee\V2\HTTP\MindeeAPIV2; -use Mindee\V2\Parsing\InferenceResponse; +use Mindee\V2\Parsing\Inference\InferenceResponse; use Mindee\V2\Parsing\JobResponse; use Mindee\V2\Product\Extraction\Params\InferenceParameters; use PHPUnit\Framework\MockObject\MockObject; diff --git a/tests/V2/FileOperations/CropFunctional.php b/tests/V2/FileOperations/CropFunctional.php index 94b80d01..01fd1422 100644 --- a/tests/V2/FileOperations/CropFunctional.php +++ b/tests/V2/FileOperations/CropFunctional.php @@ -5,7 +5,7 @@ use Mindee\Input\PathInput; use Mindee\V2\Client; use Mindee\V2\FileOperations\Crop; -use Mindee\V2\Parsing\InferenceResponse; +use Mindee\V2\Parsing\Inference\InferenceResponse; use Mindee\V2\Product\Crop\CropResponse; use Mindee\V2\Product\Crop\Params\CropParameters; use Mindee\V2\Product\Extraction\Params\InferenceParameters; @@ -88,7 +88,7 @@ public function testExtractCropsFromImageCorrectly(): void $this->assertLessThanOrEqual(100000, $file2Info); } - public function testExtractCropsFromEachPdfPageCorrectly(): void + public function testExtractCropsFromEachPDFPageCorrectly(): void { $inputSource = new PathInput(\TestingUtilities::getV2ProductDir() . '/crop/multipage_sample.pdf'); $cropParams = new CropParameters($this->cropModelId); diff --git a/tests/V2/FileOperations/SplitFunctional.php b/tests/V2/FileOperations/SplitFunctional.php index 99ce1f14..83119fbf 100644 --- a/tests/V2/FileOperations/SplitFunctional.php +++ b/tests/V2/FileOperations/SplitFunctional.php @@ -5,7 +5,7 @@ use Mindee\Input\PathInput; use Mindee\V2\Client; use Mindee\V2\FileOperations\Split; -use Mindee\V2\Parsing\InferenceResponse; +use Mindee\V2\Parsing\Inference\InferenceResponse; use Mindee\V2\Product\Extraction\Params\InferenceParameters; use Mindee\V2\Product\Split\Params\SplitParameters; use Mindee\V2\Product\Split\SplitResponse; @@ -53,7 +53,7 @@ private function checkFindocReturn(InferenceResponse $findocResponse): void $this->assertGreaterThan(0, $totalAmount->value); } - public function testExtractSplitsFromPdfCorrectly(): void + public function testExtractSplitsFromPDFCorrectly(): void { $inputSource = new PathInput(\TestingUtilities::getV2ProductDir() . '/split/default_sample.pdf'); $splitParams = new SplitParameters($this->splitModelId); diff --git a/tests/V2/Input/LocalResponseV2Test.php b/tests/V2/Input/LocalResponseV2Test.php index e34acca4..46026a58 100644 --- a/tests/V2/Input/LocalResponseV2Test.php +++ b/tests/V2/Input/LocalResponseV2Test.php @@ -3,7 +3,7 @@ namespace V2\Input; use Mindee\Input\LocalResponse; -use Mindee\V2\Parsing\InferenceResponse; +use Mindee\V2\Parsing\Inference\InferenceResponse; use PHPUnit\Framework\TestCase; class LocalResponseV2Test extends TestCase diff --git a/tests/V2/Parsing/InferenceResponseTest.php b/tests/V2/Parsing/InferenceResponseTest.php index f335f280..caca52de 100644 --- a/tests/V2/Parsing/InferenceResponseTest.php +++ b/tests/V2/Parsing/InferenceResponseTest.php @@ -2,15 +2,15 @@ namespace V2\Parsing; -use Mindee\Error\ErrorItem; use Mindee\Geometry\Point; use Mindee\Input\LocalResponse; +use Mindee\V2\Parsing\ErrorItem; use Mindee\V2\Parsing\ErrorResponse; -use Mindee\V2\Parsing\Field\FieldConfidence; -use Mindee\V2\Parsing\Field\ListField; -use Mindee\V2\Parsing\Field\ObjectField; -use Mindee\V2\Parsing\Field\SimpleField; -use Mindee\V2\Parsing\InferenceResponse; +use Mindee\V2\Parsing\Inference\Field\FieldConfidence; +use Mindee\V2\Parsing\Inference\Field\ListField; +use Mindee\V2\Parsing\Inference\Field\ObjectField; +use Mindee\V2\Parsing\Inference\Field\SimpleField; +use Mindee\V2\Parsing\Inference\InferenceResponse; use Mindee\V2\Parsing\JobResponse; use PHPUnit\Framework\TestCase; use TestingUtilities; diff --git a/tests/V2/Parsing/JobResponseTest.php b/tests/V2/Parsing/JobResponseTest.php index 898582f6..6a805208 100644 --- a/tests/V2/Parsing/JobResponseTest.php +++ b/tests/V2/Parsing/JobResponseTest.php @@ -3,7 +3,7 @@ namespace V2\Parsing; use DateTime; -use Mindee\Error\ErrorItem; +use Mindee\V2\Parsing\ErrorItem; use Mindee\V2\Parsing\ErrorResponse; use Mindee\V2\Parsing\JobResponse; use PHPUnit\Framework\TestCase; From c7c3f6aeb16f02e3236a3ef8d7b29dd461544a2c Mon Sep 17 00:00:00 2001 From: sebastianMindee <130448732+sebastianMindee@users.noreply.github.com> Date: Mon, 11 May 2026 16:43:13 +0200 Subject: [PATCH 6/9] fix smoke test v2 --- docs/code_samples/v2_extraction_polling.txt | 2 +- docs/code_samples/v2_extraction_webhook.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/code_samples/v2_extraction_polling.txt b/docs/code_samples/v2_extraction_polling.txt index 1510f3d3..1c97428e 100644 --- a/docs/code_samples/v2_extraction_polling.txt +++ b/docs/code_samples/v2_extraction_polling.txt @@ -1,7 +1,7 @@ Date: Mon, 11 May 2026 17:09:14 +0200 Subject: [PATCH 7/9] fix test and yeet examples --- docs/code_samples/v2_extraction_polling.txt | 2 +- .../InvoiceSplitterAutoExtractionExample.php | 52 ------------------- .../MultiReceiptsAutoExtractionExample.php | 37 ------------- 3 files changed, 1 insertion(+), 90 deletions(-) delete mode 100644 examples/InvoiceSplitterAutoExtractionExample.php delete mode 100644 examples/MultiReceiptsAutoExtractionExample.php diff --git a/docs/code_samples/v2_extraction_polling.txt b/docs/code_samples/v2_extraction_polling.txt index 1c97428e..bdb7fecf 100644 --- a/docs/code_samples/v2_extraction_polling.txt +++ b/docs/code_samples/v2_extraction_polling.txt @@ -3,7 +3,7 @@ use Mindee\V2\Client; use Mindee\V2\Product\Extraction\Params\InferenceParameters; use Mindee\Input\PathInput; -use Mindee\Parsing\V2\InferenceResponse; +use Mindee\V2\Parsing\Inference\InferenceResponse; $apiKey = "MY_API_KEY"; $filePath = "/path/to/the/file.ext"; diff --git a/examples/InvoiceSplitterAutoExtractionExample.php b/examples/InvoiceSplitterAutoExtractionExample.php deleted file mode 100644 index 4f2d65b7..00000000 --- a/examples/InvoiceSplitterAutoExtractionExample.php +++ /dev/null @@ -1,52 +0,0 @@ -isPdf() && $inputSource->getPageCount() > 1) { - parseMultiPage($inputSource, $mindeeClient); - } else { - parseSinglePage($inputSource, $mindeeClient); - } -} - -function parseSinglePage(PathInput $inputSource, Client $mindeeClient) -{ - $invoiceResult = $mindeeClient->parse(InvoiceV4::class, $inputSource); - echo $invoiceResult->document; -} - -function parseMultiPage(PathInput $inputSource, Client $mindeeClient) -{ - global $mindeeClient; - $pdfExtractor = new PDFExtractor($inputSource); - $invoiceSplitterResponse = $mindeeClient->enqueueAndParse( - InvoiceSplitterV1::class, - $inputSource - ); - $pageGroups = $invoiceSplitterResponse->document->inference->prediction->invoicePageGroups; - $extractedPdfs = $pdfExtractor->extractInvoices($pageGroups); - - foreach ($extractedPdfs as $extractedPdf) { - // Optional: Save the files locally - // $extractedPdf->writeToFile("output/path"); - - $invoiceResult = $mindeeClient->parse( - InvoiceV4::class, - $extractedPdf->asInputSource() - ); - echo $invoiceResult->document; - } -} - -$mindeeClient = new Client("my-api-key-here"); -// $mindeeClient = new Client(); // Optionally, use an environment variable. -$inputPath = "path/to/your/file.ext"; -parseInvoice($inputPath, $mindeeClient); diff --git a/examples/MultiReceiptsAutoExtractionExample.php b/examples/MultiReceiptsAutoExtractionExample.php deleted file mode 100644 index 5ab1daa4..00000000 --- a/examples/MultiReceiptsAutoExtractionExample.php +++ /dev/null @@ -1,37 +0,0 @@ -parse(MultiReceiptsDetectorV1::class, $inputSource); - $pageCount = $inputSource->getPageCount(); - - $totalExtractedReceipts = []; - - for ($i = 0; $i < $pageCount; $i++) { - $receiptsPositions = $multiReceiptsResult->document->inference->pages[$i]->prediction->receipts; - $extractedReceipts = $imageExtractor->extractImagesFromPage($receiptsPositions, $i); - $totalExtractedReceipts = array_merge($totalExtractedReceipts, $extractedReceipts); - } - - foreach ($totalExtractedReceipts as $receipt) { - // Optional: save the extracted receipts to a file - // $receipt->writeToFile("output/path"); - - $result = $client->parse(ReceiptV5::class, $receipt->asInputSource()); - echo $result->document . "\n"; - } -} -processReceipts($mindeeClient, $inputPath); From 541cedc97b9588a0df2a9f0480d7f605e3340985 Mon Sep 17 00:00:00 2001 From: sebastianMindee <130448732+sebastianMindee@users.noreply.github.com> Date: Mon, 11 May 2026 17:54:54 +0200 Subject: [PATCH 8/9] move summaryhelper up a folder --- src/Parsing/{Common => }/SummaryHelper.php | 2 +- src/V1/Parsing/Standard/BooleanField.php | 2 +- src/V1/Parsing/Standard/CompanyRegistrationField.php | 2 +- src/V1/Parsing/{Common => }/SummaryHelperV1.php | 4 ++-- src/V1/Product/BarcodeReader/BarcodeReaderV1Document.php | 2 +- src/V1/Product/BillOfLading/BillOfLadingV1Carrier.php | 2 +- src/V1/Product/BillOfLading/BillOfLadingV1CarrierItem.php | 2 +- src/V1/Product/BillOfLading/BillOfLadingV1Consignee.php | 2 +- src/V1/Product/BillOfLading/BillOfLadingV1Document.php | 2 +- src/V1/Product/BillOfLading/BillOfLadingV1NotifyParty.php | 2 +- src/V1/Product/BillOfLading/BillOfLadingV1Shipper.php | 2 +- src/V1/Product/BusinessCard/BusinessCardV1Document.php | 2 +- src/V1/Product/Cropper/CropperV1Page.php | 2 +- src/V1/Product/DeliveryNote/DeliveryNoteV1Document.php | 2 +- src/V1/Product/DriverLicense/DriverLicenseV1Document.php | 2 +- .../Product/FinancialDocument/FinancialDocumentV1Document.php | 2 +- .../Product/FinancialDocument/FinancialDocumentV1LineItem.php | 2 +- .../Fr/BankAccountDetails/BankAccountDetailsV1Document.php | 2 +- .../Fr/BankAccountDetails/BankAccountDetailsV2Bban.php | 2 +- .../Fr/BankAccountDetails/BankAccountDetailsV2Document.php | 2 +- src/V1/Product/Fr/CarteGrise/CarteGriseV1Document.php | 2 +- src/V1/Product/Fr/EnergyBill/EnergyBillV1Document.php | 2 +- src/V1/Product/Fr/EnergyBill/EnergyBillV1EnergyConsumer.php | 2 +- src/V1/Product/Fr/EnergyBill/EnergyBillV1EnergySupplier.php | 2 +- src/V1/Product/Fr/EnergyBill/EnergyBillV1EnergyUsage.php | 2 +- src/V1/Product/Fr/EnergyBill/EnergyBillV1MeterDetail.php | 2 +- src/V1/Product/Fr/EnergyBill/EnergyBillV1Subscription.php | 2 +- .../Fr/EnergyBill/EnergyBillV1TaxesAndContribution.php | 2 +- src/V1/Product/Fr/HealthCard/HealthCardV1Document.php | 2 +- src/V1/Product/Fr/IdCard/IdCardV1Document.php | 2 +- src/V1/Product/Fr/IdCard/IdCardV1Page.php | 2 +- src/V1/Product/Fr/IdCard/IdCardV2Document.php | 2 +- src/V1/Product/Fr/IdCard/IdCardV2Page.php | 2 +- src/V1/Product/Fr/Payslip/PayslipV3BankAccountDetail.php | 2 +- src/V1/Product/Fr/Payslip/PayslipV3Document.php | 2 +- src/V1/Product/Fr/Payslip/PayslipV3Employee.php | 2 +- src/V1/Product/Fr/Payslip/PayslipV3Employer.php | 2 +- src/V1/Product/Fr/Payslip/PayslipV3Employment.php | 2 +- src/V1/Product/Fr/Payslip/PayslipV3PaidTimeOff.php | 2 +- src/V1/Product/Fr/Payslip/PayslipV3PayDetail.php | 2 +- src/V1/Product/Fr/Payslip/PayslipV3PayPeriod.php | 2 +- src/V1/Product/Fr/Payslip/PayslipV3SalaryDetail.php | 2 +- src/V1/Product/Generated/GeneratedV1Prediction.php | 2 +- .../Product/Ind/IndianPassport/IndianPassportV1Document.php | 2 +- src/V1/Product/InternationalId/InternationalIdV2Document.php | 2 +- src/V1/Product/Invoice/InvoiceV4Document.php | 2 +- src/V1/Product/Invoice/InvoiceV4LineItem.php | 2 +- src/V1/Product/InvoiceSplitter/InvoiceSplitterV1Document.php | 2 +- .../InvoiceSplitter/InvoiceSplitterV1InvoicePageGroup.php | 2 +- .../MultiReceiptsDetector/MultiReceiptsDetectorV1Document.php | 2 +- .../NutritionFactsLabel/NutritionFactsLabelV1AddedSugar.php | 2 +- .../NutritionFactsLabel/NutritionFactsLabelV1Calorie.php | 2 +- .../NutritionFactsLabel/NutritionFactsLabelV1Cholesterol.php | 2 +- .../NutritionFactsLabel/NutritionFactsLabelV1DietaryFiber.php | 2 +- .../NutritionFactsLabel/NutritionFactsLabelV1Document.php | 2 +- .../NutritionFactsLabel/NutritionFactsLabelV1Nutrient.php | 2 +- .../NutritionFactsLabel/NutritionFactsLabelV1Protein.php | 2 +- .../NutritionFactsLabel/NutritionFactsLabelV1SaturatedFat.php | 2 +- .../NutritionFactsLabel/NutritionFactsLabelV1ServingSize.php | 2 +- .../NutritionFactsLabel/NutritionFactsLabelV1Sodium.php | 2 +- .../NutritionFactsLabelV1TotalCarbohydrate.php | 2 +- .../NutritionFactsLabel/NutritionFactsLabelV1TotalFat.php | 2 +- .../NutritionFactsLabel/NutritionFactsLabelV1TotalSugar.php | 2 +- .../NutritionFactsLabel/NutritionFactsLabelV1TransFat.php | 2 +- src/V1/Product/Passport/PassportV1Document.php | 2 +- src/V1/Product/Receipt/ReceiptV5Document.php | 2 +- src/V1/Product/Receipt/ReceiptV5LineItem.php | 2 +- src/V1/Product/Resume/ResumeV1Certificate.php | 2 +- src/V1/Product/Resume/ResumeV1Document.php | 2 +- src/V1/Product/Resume/ResumeV1Education.php | 2 +- src/V1/Product/Resume/ResumeV1Language.php | 2 +- src/V1/Product/Resume/ResumeV1ProfessionalExperience.php | 2 +- src/V1/Product/Resume/ResumeV1SocialNetworksUrl.php | 2 +- src/V1/Product/Us/BankCheck/BankCheckV1Document.php | 2 +- src/V1/Product/Us/BankCheck/BankCheckV1Page.php | 2 +- src/V1/Product/Us/HealthcareCard/HealthcareCardV1Copay.php | 2 +- src/V1/Product/Us/HealthcareCard/HealthcareCardV1Document.php | 2 +- src/V1/Product/Us/UsMail/UsMailV3Document.php | 2 +- src/V1/Product/Us/UsMail/UsMailV3RecipientAddress.php | 2 +- src/V1/Product/Us/UsMail/UsMailV3SenderAddress.php | 2 +- src/V2/Parsing/BaseInference.php | 2 +- src/V2/Parsing/Inference/Inference.php | 2 +- src/V2/Parsing/Inference/InferenceActiveOptions.php | 2 +- src/V2/Product/Classification/ClassificationInference.php | 2 +- 84 files changed, 85 insertions(+), 85 deletions(-) rename src/Parsing/{Common => }/SummaryHelper.php (98%) rename src/V1/Parsing/{Common => }/SummaryHelperV1.php (90%) diff --git a/src/Parsing/Common/SummaryHelper.php b/src/Parsing/SummaryHelper.php similarity index 98% rename from src/Parsing/Common/SummaryHelper.php rename to src/Parsing/SummaryHelper.php index ce266b96..c9c54381 100644 --- a/src/Parsing/Common/SummaryHelper.php +++ b/src/Parsing/SummaryHelper.php @@ -1,6 +1,6 @@ Date: Mon, 11 May 2026 18:05:58 +0200 Subject: [PATCH 9/9] loosen test bound for crop --- tests/V2/FileOperations/CropFunctional.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/V2/FileOperations/CropFunctional.php b/tests/V2/FileOperations/CropFunctional.php index 01fd1422..cc1ea6c6 100644 --- a/tests/V2/FileOperations/CropFunctional.php +++ b/tests/V2/FileOperations/CropFunctional.php @@ -81,11 +81,11 @@ public function testExtractCropsFromImageCorrectly(): void $file1Info = filesize($this->outputDir . '/crop_001.jpg'); $this->assertGreaterThanOrEqual(97000, $file1Info); - $this->assertLessThanOrEqual(100000, $file1Info); + $this->assertLessThanOrEqual(103000, $file1Info); $file2Info = filesize($this->outputDir . '/crop_002.jpg'); $this->assertGreaterThanOrEqual(97000, $file2Info); - $this->assertLessThanOrEqual(100000, $file2Info); + $this->assertLessThanOrEqual(103000, $file2Info); } public function testExtractCropsFromEachPDFPageCorrectly(): void