pimcore / web-to-print-bundle

Web-to-Print community bundle adds web-to-print features to Pimcore documents.
https://pimcore.com/docs/platform/Web_To_Print/
Other
4 stars 12 forks source link

[Task]: Remove unecessary if condition when setting margins via Gotenberg #34

Closed matthiashamacher closed 1 year ago

matthiashamacher commented 1 year ago

If you would set any of the margins, except marginRight to 0 the if condition would evaluate to false and therefore the margins won't be set. By checking all with isset the condition would be true if any one of them is set and the margins will be applied

kingjia90 commented 1 year ago

Probably we don't need this IF at all because of https://github.com/pimcore/web-to-print-bundle/blob/b2787734511613848e5b238458ed6a3731ad9daa/src/Processor/Gotenberg.php#L122-L127

If margins() method is not called here, it's going to be 0.39 by default anyways, so this null coalescing would cover it

matthiashamacher commented 1 year ago

@kingjia90 Good Point. I've updated the PR and removed the if condition.