diff --git a/server/urlManipulator/UrlManipulator.php b/server/urlManipulator/UrlManipulator.php index 3bdaad5..ccb4eef 100644 --- a/server/urlManipulator/UrlManipulator.php +++ b/server/urlManipulator/UrlManipulator.php @@ -1,5 +1,4 @@ addParamToUrl($url, $newParam, $randomValue); - return ['status' => 200, 'data' => $modifiedUrl]; + return [ + 'before' => $url, + 'after' => $modifiedUrl, + ]; } protected function addParamToUrl(string $url, string $param, string $value): string @@ -54,18 +56,19 @@ class UrlManipulator extends AbstractUrlManipulator return uniqid(); } - protected function getNewParam(array $existingParams): string | null + protected function getNewParam(array $existingParams) { - while (!empty($this->paramsArray)) { - $newParam = array_pop($this->paramsArray); + while (!empty($this->paramsArray)) { + $newParam = array_pop($this->paramsArray); - if (!array_key_exists($newParam, $existingParams)) { - return $newParam; - } - } + if (!array_key_exists($newParam, $existingParams)) { + return $newParam; + } + } - return null; + return null; } + }