<?php
namespace FlexApp\Service;
use Exception;
use WebBundle\Service\CommonDataService;
class ParametersGenerator
{
/** @required */
public CommonDataService $commonDataService;
/**
* @param array $parameters
* @return array
* @throws Exception
*/
public function generate(array $parameters): array
{
$parameters['initialState'] = array_merge($parameters['initialState'] ?? [], [
'common' => [
'top' => $this->commonDataService->top(),
'footer' => $this->commonDataService->footer(),
'constants' => $this->commonDataService->constants(),
'userData' => $this->commonDataService->userData(),
'urls' => $this->commonDataService->urls(),
'trans' => $this->commonDataService->trans(),
'commentablePageData' => $this->commonDataService->commentablePageData(),
],
]);
return $parameters;
}
}