fix: use new runtimes filter syntax
This commit is contained in:
parent
a82531d6c8
commit
cb5c88a4d0
|
@ -8,12 +8,8 @@ use Appwrite\Runtimes\Runtimes;
|
|||
*/
|
||||
$runtimes = new Runtimes();
|
||||
|
||||
$allowList = empty(App::getEnv('_APP_FUNCTIONS_ENVS')) ? false : \explode(',', App::getEnv('_APP_FUNCTIONS_ENVS'));
|
||||
$allowList = empty(App::getEnv('_APP_FUNCTIONS_ENVS')) ? [] : \explode(',', App::getEnv('_APP_FUNCTIONS_ENVS'));
|
||||
|
||||
$runtimes = array_filter($runtimes->getAll(), function ($key) use ($allowList) {
|
||||
$isAllowed = $allowList && in_array($key, $allowList);
|
||||
|
||||
return $allowList ? $isAllowed : true;
|
||||
}, ARRAY_FILTER_USE_BOTH);
|
||||
$runtimes = $runtimes->getAll(filter: $allowList);
|
||||
|
||||
return $runtimes;
|
Loading…
Reference in a new issue