Hello,
DOCX documents can apply a text alignment to the whole paragraph (https://support.microsoft.com/en-us/office/align-text-left-or-right-center-text-or-justify-text-on-a-page-70da744d-0f4d-472e-916d-1c42d94dc33f). A DOCX doesn't support applying distinct text alignments in the same paragraph.
addText (https://www.phpdocx.com/api-documentation/word-content/add-paragraph-text-Word-document-with-PHP) includes the textAlign option to set the text alignment.
Regards.