private function shouldRemoveStack(array $stack): bool
    {
        if (empty($stack['class'])) {
            return false;
        }

        foreach ($this->ignoreBacktraceNamespaces as $namespace) {
            if (0 === strpos($stack['class'], $namespace)) {
                return true;
            }
        }

        return false;
    }