mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-05-10 23:22:11 +00:00
Fixed phpstan issues
This commit is contained in:
parent
db86b8c330
commit
21bad81262
3 changed files with 3 additions and 5 deletions
|
|
@ -244,7 +244,7 @@ class TypeaheadController extends AbstractController
|
|||
|
||||
$capability_filter = $request->query->getEnum('capability', Capability::class);
|
||||
|
||||
$models = $cache->get('ai_models_'.$platform->value.'_'.($capability_filter?->value ?? 'all'),
|
||||
$models = $cache->get('ai_models_'.$platform->value.'_'.($capability_filter->value ?? 'all'),
|
||||
function (ItemInterface $item) use ($platformRegistry, $platform, $capability_filter) {
|
||||
$item->expiresAfter(3600); //Cache for 1 hour
|
||||
if ($capability_filter === null) {
|
||||
|
|
@ -253,7 +253,7 @@ class TypeaheadController extends AbstractController
|
|||
|
||||
//Otherwise filter the models by the capability
|
||||
return array_filter($platformRegistry->getPlatform($platform)->getModelCatalog()->getModels(),
|
||||
static fn(array $model) => in_array($capability_filter, $model['capabilities'] ?? [], true)
|
||||
static fn(array $model) => in_array($capability_filter, $model['capabilities'], true)
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue