From a209ed11235defb386aee0e3a9685c9caac1dce4 Mon Sep 17 00:00:00 2001 From: Dane Powell Date: Fri, 30 Aug 2024 10:17:42 -0700 Subject: [PATCH] CLI-1379: TypeError in api:environments:cron-create (#1786) * CLI-1379: TypeError in api:environments:cron-create * mutation * mutation --- src/Command/Api/ApiCommandHelper.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Command/Api/ApiCommandHelper.php b/src/Command/Api/ApiCommandHelper.php index f2beb3dd9..70082ff0c 100644 --- a/src/Command/Api/ApiCommandHelper.php +++ b/src/Command/Api/ApiCommandHelper.php @@ -432,11 +432,12 @@ private function getRequestBodyFromParameterSchema(array $schema, array $acquiaC private function getPropertySpecFromRequestBodyParam(array $requestBodySchema, mixed $parameterDefinition): mixed { - return $requestBodySchema['properties'][$parameterDefinition->getName()] ?? null; + $name = self::restoreRenamedParameter($parameterDefinition->getName()); + return $requestBodySchema['properties'][$name] ?? null; } /** - * @return array + * @return array */ protected static function getParameterRenameMap(): array { @@ -449,7 +450,7 @@ protected static function getParameterRenameMap(): array ]; } - public static function renameParameter(mixed $propKey): mixed + private static function renameParameter(string $propKey): string { $parameterRenameMap = self::getParameterRenameMap(); if (array_key_exists($propKey, $parameterRenameMap)) { @@ -458,7 +459,7 @@ public static function renameParameter(mixed $propKey): mixed return $propKey; } - public static function restoreRenamedParameter(string $propKey): int|string + public static function restoreRenamedParameter(string $propKey): string { $parameterRenameMap = array_flip(self::getParameterRenameMap()); if (array_key_exists($propKey, $parameterRenameMap)) {