Spaces:
Sleeping
Sleeping
Download apps/php-sdk/src/Models/SearchOptions.php from s-eto-hub/firecrawl-api: direct link, hf CLI and curl.
- Browser
- Download file 2.47 kB
-
https://huggingface.co/spaces/s-eto-hub/firecrawl-api/resolve/main/apps/php-sdk/src/Models/SearchOptions.php
- Command line
-
hf download hf://spaces/s-eto-hub/firecrawl-api/apps/php-sdk/src/Models/SearchOptions.php
-
curl -L -o SearchOptions.php https://huggingface.co/spaces/s-eto-hub/firecrawl-api/resolve/main/apps/php-sdk/src/Models/SearchOptions.php
2.47 kB
| declare(strict_types=1); | |
| namespace Firecrawl\Models; | |
| final class SearchOptions | |
| { | |
| /** | |
| * @param list<mixed>|null $sources | |
| * @param list<mixed>|null $categories | |
| * @param list<string>|null $includeDomains | |
| * @param list<string>|null $excludeDomains | |
| */ | |
| private function __construct( | |
| private readonly ?array $sources = null, | |
| private readonly ?array $categories = null, | |
| private readonly ?int $limit = null, | |
| private readonly ?string $tbs = null, | |
| private readonly ?string $location = null, | |
| private readonly ?bool $ignoreInvalidURLs = null, | |
| private readonly ?int $timeout = null, | |
| private readonly ?ScrapeOptions $scrapeOptions = null, | |
| private readonly ?string $integration = null, | |
| private readonly ?array $includeDomains = null, | |
| private readonly ?array $excludeDomains = null, | |
| ) {} | |
| /** | |
| * @param list<mixed>|null $sources | |
| * @param list<mixed>|null $categories | |
| * @param list<string>|null $includeDomains | |
| * @param list<string>|null $excludeDomains | |
| */ | |
| public static function with( | |
| ?array $sources = null, | |
| ?array $categories = null, | |
| ?int $limit = null, | |
| ?string $tbs = null, | |
| ?string $location = null, | |
| ?bool $ignoreInvalidURLs = null, | |
| ?int $timeout = null, | |
| ?ScrapeOptions $scrapeOptions = null, | |
| ?string $integration = null, | |
| ?array $includeDomains = null, | |
| ?array $excludeDomains = null, | |
| ): self { | |
| return new self( | |
| $sources, $categories, $limit, $tbs, $location, $ignoreInvalidURLs, | |
| $timeout, $scrapeOptions, $integration, $includeDomains, $excludeDomains, | |
| ); | |
| } | |
| /** @return array<string, mixed> */ | |
| public function toArray(): array | |
| { | |
| $fields = [ | |
| 'sources' => $this->sources, | |
| 'categories' => $this->categories, | |
| 'includeDomains' => $this->includeDomains, | |
| 'excludeDomains' => $this->excludeDomains, | |
| 'limit' => $this->limit, | |
| 'tbs' => $this->tbs, | |
| 'location' => $this->location, | |
| 'ignoreInvalidURLs' => $this->ignoreInvalidURLs, | |
| 'timeout' => $this->timeout, | |
| 'scrapeOptions' => $this->scrapeOptions?->toArray(), | |
| 'integration' => $this->integration, | |
| ]; | |
| return array_filter($fields, fn (mixed $v): bool => $v !== null); | |
| } | |
| } | |