Skip to content

Commit dfc2971

Browse files
committed
Support surface factory callbacks in all relevant Context methods
1 parent b67030f commit dfc2971

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/Context.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ public function fmt(): Formatter
288288
* Acks generally have an empty body, but for some payload types, it may be appropriate to send a message (command)
289289
* or other data (block_suggestion) as part of the ack.
290290
*
291-
* @param Message|JsonSerializable|array|string|null $ack Message or data to include in the ack's body.
291+
* @param Message|JsonSerializable|array|string|callable(): Message|null $ack Message/data to use as the ack body.
292292
* @throws JsonException if non-null ack cannot be JSON encoded.
293293
*/
294294
public function ack($ack = null): void
@@ -337,7 +337,7 @@ public function error(string $error): void
337337
}
338338

339339
/**
340-
* @param Message|array|string $message
340+
* @param Message|array|string|callable(): Message $message
341341
* @param string|null $url
342342
*/
343343
public function respond($message, ?string $url = null): void
@@ -355,7 +355,7 @@ public function respond($message, ?string $url = null): void
355355
}
356356

357357
/**
358-
* @param Message|array|string $message
358+
* @param Message|array|string|callable(): Message $message
359359
* @param string|null $channel
360360
* @param string|null $threadTs
361361
*/
@@ -376,7 +376,7 @@ public function say($message, ?string $channel = null, ?string $threadTs = null)
376376
}
377377

378378
/**
379-
* @param AppHome|array|string $appHome
379+
* @param AppHome|array|string|callable(): AppHome $appHome
380380
* @return array
381381
*/
382382
public function home($appHome): array

src/Contexts/Modals.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function __construct(Context $context)
1818
}
1919

2020
/**
21-
* @param Modal|array|string $modal
21+
* @param Modal|array|string|callable(): Modal $modal
2222
* @param string|null $triggerId
2323
* @return array
2424
*/
@@ -38,7 +38,7 @@ public function open($modal, ?string $triggerId = null): array
3838
}
3939

4040
/**
41-
* @param Modal|array|string $modal
41+
* @param Modal|array|string|callable(): Modal $modal
4242
* @param string|null $triggerId
4343
* @return array
4444
*/
@@ -58,7 +58,7 @@ public function push($modal, ?string $triggerId = null): array
5858
}
5959

6060
/**
61-
* @param Modal|array|string $modal
61+
* @param Modal|array|string|callable(): Modal $modal
6262
* @param string|null $viewId
6363
* @param string|null $hash
6464
* @param string|null $externalId

src/Contexts/View.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function errors(array $errors): void
3737
}
3838

3939
/**
40-
* @param Modal|array|string $modal
40+
* @param Modal|array|string|callable(): Modal $modal
4141
*/
4242
public function push($modal): void
4343
{
@@ -48,7 +48,7 @@ public function push($modal): void
4848
}
4949

5050
/**
51-
* @param Modal|array|string $modal
51+
* @param Modal|array|string|callable(): Modal $modal
5252
*/
5353
public function update($modal): void
5454
{

0 commit comments

Comments
 (0)