private function isValidNamespace($namespace, $directories): bool
    {
        if (is_string($namespace) && is_array($directories)) {
            $total = count($directories);
            $valid = count(array_filter($directories, 'is_string'));

            return $total > 0 && $total == $valid;
        }

        return false;
    }