mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-01-21 09:39:34 +00:00
Made $resultData local as it is only used inside searchByKeyword
This commit is contained in:
parent
cede73e767
commit
4e36578e7b
1 changed files with 5 additions and 23 deletions
|
|
@ -112,25 +112,6 @@ class OEMSecretsProvider implements InfoProviderInterface
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
// Store each data category in separate arrays
|
|
||||||
// PHPStan is currently flagging these arrays with the message "is never read, only written,"
|
|
||||||
// which is unnecessary. The arrays in question are indeed being read, but on a per-element basis
|
|
||||||
// rather than as whole arrays. To avoid cluttering the code with redundant checks that do not improve
|
|
||||||
// functionality or performance, it's best to ignore this specific warning.
|
|
||||||
//
|
|
||||||
// @phpstan-ignore-next-line
|
|
||||||
private array $basicInfoResults = [];
|
|
||||||
// @phpstan-ignore-next-line
|
|
||||||
private array $datasheetsResults = [];
|
|
||||||
// @phpstan-ignore-next-line
|
|
||||||
private array $imagesResults = [];
|
|
||||||
// @phpstan-ignore-next-line
|
|
||||||
private array $parametersResults = [];
|
|
||||||
// @phpstan-ignore-next-line
|
|
||||||
private array $purchaseInfoResults = [];
|
|
||||||
|
|
||||||
private array $resultsData = [];
|
|
||||||
|
|
||||||
private array $countryNameToCodeMap = [
|
private array $countryNameToCodeMap = [
|
||||||
'Andorra' => 'AD',
|
'Andorra' => 'AD',
|
||||||
|
|
@ -370,7 +351,8 @@ class OEMSecretsProvider implements InfoProviderInterface
|
||||||
//------------------*/
|
//------------------*/
|
||||||
|
|
||||||
$products = $response_array['stock'] ?? [];
|
$products = $response_array['stock'] ?? [];
|
||||||
|
|
||||||
|
$results = [];
|
||||||
$basicInfoResults = [];
|
$basicInfoResults = [];
|
||||||
$datasheetsResults = [];
|
$datasheetsResults = [];
|
||||||
$imagesResults = [];
|
$imagesResults = [];
|
||||||
|
|
@ -394,7 +376,7 @@ class OEMSecretsProvider implements InfoProviderInterface
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($partDetailDTO !== null) {
|
if ($partDetailDTO !== null) {
|
||||||
$this->resultsData[$provider_id] = $partDetailDTO;
|
$results[$provider_id] = $partDetailDTO;
|
||||||
$cacheKey = $this->getCacheKey($provider_id);
|
$cacheKey = $this->getCacheKey($provider_id);
|
||||||
$cacheItem = $this->partInfoCache->getItem($cacheKey);
|
$cacheItem = $this->partInfoCache->getItem($cacheKey);
|
||||||
$cacheItem->set($partDetailDTO);
|
$cacheItem->set($partDetailDTO);
|
||||||
|
|
@ -404,8 +386,8 @@ class OEMSecretsProvider implements InfoProviderInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sort of the results
|
// Sort of the results
|
||||||
$this->sortResultsData($this->resultsData, $keyword);
|
$this->sortResultsData($results, $keyword);
|
||||||
return $this->resultsData;
|
return $results;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue