public function getNamespaceRootToDirectoryFromFqn(string $fqn, string $directory): ?string
    {
        $strPos = \strrpos(
            $fqn,
            $directory
        );
        if (false !== $strPos) {
            return $this->tidy(\substr($fqn, 0, $strPos + \strlen($directory)));
        }

        return null;
    }