PHPWord
PHPWord copied to clipboard
TemplateProcessor can accept a file contents instead of the file path
Description
In many projects, Devs are now using Cloud storage (such as AWS S3). So, having a word template in a S3 storage would force the dev to save it to a custom/temporary path and then give the path to the TemplateProcessor constructor.
I submit this PR so the constructor can ALSO accept the file contents. If the given parameter is a path to a valid file, then the constructor works as before. Else, we suppose that the parameter contains the file contents, and then we save it to the tempDocumentFilename, and use it as we did before.
Checklist:
- [x] I have run
composer run-script check --timeout=0and no errors were reported - [x] The new code is covered by unit tests (check build/coverage for coverage report)
- [x] I have updated the documentation to describe the changes