mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-01-20 17:19:34 +00:00
Use the parameter name $id from interface declaration for getDetails to avoid problems with named arguments
This commit is contained in:
parent
4e36578e7b
commit
6bc1808fd6
1 changed files with 4 additions and 4 deletions
|
|
@ -412,21 +412,21 @@ class OEMSecretsProvider implements InfoProviderInterface
|
||||||
* found in the cache, they are returned. If not, an exception is thrown indicating that
|
* found in the cache, they are returned. If not, an exception is thrown indicating that
|
||||||
* the details could not be found.
|
* the details could not be found.
|
||||||
*
|
*
|
||||||
* @param string $provider_id The unique identifier of the provider or part.
|
* @param string $id The unique identifier of the provider or part.
|
||||||
* @return PartDetailDTO The detailed information about the part.
|
* @return PartDetailDTO The detailed information about the part.
|
||||||
*
|
*
|
||||||
* @throws \Exception If no details are found for the given provider ID.
|
* @throws \Exception If no details are found for the given provider ID.
|
||||||
*/
|
*/
|
||||||
public function getDetails(string $provider_id): PartDetailDTO
|
public function getDetails(string $id): PartDetailDTO
|
||||||
{
|
{
|
||||||
$cacheKey = $this->getCacheKey($provider_id);
|
$cacheKey = $this->getCacheKey($id);
|
||||||
$cacheItem = $this->partInfoCache->getItem($cacheKey);
|
$cacheItem = $this->partInfoCache->getItem($cacheKey);
|
||||||
|
|
||||||
if ($cacheItem->isHit()) {
|
if ($cacheItem->isHit()) {
|
||||||
$details = $cacheItem->get();
|
$details = $cacheItem->get();
|
||||||
} else {
|
} else {
|
||||||
// If the details are not found in the cache, throw an exception
|
// If the details are not found in the cache, throw an exception
|
||||||
throw new \Exception("Details not found for provider_id $provider_id");
|
throw new \Exception("Details not found for provider_id $id");
|
||||||
}
|
}
|
||||||
|
|
||||||
return $details;
|
return $details;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue