signature: fix cs + test PDFParser

This commit is contained in:
nobohan 2024-07-12 14:31:34 +02:00
parent 421226c0dc
commit 67395f52b5
4 changed files with 9 additions and 11 deletions

View File

@ -224,7 +224,7 @@ class DocumentPersonController extends AbstractController
$signature['storedObject'] = [ // TEMP
'filename' => $storedObject->getFilename(),
'iv' => $storedObject->getIv(),
'keyInfos' => $storedObject->getKeyInfos()
'keyInfos' => $storedObject->getKeyInfos(),
];
$signature['zones'] = $zones;

View File

@ -11,13 +11,11 @@ declare(strict_types=1);
namespace Chill\DocStoreBundle\Controller;
use Chill\DocStoreBundle\Entity\StoredObject;
use Chill\DocStoreBundle\Service\Signature\Driver\BaseSigner\RequestPdfSignMessage;
use Chill\DocStoreBundle\Service\Signature\PDFPage;
use Chill\DocStoreBundle\Service\Signature\PDFSignatureZone;
use Chill\DocStoreBundle\Service\StoredObjectManagerInterface;
use Chill\MainBundle\Entity\Workflow\EntityWorkflowStepSignature;
use Chill\MainBundle\Entity\Workflow\EntityWorkflowSignatureStateEnum;
use Chill\MainBundle\Workflow\EntityWorkflowManager;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;

View File

@ -50,7 +50,7 @@ class PDFSignatureZoneParser
foreach ($page->getDataTm() as $dataTm) {
if (str_starts_with($dataTm[1], self::ZONE_SIGNATURE_START)) {
$zones[] = new PDFSignatureZone((int) $zoneIndex, (float) $dataTm[0][4], (float) $dataTm[0][5], $this->defaultHeight, $this->defaultWidth, $pdfPage);
$zoneIndex++;
++$zoneIndex;
}
}
}

View File

@ -61,7 +61,7 @@ class PDFSignatureZoneParserTest extends TestCase
0,
127.7,
95.289,
180.0,
90.0,
180.0,
$page = new PDFPage(0, 595.30393, 841.8897)
),
@ -69,7 +69,7 @@ class PDFSignatureZoneParserTest extends TestCase
1,
269.5,
95.289,
180.0,
90.0,
180.0,
$page,
),