1 | <?php |
||
16 | final class CallbackLinkGenerator implements MentionLinkGeneratorInterface |
||
17 | { |
||
18 | /** |
||
19 | * A callback function which returns the URL to use, or null if no link should be generated |
||
20 | * |
||
21 | * @var callable(string, string, string): ?string |
||
22 | */ |
||
23 | private $callback; |
||
24 | |||
25 | 12 | public function __construct(callable $callback) |
|
29 | |||
30 | 12 | public function generateLink(string $symbol, string $handle): ?Link |
|
45 | } |
||
46 |