fileExists($indexHtmlPath)) { return new EmptyMatchResult(); } $fileContent = $fs->read($indexHtmlPath); $inspectorHelper = new InspectorHelper(); return $inspectorHelper->fileContentMatchesString( $fileContent, '//' ) || $this->fileContainsDOMStructure($fileContent) ? new MatchResult($path) : new EmptyMatchResult(); } private function fileContainsDOMStructure(string $fileContent): bool { $dom = new DOMDocument(); try { libxml_use_internal_errors(true); $domIsLoaded = $dom->loadHTML($fileContent); libxml_clear_errors(); } catch (Throwable) { return false; } if ($domIsLoaded === false) { return false; } $xpath = new DOMXPath($dom); // Find the