fix: utiliser @codeCoverageIgnore en PHPDoc au lieu de commentaires inline
src/Controller/WebhookDocuSealController.php: - downloadDocumentsFromWebhook(): @codeCoverageIgnore deplace du commentaire inline vers le PHPDoc de la methode pour une meilleure compatibilite avec les outils de coverage src/Service/DocuSealService.php: - downloadSignedPdf(): meme correction, @codeCoverageIgnore en PHPDoc - downloadAuditCertificate(): meme correction Note: PHPUnit text coverage compte toujours la methode ignoree dans le compteur methodes (8/9 = 88.89%) mais exclut ses lignes (94.62%). C'est un comportement connu de PHPUnit - la methode est I/O (file_get_contents sur URL externe) et non testable unitairement. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -201,7 +201,9 @@ class WebhookDocuSealController extends AbstractController
|
||||
/**
|
||||
* @param array<string, mixed> $data
|
||||
*/
|
||||
// @codeCoverageIgnoreStart
|
||||
/**
|
||||
* @codeCoverageIgnore Telecharge les PDFs depuis des URLs externes (non testable unitairement)
|
||||
*/
|
||||
private function downloadDocumentsFromWebhook(array $data, Attestation $attestation, string $projectDir): void
|
||||
{
|
||||
$dir = $projectDir.'/var/rgpd/signed';
|
||||
@@ -232,7 +234,6 @@ class WebhookDocuSealController extends AbstractController
|
||||
}
|
||||
}
|
||||
}
|
||||
// @codeCoverageIgnoreEnd
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $data
|
||||
|
||||
@@ -133,8 +133,10 @@ class DocuSealService
|
||||
return $dir;
|
||||
}
|
||||
|
||||
// @codeCoverageIgnoreStart
|
||||
/** @param list<array<string, mixed>> $documents */
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
* @param list<array<string, mixed>> $documents
|
||||
*/
|
||||
private function downloadSignedPdf(array $documents, string $dir, string $ref, Attestation $attestation): void
|
||||
{
|
||||
$pdfUrl = $documents[0]['url'] ?? null;
|
||||
@@ -150,7 +152,10 @@ class DocuSealService
|
||||
}
|
||||
}
|
||||
|
||||
/** @param array<string, mixed> $submitter */
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
* @param array<string, mixed> $submitter
|
||||
*/
|
||||
private function downloadAuditCertificate(array $submitter, string $dir, string $ref, Attestation $attestation): void
|
||||
{
|
||||
$auditUrl = $submitter['audit_log_url'] ?? null;
|
||||
@@ -165,5 +170,4 @@ class DocuSealService
|
||||
$attestation->setPdfFileCertificate($path);
|
||||
}
|
||||
}
|
||||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user