Skip to content

Commit 618e0d3

Browse files
Make error handling for missing auth_queries key more obvious
1 parent 630316d commit 618e0d3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Auth/Source/SQL2.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,12 @@ public function __construct(array $info, array $config)
113113
}
114114

115115
// Check auth_queries configuration that all required parameters are present
116-
if (array_key_exists('auth_queries', $config)) {
116+
if (!array_key_exists('auth_queries', $config)) {
117+
throw new Exception(
118+
'Missing required attribute \'auth_queries\' for authentication source ' .
119+
$this->authId,
120+
);
121+
} else {
117122
if (!is_array($config['auth_queries'])) {
118123
throw new Exception('Required parameter \'auth_queries\' for authentication source ' .
119124
$this->authId . ' was provided and is expected to be an array. Instead it was: ' .
@@ -197,11 +202,6 @@ public function __construct(array $info, array $config)
197202
$authQueryConfig['password_verify_hash_column'];
198203
}
199204
}
200-
} else {
201-
throw new Exception(
202-
'Missing required attribute \'auth_queries\' for authentication source ' .
203-
$this->authId,
204-
);
205205
}
206206

207207
// attr_queries is optional, but if specified, we need to check the parameters

0 commit comments

Comments
 (0)