Skip to content

Commit

Permalink
Simplify test for configuration functions
Browse files Browse the repository at this point in the history
  • Loading branch information
ddrury committed Feb 20, 2023
1 parent edba22d commit d9a8eda
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions app/Module/ModuleMapProviderTrait.php
Expand Up @@ -53,9 +53,7 @@ public function hasApiKey(): bool
$api_key = $this->getPreference('api_key');

// Do the functions to manage the config page exist in the provider module?
$function_diff = array_diff(get_class_methods(get_class($this)), get_class_methods((string) get_parent_class($this)));

$error = in_array("getAdminAction", $function_diff) && $api_key === '';
$error = in_array("getAdminAction", get_class_methods($this)) && $api_key === '';
if ($error && Auth::isAdmin()) {
$message = I18N::translate('<a href="%s">The %s service requires an API key.', e($this->getConfigLink()), $this->title());

Expand Down

0 comments on commit d9a8eda

Please sign in to comment.