private function isExclude(string $key): bool
    {
        if (!empty($this->excludes) && in_array($key, $this->excludes, true)) {
            return true;
        }

        if (!empty($this->only) && !in_array($key, $this->only, true)) {
            return true;
        }

        return false;
    }