Fixed errors

This commit is contained in:
Jan Böhmer 2026-05-01 20:11:56 +02:00
parent 4f67f21b33
commit 4cbb167e5c
2 changed files with 8 additions and 4 deletions

View file

@ -50,6 +50,8 @@ class GenericWebProvider implements InfoProviderInterface
use FixAndValidateUrlTrait;
public const OPTION_CHECK_FOR_DELEGATION = 'check_for_delegation';
public const DISTRIBUTOR_NAME = 'Website';
private readonly HttpClientInterface $httpClient;
@ -99,7 +101,7 @@ class GenericWebProvider implements InfoProviderInterface
try {
return [
$this->getDetails($keyword, false) //We already tried delegation
$this->getDetails($keyword, [self::OPTION_CHECK_FOR_DELEGATION => false]) //We already tried delegation
]; } catch (ProviderIDNotSupportedException $e) {
return [];
}
@ -312,8 +314,10 @@ class GenericWebProvider implements InfoProviderInterface
public function getDetails(string $id, bool $check_for_delegation = true): PartDetailDTO
public function getDetails(string $id, array $options = []): PartDetailDTO
{
//We check for delegation by default
$check_for_delegation = $options[self::OPTION_CHECK_FOR_DELEGATION] ?? true;
$url = $this->fixAndValidateURL($id);
if ($check_for_delegation) {

View file

@ -76,7 +76,7 @@ class MouserProvider implements InfoProviderInterface
return $this->settings->apiKey !== '' && $this->settings->apiKey !== null;
}
public function searchByKeyword(string $keyword): array
public function searchByKeyword(string $keyword, array $options = []): array
{
/*
SearchByKeywordRequest description:
@ -144,7 +144,7 @@ class MouserProvider implements InfoProviderInterface
return $this->responseToDTOArray($response);
}
public function getDetails(string $id): PartDetailDTO
public function getDetails(string $id, array $options = []): PartDetailDTO
{
/*
SearchByPartRequest description: