I'm trying to update Magento 2.3 to 2.4 and when i run setup:di:compile i get this error:
Deprecated Functionality: Array and string offset access syntax with curly braces is deprecated in /public_html/vendor/magento/framework/GraphQl/Config/Element/FieldFactory.php on line 49
I know that the issue is caused by php 7.4 that doesn't allow use of curly braces but i don't know how to resolve it. I tried to use php 7.3 but the console doesn't run commands.
Anyone can help?
This is the code at line 49 in fieldfactory.php
//check if type ends with []
if ($fieldType{strlen($fieldType) - 2} == '[' && $fieldType{strlen($fieldType) - 1} == ']') {
$isList = true;
$fieldData['type'] = str_replace('[]', '', $fieldData['type']);
$fieldData['itemType'] = str_replace('[]', '', $fieldData['type']);