PS: I am using Symfony4. The example in examples/LayoutAndGeneral/parseStyles/samples_3.php seems to be working. This is the actual code in my controller.
use Phpdocx\Create\CreateDocx;
/**
* @Route("/parse")
*/
public function parse()
{
$url = $this->getParameter('kernel.project_dir') . '/public/examples/stylesTemplate.docx';
$docx = new CreateDocx($url);
$docx->parseStyles();
$docx->createDocx('parse.docx');
}