Skip to content

Commit 56c95d1

Browse files
committed
Add generic notation to sudo method
1 parent df2aa2d commit 56c95d1

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

bundle/API/Repository/TagsService.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,17 @@ public function newTagUpdateStruct(): TagUpdateStruct;
297297
* static fn (TagsService $tagsService): Tag => $tagsService->loadTag($tagId),
298298
* );
299299
*
300+
* @template T
301+
*
302+
* @param \Netgen\TagsBundle\API\Repository\TagsService|null $outerTagsService optional, mostly
303+
* for internal use but allows to specify TagsService to pass to closure
304+
*
305+
* @phpstan-param callable(\Netgen\TagsBundle\API\Repository\TagsService): T $callback
306+
*
300307
* @throws \RuntimeException Thrown on recursive sudo() use
301308
* @throws \Exception Re throws exceptions thrown inside $callback
309+
*
310+
* @return T
302311
*/
303312
public function sudo(callable $callback, ?self $outerTagsService = null): mixed;
304313
}

0 commit comments

Comments
 (0)