From abd5768044fe91e5e7c04fa26f2de85f96899bec Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Fri, 26 Jan 2024 16:48:55 -0500 Subject: [PATCH] Add documentation to DisposableFullTextSearch->idenfier field --- src/Database/DisposableFullTextSearch.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Database/DisposableFullTextSearch.php b/src/Database/DisposableFullTextSearch.php index 9cf6337936..3516080f76 100644 --- a/src/Database/DisposableFullTextSearch.php +++ b/src/Database/DisposableFullTextSearch.php @@ -30,12 +30,15 @@ namespace Friendica\Database; class DisposableFullTextSearch { private Database $db; + /** @var int Unique identifier of the haystack in the database. */ private int $identifier; public function __construct(Database $database, string $haystack) { $this->db = $database; + // Unique identifier generation. Two DisposableFullTextSearch object should never have the same as the first object destruction + // would delete both check-full-text-search rows, before the second object destruction is called, leading to unexpected behavior. // Maximum value is indicated by the INT UNSIGNED type of the check-full-text-search.pid field $this->identifier = random_int(0, pow(2, 32) - 1);