Skip to content

Conversation

miguelfrmn
Copy link

@miguelfrmn miguelfrmn commented May 3, 2025

I'm implementing this library for the upcoming official electronic invoicing system required by the Dominican Republic's IRS (DGII).

For that use case, some parameters need to be set (related to C14N and preserving whitespaces). This pull request adds the option to specifying those parameters.

@odan
Copy link
Member

odan commented May 5, 2025

Thanks for the PR.

Please check the test results: https://github.com/selective-php/xmldsig/actions/runs/14814040829/job/41639555159?pr=29

@odan
Copy link
Member

odan commented May 18, 2025

Please check for the latest build result. Note: Locally you can also run "composer stan" or "composer test:all" to see the results.

@miguelfrmn
Copy link
Author

Did you check it out?

@odan
Copy link
Member

odan commented Jul 17, 2025

I will check today.

{
$element = $element ?? $document->documentElement;

if ($element === null) {
throw new XmlSignerException('Invalid XML document element');
}

$canonicalData = $element->C14N(true, false);
$canonicalData = $element->C14N($this->exclusive, false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the use case for this?


public function __construct(
CryptoSignerInterface $cryptoSigner,
bool $preserveWhiteSpace = true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer having immutable with* Methods for these new parameters.
e.g. withPreserveWhiteSpace() and withExclusive()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants