bearsunday /
BEAR.Resource
| 1 | <?php |
||
| 2 | |||
| 3 | declare(strict_types=1); |
||
| 4 | |||
| 5 | namespace BEAR\Resource; |
||
| 6 | |||
| 7 | use BEAR\Resource\Annotation\Link; |
||
| 8 | |||
| 9 | /** |
||
| 10 | * Interface for crawl link processing |
||
| 11 | * |
||
| 12 | * This interface allows different implementations for sequential (sync) |
||
| 13 | * and parallel (async) crawl execution. |
||
| 14 | * |
||
| 15 | * @psalm-import-type Query from Types |
||
| 16 | * @psalm-import-type QueryList from Types |
||
| 17 | */ |
||
| 18 | interface LinkCrawlerInterface |
||
| 19 | { |
||
| 20 | /** |
||
| 21 | * Process crawl links for a list of body items |
||
| 22 | * |
||
| 23 | * @param list<Link> $annotations Link annotations from the resource method |
||
| 24 | * @param LinkType $link The crawl link type |
||
| 25 | * @param array<array-key, array<string, mixed>> $bodyList Reference to body items to be updated with linked data |
||
|
0 ignored issues
–
show
Documentation
Bug
introduced
by
Loading history...
|
|||
| 26 | * |
||
| 27 | * @param-out array<array-key, array<string, mixed>> $bodyList |
||
| 28 | */ |
||
| 29 | public function crawl(array $annotations, LinkType $link, array &$bodyList): void; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Determine if the value is a list (multiple rows) or a single row |
||
| 33 | */ |
||
| 34 | public function isList(mixed $value): bool; |
||
| 35 | } |
||
| 36 |