From a656c26200787d31382a8dbe32d769afe1ea04ac Mon Sep 17 00:00:00 2001 From: Tudor-Dan Ravoiu Date: Mon, 23 Mar 2020 06:46:07 +0200 Subject: [PATCH] Fix PHP ^7.4 Notice: Trying to access array offset on value of type null (#217) It seems that under PHP ^7.4 this check is throwing an notice when trying to run a query without using primary/composite key as filter attributes (so when trying to run a DynamoDB scan). This fix checks if the key is set and uses null otherwise. --- src/ConditionAnalyzer/Analyzer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ConditionAnalyzer/Analyzer.php b/src/ConditionAnalyzer/Analyzer.php index 9fb0740..5ecba99 100644 --- a/src/ConditionAnalyzer/Analyzer.php +++ b/src/ConditionAnalyzer/Analyzer.php @@ -201,7 +201,7 @@ private function hasValidQueryOperator($hash, $range = null) { $hashCondition = $this->getCondition($hash); - $validQueryOp = ComparisonOperator::isValidQueryDynamoDbOperator($hashCondition['type']); + $validQueryOp = ComparisonOperator::isValidQueryDynamoDbOperator($hashCondition['type'] ?? null); if ($validQueryOp && $range) { $rangeCondition = $this->getCondition($range);