Hello,
The current stable version of phpdocx doesn't include a method to add barcodes (unless you create the QR with an external library/program as an image and add it with addImage). We have added an internal task to include it in the next stable version of phpdocx (no release date has been set).
If you know the exact syntax of the barcode, you can use addCrossReference to add it. For example:
$docx->addCrossReference('', array(
'type' => 'bookmark',
'referenceName'=> 'DisplayBarcode "https://www.microsoft.com" QR \q 3',
'referenceTo' => '',
'modifiers' => ''
));
where referenceName is the barcode syntax to be added. In this sample, a link to "https://www.microsoft.com".
You could also use addWordML to insert the whole paragraph, adding raw WordML, but the previous approach with addCrosReference is easier.
The next stable release of phpdocx will include a new method to add barcodes.
Regards.