fix: use new runtimes filter syntax
This commit is contained in:
parent
a82531d6c8
commit
cb5c88a4d0
1 changed files with 2 additions and 6 deletions
|
@ -8,12 +8,8 @@ use Appwrite\Runtimes\Runtimes;
|
||||||
*/
|
*/
|
||||||
$runtimes = new 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) {
|
$runtimes = $runtimes->getAll(filter: $allowList);
|
||||||
$isAllowed = $allowList && in_array($key, $allowList);
|
|
||||||
|
|
||||||
return $allowList ? $isAllowed : true;
|
|
||||||
}, ARRAY_FILTER_USE_BOTH);
|
|
||||||
|
|
||||||
return $runtimes;
|
return $runtimes;
|
Loading…
Reference in a new issue