private function preventDirectoryTraversal(string $themePath, string $filePath)
    {
        $themePath = realpath($themePath);
        $filePath  = realpath($filePath);

        if ($filePath === false || strpos($filePath, $themePath) !== 0) {
            throw new DirectoryTraversalException('Trying to load a file outside of the theme directory.');
        }
    }