2025-06-29 21:33:18 +02:00
|
|
|
<?php
|
|
|
|
|
|
2025-08-15 16:39:18 +02:00
|
|
|
namespace Domains\Article\Contracts;
|
2025-06-29 21:33:18 +02:00
|
|
|
|
|
|
|
|
interface ArticleParserInterface
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Check if this parser can handle the given URL
|
|
|
|
|
*/
|
|
|
|
|
public function canParse(string $url): bool;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Extract article data from HTML
|
2025-07-07 00:51:32 +02:00
|
|
|
* @return array<string, mixed>
|
2025-06-29 21:33:18 +02:00
|
|
|
*/
|
|
|
|
|
public function extractData(string $html): array;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the source name for this parser
|
|
|
|
|
*/
|
|
|
|
|
public function getSourceName(): string;
|
|
|
|
|
}
|