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