From edf287e3424355d18a2792481de1cda17bf3648e Mon Sep 17 00:00:00 2001 From: Gert de Pagter Date: Wed, 6 Nov 2024 15:37:16 +0100 Subject: [PATCH] minor: Add templated types to flush_after (#719) --- src/Persistence/PersistenceManager.php | 6 +++++- src/Persistence/functions.php | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Persistence/PersistenceManager.php b/src/Persistence/PersistenceManager.php index ed18cd05..88979e6d 100644 --- a/src/Persistence/PersistenceManager.php +++ b/src/Persistence/PersistenceManager.php @@ -76,7 +76,11 @@ public function save(object $object): object } /** - * @param callable():mixed $callback + * @template T + * + * @param callable():T $callback + * + * @return T */ public function flushAfter(callable $callback): mixed { diff --git a/src/Persistence/functions.php b/src/Persistence/functions.php index 651ce0ea..b38b608c 100644 --- a/src/Persistence/functions.php +++ b/src/Persistence/functions.php @@ -149,7 +149,11 @@ function delete(object $object): object } /** - * @param callable():mixed $callback + * @template T + * + * @param callable():T $callback + * + * @return T */ function flush_after(callable $callback): mixed {