Skip to content

Conversation

moghwan
Copy link
Contributor

@moghwan moghwan commented Aug 4, 2024

Description

This PR adds a limit parameter to the cloneBlock function. This will help to minimize processing when the limit is needed for a bulk cloning operation, especially when there are multiple occurrences of the same block in the document.

example:

$templateProcessor = new TemplateProcessor('sample.docx');

// current
// This will clone all occurrences of the "block" in the document
$templateProcessor->cloneBlock('block', 3);

// improvement
// assuming we want to clone only the first occurrence of the "block":
$templateProcessor->cloneBlock('block', 3, true, false, null, 1);

Checklist:

  • My CI is 🟢
  • I have covered by unit tests my new code (check build/coverage for coverage report)
  • I have updated the documentation to describe the changes
  • I have updated the changelog

@coveralls
Copy link

coveralls commented Aug 4, 2024

Coverage Status

coverage: 96.667% (-0.09%) from 96.757%
when pulling 9eea948 on moghwan:feat/add-limit-to-cloneblock
into 0ab0b49 on PHPOffice:master.

@moghwan moghwan marked this pull request as ready for review July 4, 2025 16:59
@moghwan
Copy link
Contributor Author

moghwan commented Jul 4, 2025

hello @Progi1984, I've updated my branch with master, do my improvments require to update the unit test even all is green ? let me know if so!

@moghwan
Copy link
Contributor Author

moghwan commented Aug 5, 2025

@Progi1984 care to review this PR please ?

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

Successfully merging this pull request may close these issues.

2 participants