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..0685284c 100644 --- a/bin/MindeeCLICommand.php +++ b/bin/MindeeCLICommand.php @@ -2,22 +2,21 @@ namespace Mindee\CLI; -use Mindee\Client; use Mindee\Error\MindeeHttpException; 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 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; 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/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/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 @@ 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 05f07282..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); 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 @@ 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/SummaryHelper.php similarity index 77% rename from src/Parsing/Common/SummaryHelper.php rename to src/Parsing/SummaryHelper.php index 9165acfc..c9c54381 100644 --- a/src/Parsing/Common/SummaryHelper.php +++ b/src/Parsing/SummaryHelper.php @@ -1,9 +1,9 @@ 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/Input/CommonOptions.php b/src/V1/ClientOptions/CommonOptions.php similarity index 96% rename from src/Input/CommonOptions.php rename to src/V1/ClientOptions/CommonOptions.php index fca8df40..adeee460 100644 --- a/src/Input/CommonOptions.php +++ b/src/V1/ClientOptions/CommonOptions.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 93% rename from src/Http/WorkflowEndpoint.php rename to src/V1/HTTP/WorkflowEndpoint.php index 219a70e1..16932d5f 100644 --- a/src/Http/WorkflowEndpoint.php +++ b/src/V1/HTTP/WorkflowEndpoint.php @@ -1,11 +1,11 @@ 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 88% rename from src/Product/BarcodeReader/BarcodeReaderV1Document.php rename to src/V1/Product/BarcodeReader/BarcodeReaderV1Document.php index 82d9a6ef..b7ac70cf 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..cd091c18 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..7fa82fe6 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..1eeed163 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..25376e97 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 71% rename from src/Product/BillOfLading/BillOfLadingV1Shipper.php rename to src/V1/Product/BillOfLading/BillOfLadingV1Shipper.php index bd3ae072..75ca19cb 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..50621a3b 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..598a3350 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..e9851eda 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..560569bd 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..c1722c8f 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..1f90c28e 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..5a04e1b8 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..10b844f3 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..b3119b21 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..d64b1ae1 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..d19538e9 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..77c772a6 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 59% rename from src/Product/Fr/EnergyBill/EnergyBillV1Subscription.php rename to src/V1/Product/Fr/EnergyBill/EnergyBillV1Subscription.php index 04c81e3e..60eb45b9 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..60798be2 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..0c2decad 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 83% rename from src/Product/Fr/IdCard/IdCardV1Page.php rename to src/V1/Product/Fr/IdCard/IdCardV1Page.php index 4239fca1..05c7cdd0 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 96% rename from src/Product/Fr/IdCard/IdCardV2Document.php rename to src/V1/Product/Fr/IdCard/IdCardV2Document.php index 45b38d16..b85660cd 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..d8bcea68 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..35e9af02 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..9bbd4a31 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 67% rename from src/Product/Fr/Payslip/PayslipV3Employer.php rename to src/V1/Product/Fr/Payslip/PayslipV3Employer.php index a46a7689..dffb89d2 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..a8511fc2 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 61% rename from src/Product/Fr/Payslip/PayslipV3PaidTimeOff.php rename to src/V1/Product/Fr/Payslip/PayslipV3PaidTimeOff.php index 25a7fe9c..94782c43 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..6a2999cb 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..0995d0c3 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..fab217ec 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..da89c7b3 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..624d26fb 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..1fc175e9 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..99d65d33 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..1ed17ed3 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..b10b434c 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..ae7801a1 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..1666d7d4 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..1bc987f2 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..ae63f951 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..21512f28 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..7513fb0d 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..4c8a4064 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..f5c3f2db 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..7915d6c1 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..c2ee82ac 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..a5c973f8 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..c1885c09 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..23cf840c 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..01d62900 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..419ab7a3 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..3791e3dd 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..9b204900 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..cdbfccdd 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 92% rename from src/Product/Us/UsMail/UsMailV3Document.php rename to src/V1/Product/Us/UsMail/UsMailV3Document.php index c83f9bcb..53473639 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..ebcdd5df 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/ClientV2.php b/src/V2/Client.php similarity index 91% rename from src/ClientV2.php rename to src/V2/Client.php index fc0ab147..857e3470 100644 --- a/src/ClientV2.php +++ b/src/V2/Client.php @@ -1,27 +1,28 @@ 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/V2/ClientOptions/BaseParameters.php b/src/V2/ClientOptions/BaseParameters.php index a156fb3e..03cbd36b 100644 --- a/src/V2/ClientOptions/BaseParameters.php +++ b/src/V2/ClientOptions/BaseParameters.php @@ -2,7 +2,7 @@ namespace Mindee\V2\ClientOptions; -use Mindee\Input\PollingOptions; +use Mindee\ClientOptions\PollingOptions; /** * Base parameters for running an inference. 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/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..90aa7cd5 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\ErrorResponse; +use Mindee\V2\Parsing\Inference\BaseResponse; +use Mindee\V2\Parsing\Inference\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..3195b931 100644 --- a/src/V2/Parsing/BaseInference.php +++ b/src/V2/Parsing/BaseInference.php @@ -2,10 +2,10 @@ namespace Mindee\V2\Parsing; -use Mindee\Parsing\Common\SummaryHelper; -use Mindee\Parsing\V2\InferenceFile; -use Mindee\Parsing\V2\InferenceJob; -use Mindee\Parsing\V2\InferenceModel; +use Mindee\Parsing\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 @@ + * @var ObjectField */ public array $items; diff --git a/src/Parsing/V2/Field/ObjectField.php b/src/V2/Parsing/Inference/Field/ObjectField.php similarity index 98% rename from src/Parsing/V2/Field/ObjectField.php rename to src/V2/Parsing/Inference/Field/ObjectField.php index cfd440d0..0a3227ec 100644 --- a/src/Parsing/V2/Field/ObjectField.php +++ b/src/V2/Parsing/Inference/Field/ObjectField.php @@ -1,6 +1,6 @@ rag = isset( $serverResponse['rag'] - ) ? new RagMetadata($serverResponse['rag']) : null; + ) ? new RAGMetadata($serverResponse['rag']) : null; } /** diff --git a/src/Parsing/V2/RagMetadata.php b/src/V2/Parsing/Inference/RAGMetadata.php similarity index 87% rename from src/Parsing/V2/RagMetadata.php rename to src/V2/Parsing/Inference/RAGMetadata.php index a2dec186..56b56a13 100644 --- a/src/Parsing/V2/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 45130ca9..c2648307 100644 --- a/tests/Input/LocalInputSourceTest.php +++ b/tests/Input/LocalInputSourceTest.php @@ -2,24 +2,25 @@ namespace Input; -use Mindee\Client; use Mindee\Error\ErrorCode; use Mindee\Error\MindeePDFException; use Mindee\Error\MindeeSourceException; use Mindee\Image\ImageCompressor; +use Mindee\Input\Base64Input; +use Mindee\Input\BytesInput; +use Mindee\Input\FileInput; use Mindee\Input\PageOptions; use Mindee\Input\PathInput; -use Mindee\Input\FileInput; -use Mindee\Input\BytesInput; -use Mindee\Input\Base64Input; use Mindee\PDF\PDFCompressor; use Mindee\PDF\PDFUtils; +use Mindee\V1\Client; use PHPUnit\Framework\TestCase; use setasign\Fpdi\Fpdi; use setasign\Fpdi\PdfParser\PdfParserException; use setasign\Fpdi\PdfReader\PdfReaderException; -use const Mindee\Http\API_KEY_ENV_NAME; +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/Input/URLInputSourceTest.php b/tests/Input/URLInputSourceTest.php index bb43f4ae..a3c05e99 100644 --- a/tests/Input/URLInputSourceTest.php +++ b/tests/Input/URLInputSourceTest.php @@ -2,12 +2,11 @@ namespace Input; -use Mindee\Client; use Mindee\Error\MindeeSourceException; use Mindee\Input\URLInputSource; +use Mindee\V1\Client; use PHPUnit\Framework\TestCase; - -use const Mindee\Http\API_KEY_ENV_NAME; +use const Mindee\V1\HTTP\API_KEY_ENV_NAME; class URLInputSourceTest extends TestCase { diff --git a/tests/V1/Error/MindeeHttpExceptionTest.php b/tests/V1/Error/MindeeHttpExceptionTest.php index be2e0e31..1a248b0e 100644 --- a/tests/V1/Error/MindeeHttpExceptionTest.php +++ b/tests/V1/Error/MindeeHttpExceptionTest.php @@ -2,11 +2,11 @@ namespace V1\Error; -use Mindee\Client; 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 15c25af3..d38c2451 100644 --- a/tests/V1/Extraction/ImageExtractorTest.php +++ b/tests/V1/Extraction/ImageExtractorTest.php @@ -2,12 +2,12 @@ namespace V1\Extraction; -use Mindee\Client; -use Mindee\V1\Image\ImageExtractor; 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 064752dd..ea698572 100644 --- a/tests/V1/Extraction/InvoiceSplitterAutoExtractionTestFunctional.php +++ b/tests/V1/Extraction/InvoiceSplitterAutoExtractionTestFunctional.php @@ -2,18 +2,18 @@ namespace V1\Extraction; -use Mindee\Client; -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 caca0452..4a16da31 100644 --- a/tests/V1/Extraction/PdfExtractorTest.php +++ b/tests/V1/Extraction/PDFExtractorTest.php @@ -3,14 +3,14 @@ namespace V1\Extraction; -use Mindee\Client; -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 bc355a4f..5776a4a8 100644 --- a/tests/V1/Http/MindeeApiTest.php +++ b/tests/V1/Http/MindeeApiTest.php @@ -3,10 +3,10 @@ namespace V1\Http; use Mindee\Error\MindeeException; -use Mindee\Http\MindeeApi; -use Mindee\Product\InvoiceSplitter\InvoiceSplitterV1; +use Mindee\V1\HTTP\MindeeAPI; +use Mindee\V1\Product\InvoiceSplitter\InvoiceSplitterV1; use PHPUnit\Framework\TestCase; -use const Mindee\Http\API_KEY_ENV_NAME; +use const Mindee\V1\HTTP\API_KEY_ENV_NAME; class MindeeApiTest extends TestCase { @@ -23,16 +23,16 @@ protected function tearDown(): void public function testGivenOTSParametersAProperMindeeApiObjectShouldBeCreated() { - $settings = new MindeeApi("my-api-key", InvoiceSplitterV1::$endpointName); + $settings = new MindeeAPI("my-api-key", InvoiceSplitterV1::$endpointName); $this->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..20800724 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 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 f48e153f..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\Http\ResponseValidation; -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 62ce9757..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\Input\PredictOptions; -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 65e84521..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\Client; -use Mindee\Input\PredictMethodOptions; -use Mindee\Input\PredictOptions; -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 48896e73..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 @@ -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/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 1144e612..9e99d3de 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 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 3de066ed..91360e5e 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\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\HTTP\MindeeAPIV2; +use Mindee\V2\Parsing\Inference\InferenceResponse; +use Mindee\V2\Parsing\JobResponse; +use Mindee\V2\Product\Extraction\Params\InferenceParameters; 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..de2d0fa9 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 Mindee\V2\Product\Extraction\Params\InferenceParameters; 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..cc1ea6c6 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\Inference\InferenceResponse; use Mindee\V2\Product\Crop\CropResponse; use Mindee\V2\Product\Crop\Params\CropParameters; +use Mindee\V2\Product\Extraction\Params\InferenceParameters; 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') ?: ''; @@ -81,14 +81,14 @@ 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 + 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 dd12191d..83119fbf 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\Inference\InferenceResponse; +use Mindee\V2\Product\Extraction\Params\InferenceParameters; 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') ?: ''; @@ -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/InferenceParameterTest.php b/tests/V2/Input/InferenceParameterTest.php index c449e46e..4d623d5d 100644 --- a/tests/V2/Input/InferenceParameterTest.php +++ b/tests/V2/Input/InferenceParameterTest.php @@ -3,8 +3,8 @@ namespace V2\Input; -use Mindee\Input\DataSchema; -use Mindee\Input\InferenceParameters; +use Mindee\V2\Product\Extraction\Params\DataSchema; +use Mindee\V2\Product\Extraction\Params\InferenceParameters; use PHPUnit\Framework\TestCase; class InferenceParameterTest extends TestCase diff --git a/tests/V2/Input/LocalResponseV2Test.php b/tests/V2/Input/LocalResponseV2Test.php index 0b1b761e..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\Parsing\V2\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 89b9b1c6..caca52de 100644 --- a/tests/V2/Parsing/InferenceResponseTest.php +++ b/tests/V2/Parsing/InferenceResponseTest.php @@ -2,16 +2,16 @@ namespace V2\Parsing; -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\ErrorItem; +use Mindee\V2\Parsing\ErrorResponse; +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 0a09d4d5..6a805208 100644 --- a/tests/V2/Parsing/JobResponseTest.php +++ b/tests/V2/Parsing/JobResponseTest.php @@ -3,9 +3,9 @@ namespace V2\Parsing; use DateTime; -use Mindee\Error\ErrorItem; -use Mindee\Parsing\V2\ErrorResponse; -use Mindee\Parsing\V2\JobResponse; +use Mindee\V2\Parsing\ErrorItem; +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') ?: ''; }