Skip to content

Commit a656c26

Browse files
authored
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.
1 parent b442ad5 commit a656c26

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ConditionAnalyzer/Analyzer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ private function hasValidQueryOperator($hash, $range = null)
201201
{
202202
$hashCondition = $this->getCondition($hash);
203203

204-
$validQueryOp = ComparisonOperator::isValidQueryDynamoDbOperator($hashCondition['type']);
204+
$validQueryOp = ComparisonOperator::isValidQueryDynamoDbOperator($hashCondition['type'] ?? null);
205205

206206
if ($validQueryOp && $range) {
207207
$rangeCondition = $this->getCondition($range);

0 commit comments

Comments
 (0)