/** * @param Tax $tax * * @return JsonResponse */ public function getAction(Tax $tax) { $result = array('id' => $tax->getId(), 'name' => $tax->getName(), 'type' => $tax->getType(), 'rate' => $tax->getRate()); return new JsonResponse($result); }
/** * @param Tax $tax * * @return JsonResponse */ public function getAction(Tax $tax) { $result = ['id' => $tax->getId(), 'name' => $tax->getName(), 'type' => $tax->getType(), 'rate' => $tax->getRate()]; return $this->json($result); }