canRead($docFile)) { $section = $phpWord->addSection(); HTMLParser::addHtml($section, file_get_contents($docFile), true); } else { throw new \Exception("Cannot read {$docFile}."); } return $phpWord; } }