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;
    }
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;
    }
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 ; }
Check whether current key is excluded.

@param string $key

@return bool
Check whether current key is excluded .