$errorData) { if (!empty($this->acceptedErrorKeys) && !in_array($key, $this->acceptedErrorKeys)) { throw new \Exception('The key ' . esc_html($key) . ' is not accepted in the data array.'); } } } $this->settingErrors = $settingErrors; return $this; } /** * Get the setting errors from the exception */ public function getErrors(): array { return $this->settingErrors; } }