Skip to content

Commit 20c7156

Browse files
committed
fix codeql with runtime safety
1 parent b5bf5f2 commit 20c7156

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/Usage/Adapter/ClickHouse.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ public function setup(): void
456456
$attributes = $index['attributes'];
457457
// Escape index name and attribute names to prevent SQL injection
458458
$escapedIndexName = $this->escapeIdentifier($indexName);
459-
$escapedAttributes = array_map(fn ($attr) => $this->escapeIdentifier($attr), $attributes);
459+
$escapedAttributes = array_map(fn($attr) => $this->escapeIdentifier($attr), $attributes);
460460
$attributeList = implode(', ', $escapedAttributes);
461461
$indexes[] = "INDEX {$escapedIndexName} ({$attributeList}) TYPE bloom_filter GRANULARITY 1";
462462
}
@@ -559,6 +559,9 @@ private function formatDateTime($dateTime): string
559559
throw new Exception("Invalid datetime string: {$dateTime}");
560560
}
561561
}
562+
563+
/** @phpstan-ignore-next-line */
564+
throw new Exception("Invalid datetime value type: " . gettype($dateTime));
562565
}
563566
/**
564567
* Get ClickHouse-specific SQL column definition for a given attribute ID.

0 commit comments

Comments
 (0)