@@ -102,8 +102,8 @@ |
||
102 | 102 | * |
103 | 103 | * @return bool|EntityRepository |
104 | 104 | */ |
105 | - public function getRepository(Entity $object){ |
|
106 | - if(!$manager = $this->getManager( $object)){ |
|
105 | + public function getRepository(Entity $object) { |
|
106 | + if (!$manager = $this->getManager($object)) { |
|
107 | 107 | return false; |
108 | 108 | } |
109 | 109 | return $manager->getRepository(); |
@@ -84,7 +84,7 @@ |
||
84 | 84 | * |
85 | 85 | * @return array |
86 | 86 | */ |
87 | - protected function getFormErrors($form){ |
|
87 | + protected function getFormErrors($form) { |
|
88 | 88 | $errors = $this->get("starkerxp_structure.services.form_errors")->getFormErrors($form); |
89 | 89 | return $errors; |
90 | 90 | } |
@@ -23,11 +23,11 @@ |
||
23 | 23 | "sujet" => $object->getSujet(), |
24 | 24 | "message" => $object->getMessage(), |
25 | 25 | ]; |
26 | - if(empty($fields)){ |
|
26 | + if (empty($fields)) { |
|
27 | 27 | return $array; |
28 | 28 | } |
29 | 29 | $export = []; |
30 | - foreach($fields as $row){ |
|
30 | + foreach ($fields as $row) { |
|
31 | 31 | $export[$row] = $array[$row]; |
32 | 32 | } |
33 | 33 | return $export; |
@@ -21,13 +21,13 @@ discard block |
||
21 | 21 | $orderBy = $this->getOrderBy($options['sort']); |
22 | 22 | $resultSets = $manager->findBy([], $orderBy, $options['limit'], $options['offset']); |
23 | 23 | } catch (\Exception $e) { |
24 | - return new JsonResponse(["payload" => $e->getMessage()], 400);//400 |
|
24 | + return new JsonResponse(["payload" => $e->getMessage()], 400); //400 |
|
25 | 25 | } |
26 | 26 | if (empty($resultSets)) { |
27 | 27 | return new JsonResponse([]); |
28 | 28 | } |
29 | 29 | $retour = array_map( |
30 | - function ($element) use ($manager, $options) { |
|
30 | + function($element) use ($manager, $options) { |
|
31 | 31 | return $manager->toArray($element, $this->getFields($options['fields'])); |
32 | 32 | }, |
33 | 33 | $resultSets |
@@ -43,14 +43,14 @@ discard block |
||
43 | 43 | $options = $this->resolveParams()->resolve($request->query->all()); |
44 | 44 | $template = $manager->findOneBy(['id' => $request->get('id')]); |
45 | 45 | } catch (\Exception $e) { |
46 | - return new JsonResponse(["payload" => $e->getMessage()], 400);//400 |
|
46 | + return new JsonResponse(["payload" => $e->getMessage()], 400); //400 |
|
47 | 47 | } |
48 | 48 | if (!$template instanceof Template) { |
49 | 49 | return new JsonResponse([], 404); |
50 | 50 | } |
51 | 51 | $retour = $manager->toArray($template, $this->getFields($options['fields'])); |
52 | 52 | |
53 | - return new JsonResponse($retour);//400, 404 |
|
53 | + return new JsonResponse($retour); //400, 404 |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | public function postAction(Request $request) |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $template->setUuid((\Ramsey\Uuid\Uuid::uuid4())->toString()); |
66 | 66 | $manager->insert($template); |
67 | 67 | |
68 | - return new JsonResponse([], 201);//400 |
|
68 | + return new JsonResponse([], 201); //400 |
|
69 | 69 | } |
70 | 70 | } catch (\Exception $e) { |
71 | 71 | return new JsonResponse(["payload" => $e->getMessage()], 400); |