Skip to content

Commit

Permalink
BaseAuthorizator: Internal optimalization.
Browse files Browse the repository at this point in the history
  • Loading branch information
janbarasek committed Aug 4, 2021
1 parent 968f93d commit c565ee9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/BaseAuthorizator.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ public function authOrders(
*/
public function getUnmatchedTransactions(array $validVariables): array
{
if (($validVariables !== [] || array_keys($validVariables) === range(0, count($validVariables) - 1)) === false) {
if ($validVariables === []) {
return [];
}
if (array_keys($validVariables) !== range(0, count($validVariables) - 1)) {
throw new \InvalidArgumentException(
'The variables array must be associative.' . "\n"
. 'To solve this issue: Remove other values that are not valid variable symbols. You can do this, '
Expand Down

0 comments on commit c565ee9

Please sign in to comment.