2026-04-26 16:45:07 +02:00
< ? php
declare ( strict_types = 1 );
namespace App\ValueObjects ;
use App\Enums\CrawlOutcomeEnum ;
use Illuminate\Support\Collection ;
2026-04-26 19:49:08 +02:00
final readonly class FetchResult
2026-04-26 16:45:07 +02:00
{
2026-04-26 16:50:43 +02:00
/**
2026-04-26 19:49:08 +02:00
* @ param ? string $finalUrl Set to the request URL in v0 . 1 ; true post - redirect URL tracking is deferred ( see ticket #12 spec). Downstream consumers MUST NOT trust this field as the post-redirect location until that lands.
2026-04-26 16:50:43 +02:00
* @ param Collection < int , string > $outboundLinks
*/
2026-04-26 16:45:07 +02:00
public function __construct (
public CrawlOutcomeEnum $outcome ,
2026-04-26 16:50:43 +02:00
public ? int $statusCode ,
public ? string $finalUrl ,
public ? string $title ,
public ? string $extractedText ,
2026-04-26 16:45:07 +02:00
public Collection $outboundLinks ,
2026-04-26 16:50:43 +02:00
public ? int $wordCount ,
2026-04-26 16:45:07 +02:00
public ? string $errorMessage ,
2026-04-28 00:38:46 +02:00
public ? string $language = null ,
public ? float $languageConfidence = null ,
2026-04-26 16:45:07 +02:00
) {}
}