Cast keys correctly in envUpdate
This commit is contained in:
@@ -60,7 +60,7 @@ return (function () {
|
|||||||
[
|
[
|
||||||
'key' => 'WS_LIBRARY_SEGMENT',
|
'key' => 'WS_LIBRARY_SEGMENT',
|
||||||
'description' => 'How many items to request per a request to backends.',
|
'description' => 'How many items to request per a request to backends.',
|
||||||
'type' => 'string',
|
'type' => 'int',
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'key' => 'WS_CACHE_URL',
|
'key' => 'WS_CACHE_URL',
|
||||||
|
|||||||
@@ -141,8 +141,19 @@ final class Env
|
|||||||
]), HTTP_STATUS::HTTP_BAD_REQUEST);
|
]), HTTP_STATUS::HTTP_BAD_REQUEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ('bool' === ag($spec, 'type')) {
|
switch (ag($spec, 'type', 'string')) {
|
||||||
settype($value, 'bool');
|
case 'bool':
|
||||||
|
settype($value, 'bool');
|
||||||
|
break;
|
||||||
|
case 'int':
|
||||||
|
settype($value, 'int');
|
||||||
|
break;
|
||||||
|
case 'float':
|
||||||
|
settype($value, 'float');
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
settype($value, 'string');
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->envFile->set($key, $value)->persist();
|
$this->envFile->set($key, $value)->persist();
|
||||||
|
|||||||
Reference in New Issue
Block a user