functions->sortPrice($request->getRequest()->toArray()['items']); return $this->json($array); } #[Route('/search', name: 'search', methods: ['POST'])] public function search(SearchRequest $request): Response { $array = $request->getRequest()->toArray()['items']; $id = $request->getRequest()->query->get('id'); $result = $this->functions->search($array, $id); return $this->json($result); } #[Route('/uniqElements', name: 'uniqElements', methods: ['POST'])] public function uniqElements(UniqElementsRequest $request): Response { $result = $this->functions->uniqElements($request->getRequest()->toArray()['items']); return $this->json($result); } #[Route('/prepareMenu', name: 'prepareMenu', methods: ['POST'])] public function prepareMenu(MenuRequest $request): Response { $result = $this->functions->prepareMenu($request->getRequest()->toArray()['items']); return $this->json($result); } #[Route( '/howDaysToNy/{day}/{month}/{year}', name: 'howDaysToNy', requirements: [ 'day' => '(? '(? '(?functions->howDaysToNy(new DateTimeImmutable($dateAsString)); } catch (\Exception $e) { return new Response($e->getMessage()); } return $this->json(["Days before NY:" => $result]); } }