Skip to content

Commit

Permalink
Fix "Unknown named parameter" PHP 8 error
Browse files Browse the repository at this point in the history
PHP 8 has named arguments, using the "formatted" argument name in `newInstanceArgs` method seems to trigger "Unknown named parameter error".
  • Loading branch information
maxime-aknin authored Jan 23, 2023
1 parent 6a1314a commit c36bce8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion classes/helpers/NostoHelperController.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public static function resolveObject($idName, $klass, $method, $multiLanguageObj
// Remove snake case
$argName = Tools::strtolower(str_replace('_', '', $constructorArg->getName()));
if (array_key_exists($argName, $argsArray)) {
$argsForObject[$argName] = $argsArray[$argName];
$argsForObject[$constructorArg->getName()] = $argsArray[$argName];
}
}
$reflectionClass = new ReflectionClass($klass);
Expand Down

0 comments on commit c36bce8

Please sign in to comment.