Improved code formatting

This commit is contained in:
Jan Böhmer 2024-09-09 00:24:24 +02:00
parent d4fb2ba46a
commit ef22856e5c

View file

@ -487,7 +487,7 @@ class OEMSecretsProvider implements InfoProviderInterface
* 4. Remaining distributors are sorted alphabetically by region and country_code.
*/
private function processBatch(
private function processBatch(
array $product,
string $provider_id,
array &$basicInfoResults,
@ -495,7 +495,7 @@ class OEMSecretsProvider implements InfoProviderInterface
array &$imagesResults,
array &$parametersResults,
array &$purchaseInfoResults
): ?PartDetailDTO
): ?PartDetailDTO
{
if (!isset($product['manufacturer'], $product['part_number'])) {
throw new \InvalidArgumentException("Missing required product data: 'manufacturer' or 'part_number'");
@ -531,8 +531,8 @@ class OEMSecretsProvider implements InfoProviderInterface
}
$existingBasicInfo = isset($basicInfoResults[$provider_id]) && is_array($basicInfoResults[$provider_id])
? $basicInfoResults[$provider_id]
: [];
? $basicInfoResults[$provider_id]
: [];
$basicInfoResults[$provider_id] = $this->createOrUpdateBasicInfo(
$provider_id,
@ -654,7 +654,7 @@ class OEMSecretsProvider implements InfoProviderInterface
}
/**
/**
* Extracts pricing information from the product data, converts it to PriceDTO objects,
* and returns them as an array.
*
@ -790,7 +790,7 @@ class OEMSecretsProvider implements InfoProviderInterface
return $parameters;
}
/**
/**
* Creates a PurchaseInfoDTO object containing distributor and pricing information for a product.
* Ensures that the distributor name is valid and prices are available.
*
@ -885,12 +885,12 @@ class OEMSecretsProvider implements InfoProviderInterface
* @return array The updated or newly created PartDetailDTO containing basic product information.
*/
private function createOrUpdateBasicInfo(
string $provider_id,
array $product,
string $description,
string $thenotes,
?array $existingBasicInfo
): array {
string $provider_id,
array $product,
string $description,
string $thenotes,
?array $existingBasicInfo
): array {
// If there is no existing basic info array, we create a new one
if (is_null($existingBasicInfo)) {
return [
@ -917,7 +917,7 @@ class OEMSecretsProvider implements InfoProviderInterface
'provider_key' => $existingBasicInfo['provider_key'] ?? $this->getProviderKey(),
'provider_id' => $existingBasicInfo['provider_id'] ?? $provider_id,
'name' => $existingBasicInfo['name'] ?? $product['part_number'],
// Update description if it's null/empty
// Update description if it's null/empty
'description' => !empty($existingBasicInfo['description'])
? $existingBasicInfo['description']
: $description,
@ -1088,7 +1088,7 @@ class OEMSecretsProvider implements InfoProviderInterface
return null;
}
// Array to store parsed parameters
// Array to store parsed parameters
$parameters = [];
// Split the description using the ';' separator