@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | |
15 | 15 | class LeadController extends StructureController |
16 | 16 | { |
17 | - /** |
|
17 | + /** |
|
18 | 18 | * @ApiDoc( |
19 | 19 | * resource=true, |
20 | 20 | * description="Liste les leads.", |
@@ -76,12 +76,12 @@ discard block |
||
76 | 76 | } |
77 | 77 | |
78 | 78 | |
79 | - /** |
|
79 | + /** |
|
80 | 80 | * @ApiDoc( |
81 | 81 | * resource=true, |
82 | 82 | * description="Affiche un lead.", |
83 | 83 | * section="starkerxp_lead.lead", |
84 | - * requirements={ |
|
84 | + * requirements={ |
|
85 | 85 | * { |
86 | 86 | * "name"="lead_id", |
87 | 87 | * "dataType"="integer", |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | $manager = $this->get("starkerxp_lead.manager.lead"); |
107 | 107 | try { |
108 | 108 | $options = $this->resolveParams()->resolve($request->query->all()); |
109 | - if (!$entite = $manager->findOneBy(['id' => $request->get('lead_id')])) { |
|
109 | + if (!$entite = $manager->findOneBy(['id' => $request->get('lead_id')])) { |
|
110 | 110 | return new JsonResponse(["payload" => $this->translate("entity.not_found", "lead")], 404); |
111 | 111 | } |
112 | 112 | } catch (\Exception $e) { |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | return new JsonResponse($retour); |
119 | 119 | } |
120 | 120 | |
121 | - /** |
|
121 | + /** |
|
122 | 122 | * @ApiDoc( |
123 | 123 | * resource=true, |
124 | 124 | * description="Ajoute un lead.", |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | if ($form->isValid()) { |
137 | 137 | $lead = $form->getData(); |
138 | 138 | $manager->insert($lead); |
139 | - $this->dispatch(Events::LEAD_CREATED, new GenericEvent($entite)); |
|
139 | + $this->dispatch(Events::LEAD_CREATED, new GenericEvent($entite)); |
|
140 | 140 | return new JsonResponse(["payload" => $this->translate("lead.entity.created", "lead")], 201); |
141 | 141 | } |
142 | 142 | } catch (\Exception $e) { |
@@ -20,7 +20,7 @@ |
||
20 | 20 | public function load(array $configs, ContainerBuilder $container) |
21 | 21 | { |
22 | 22 | $configuration = new Configuration(); |
23 | - $this->processConfiguration($configuration, $configs); |
|
23 | + $this->processConfiguration($configuration, $configs); |
|
24 | 24 | |
25 | 25 | $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
26 | 26 | $loader->load('services.yml'); |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | class EventController extends StructureController |
14 | 14 | { |
15 | - /** |
|
15 | + /** |
|
16 | 16 | * @ApiDoc( |
17 | 17 | * resource=true, |
18 | 18 | * description="Show events list.", |
@@ -73,12 +73,12 @@ discard block |
||
73 | 73 | } |
74 | 74 | |
75 | 75 | |
76 | - /** |
|
76 | + /** |
|
77 | 77 | * @ApiDoc( |
78 | 78 | * resource=true, |
79 | 79 | * description="Show event.", |
80 | 80 | * section="Campaign", |
81 | - * requirements={ |
|
81 | + * requirements={ |
|
82 | 82 | * { |
83 | 83 | * "name"="campaign_id", |
84 | 84 | * "dataType"="integer", |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | return new JsonResponse($retour); |
122 | 122 | } |
123 | 123 | |
124 | - /** |
|
124 | + /** |
|
125 | 125 | * @ApiDoc( |
126 | 126 | * resource=true, |
127 | 127 | * description="Ajoute un event.", |
@@ -150,12 +150,12 @@ discard block |
||
150 | 150 | return new JsonResponse(["payload" => $this->getFormErrors($form)], 400); |
151 | 151 | } |
152 | 152 | |
153 | - /** |
|
153 | + /** |
|
154 | 154 | * @ApiDoc( |
155 | 155 | * resource=true, |
156 | 156 | * description="Edit event.", |
157 | 157 | * section="Campaign", |
158 | - * requirements={ |
|
158 | + * requirements={ |
|
159 | 159 | * { |
160 | 160 | * "name"="campaign_id", |
161 | 161 | * "dataType"="integer", |
@@ -195,12 +195,12 @@ discard block |
||
195 | 195 | return new JsonResponse(["payload" => $this->getFormErrors($form)], 400); |
196 | 196 | } |
197 | 197 | |
198 | - /** |
|
198 | + /** |
|
199 | 199 | * @ApiDoc( |
200 | 200 | * resource=true, |
201 | 201 | * description="Delete event.", |
202 | 202 | * section="Campaign", |
203 | - * requirements={ |
|
203 | + * requirements={ |
|
204 | 204 | * { |
205 | 205 | * "name"="campaign_id", |
206 | 206 | * "dataType"="integer", |
@@ -14,7 +14,7 @@ |
||
14 | 14 | |
15 | 15 | class CampaignController extends StructureController |
16 | 16 | { |
17 | - /** |
|
17 | + /** |
|
18 | 18 | * @ApiDoc( |
19 | 19 | * resource=true, |
20 | 20 | * description="Show campaigns list.", |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | |
15 | 15 | class TemplateController extends StructureController |
16 | 16 | { |
17 | - /** |
|
17 | + /** |
|
18 | 18 | * @ApiDoc( |
19 | 19 | * resource=true, |
20 | 20 | * description="List templates.", |
@@ -76,12 +76,12 @@ discard block |
||
76 | 76 | } |
77 | 77 | |
78 | 78 | |
79 | - /** |
|
79 | + /** |
|
80 | 80 | * @ApiDoc( |
81 | 81 | * resource=true, |
82 | 82 | * description="Affiche un template.", |
83 | 83 | * section="starkerxp_campaign.template", |
84 | - * requirements={ |
|
84 | + * requirements={ |
|
85 | 85 | * { |
86 | 86 | * "name"="template_id", |
87 | 87 | * "dataType"="integer", |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | $manager = $this->get("starkerxp_campaign.manager.template"); |
107 | 107 | try { |
108 | 108 | $options = $this->resolveParams()->resolve($request->query->all()); |
109 | - if (!$entite = $manager->findOneBy(['id' => $request->get('template_id')])) { |
|
109 | + if (!$entite = $manager->findOneBy(['id' => $request->get('template_id')])) { |
|
110 | 110 | return new JsonResponse(["payload" => $this->translate("entity.not_found", "template")], 404); |
111 | 111 | } |
112 | 112 | } catch (\Exception $e) { |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | return new JsonResponse($retour); |
119 | 119 | } |
120 | 120 | |
121 | - /** |
|
121 | + /** |
|
122 | 122 | * @ApiDoc( |
123 | 123 | * resource=true, |
124 | 124 | * description="Ajoute un template.", |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | $template = $form->getData(); |
138 | 138 | $template->setUuid($this->getUuid()); |
139 | 139 | $manager->insert($template); |
140 | - $this->dispatch(Events::TEMPLATE_CREATED, new GenericEvent($entite)); |
|
140 | + $this->dispatch(Events::TEMPLATE_CREATED, new GenericEvent($entite)); |
|
141 | 141 | return new JsonResponse(["payload" => $this->translate("template.entity.created", "template")], 201); |
142 | 142 | } |
143 | 143 | } catch (\Exception $e) { |
@@ -148,12 +148,12 @@ discard block |
||
148 | 148 | return new JsonResponse(["payload" => $this->getFormErrors($form)], 400); |
149 | 149 | } |
150 | 150 | |
151 | - /** |
|
151 | + /** |
|
152 | 152 | * @ApiDoc( |
153 | 153 | * resource=true, |
154 | 154 | * description="Modifie un template.", |
155 | 155 | * section="starkerxp_campaign.template", |
156 | - * requirements={ |
|
156 | + * requirements={ |
|
157 | 157 | * { |
158 | 158 | * "name"="template_id", |
159 | 159 | * "dataType"="integer", |
@@ -167,9 +167,9 @@ discard block |
||
167 | 167 | public function putAction(Request $request) |
168 | 168 | { |
169 | 169 | $manager = $this->get("starkerxp_campaign.manager.template"); |
170 | - if (!$entite = $manager->findOneBy(['id' => $request->get('template_id')])) { |
|
171 | - return new JsonResponse(["payload" => $this->translate("entity.not_found", "template")], 404); |
|
172 | - } |
|
170 | + if (!$entite = $manager->findOneBy(['id' => $request->get('template_id')])) { |
|
171 | + return new JsonResponse(["payload" => $this->translate("entity.not_found", "template")], 404); |
|
172 | + } |
|
173 | 173 | $manager->beginTransaction(); |
174 | 174 | try { |
175 | 175 | $form = $this->createForm(TemplateType::class, $entite, ['method' => 'PUT']); |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | if ($form->isValid()) { |
178 | 178 | $entite = $form->getData(); |
179 | 179 | $manager->update($entite); |
180 | - $this->dispatch(Events::TEMPLATE_UPDATED, new GenericEvent($entite)); |
|
180 | + $this->dispatch(Events::TEMPLATE_UPDATED, new GenericEvent($entite)); |
|
181 | 181 | return new JsonResponse(["payload" => $this->translate("template.entity.updated", "template")], 204); |
182 | 182 | } |
183 | 183 | } catch (\Exception $e) { |
@@ -187,12 +187,12 @@ discard block |
||
187 | 187 | return new JsonResponse(["payload" => $this->getFormErrors($form)], 400); |
188 | 188 | } |
189 | 189 | |
190 | - /** |
|
190 | + /** |
|
191 | 191 | * @ApiDoc( |
192 | 192 | * resource=true, |
193 | 193 | * description="Supprime un template.", |
194 | 194 | * section="starkerxp_campaign.template", |
195 | - * requirements={ |
|
195 | + * requirements={ |
|
196 | 196 | * { |
197 | 197 | * "name"="template_id", |
198 | 198 | * "dataType"="integer", |
@@ -207,15 +207,15 @@ discard block |
||
207 | 207 | { |
208 | 208 | $manager = $this->get("starkerxp_campaign.manager.template"); |
209 | 209 | if (!$entite = $manager->findOneBy(['id' => $request->get('template_id')])) { |
210 | - return new JsonResponse(["payload" => $this->translate("entity.not_found", "template")], 404); |
|
211 | - } |
|
210 | + return new JsonResponse(["payload" => $this->translate("entity.not_found", "template")], 404); |
|
211 | + } |
|
212 | 212 | try { |
213 | 213 | $manager->delete($entite); |
214 | 214 | } catch (\Exception $e) { |
215 | 215 | $manager->rollback(); |
216 | 216 | return new JsonResponse(["payload" => $e->getMessage()], 400); |
217 | 217 | } |
218 | - $this->dispatch(Events::TEMPLATE_DELETED, new GenericEvent($request->get('template_id'))); |
|
218 | + $this->dispatch(Events::TEMPLATE_DELETED, new GenericEvent($request->get('template_id'))); |
|
219 | 219 | |
220 | 220 | return new JsonResponse(["payload" => $this->translate("template.entity.deleted", "template")], 204); |
221 | 221 | } |
@@ -9,7 +9,7 @@ |
||
9 | 9 | class CampaignTargetManager extends AbstractManager |
10 | 10 | { |
11 | 11 | |
12 | - public function getSupport(Entity $object) |
|
12 | + public function getSupport(Entity $object) |
|
13 | 13 | { |
14 | 14 | return $object instanceof CampaignTarget; |
15 | 15 | } |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | $data = [ |
22 | 22 | //'nom' => "Mon nom", //exemple |
23 | 23 | ]; |
24 | - $url = $this->generateUrl( |
|
24 | + $url = $this->generateUrl( |
|
25 | 25 | 'starkerxp_lead.lead.post', |
26 | 26 | [] |
27 | 27 | ); |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | $this->loadFixtureFiles([ |
45 | 45 | '@StarkerxpUserBundle/Tests/DataFixtures/UserManager/DefaultUser.yml', |
46 | 46 | ]); |
47 | - $url = $this->generateUrl( |
|
47 | + $url = $this->generateUrl( |
|
48 | 48 | 'starkerxp_lead.lead.post', |
49 | 49 | [] |
50 | 50 | ); |
@@ -64,10 +64,10 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public function testPutValide() |
66 | 66 | { |
67 | - $this->loadFixtureFiles([ |
|
67 | + $this->loadFixtureFiles([ |
|
68 | 68 | '@StarkerxpUserBundle/Tests/DataFixtures/UserManager/DefaultUser.yml', |
69 | - '@StarkerxpLeadBundle/Tests/DataFixtures/LeadManager/DefaultLead.yml', |
|
70 | - ]); |
|
69 | + '@StarkerxpLeadBundle/Tests/DataFixtures/LeadManager/DefaultLead.yml', |
|
70 | + ]); |
|
71 | 71 | $manager = $this->getContainer()->get('starkerxp_lead.manager.lead'); |
72 | 72 | $listeLeads = $manager->getRepository()->findAll(); |
73 | 73 | $this->assertCount(1, $listeLeads); |
@@ -75,11 +75,11 @@ discard block |
||
75 | 75 | $data = [ |
76 | 76 | //'nom' => "Mon nom", //exemple |
77 | 77 | ]; |
78 | - $url = $this->generateUrl( |
|
78 | + $url = $this->generateUrl( |
|
79 | 79 | 'starkerxp_lead.lead.put', |
80 | 80 | [ |
81 | - "lead_id" => $listeLeads[0]->getId(), |
|
82 | - ] |
|
81 | + "lead_id" => $listeLeads[0]->getId(), |
|
82 | + ] |
|
83 | 83 | ); |
84 | 84 | $client = $this->getAuthClient(); |
85 | 85 | $client->request('PUT', $url, $data); |
@@ -100,18 +100,18 @@ discard block |
||
100 | 100 | */ |
101 | 101 | public function testPutInvalide() |
102 | 102 | { |
103 | - $this->loadFixtureFiles([ |
|
103 | + $this->loadFixtureFiles([ |
|
104 | 104 | '@StarkerxpUserBundle/Tests/DataFixtures/UserManager/DefaultUser.yml', |
105 | - '@StarkerxpLeadBundle/Tests/DataFixtures/LeadManager/DefaultLead.yml', |
|
106 | - ]); |
|
105 | + '@StarkerxpLeadBundle/Tests/DataFixtures/LeadManager/DefaultLead.yml', |
|
106 | + ]); |
|
107 | 107 | $manager = $this->getContainer()->get('starkerxp_lead.manager.lead'); |
108 | 108 | $listeLeads = $manager->getRepository()->findAll(); |
109 | 109 | $this->assertCount(1, $listeLeads); |
110 | - $url = $this->generateUrl( |
|
110 | + $url = $this->generateUrl( |
|
111 | 111 | 'starkerxp_lead.lead.put', |
112 | 112 | [ |
113 | - "lead_id" => $listeLeads[0]->getId(), |
|
114 | - ] |
|
113 | + "lead_id" => $listeLeads[0]->getId(), |
|
114 | + ] |
|
115 | 115 | ); |
116 | 116 | $client = $this->getAuthClient(); |
117 | 117 | $client->request('PUT', $url, []); |
@@ -129,17 +129,17 @@ discard block |
||
129 | 129 | */ |
130 | 130 | public function testPutSansResultat() |
131 | 131 | { |
132 | - $this->loadFixtureFiles([ |
|
132 | + $this->loadFixtureFiles([ |
|
133 | 133 | '@StarkerxpUserBundle/Tests/DataFixtures/UserManager/DefaultUser.yml', |
134 | - ]); |
|
134 | + ]); |
|
135 | 135 | $data = [ |
136 | 136 | //'nom' => "Mon nom", //exemple |
137 | 137 | ]; |
138 | - $url = $this->generateUrl( |
|
138 | + $url = $this->generateUrl( |
|
139 | 139 | 'starkerxp_lead.lead.put', |
140 | 140 | [ |
141 | - "lead_id" => 404, |
|
142 | - ] |
|
141 | + "lead_id" => 404, |
|
142 | + ] |
|
143 | 143 | ); |
144 | 144 | $client = $this->getAuthClient(); |
145 | 145 | $client->request('PUT', $url, $data); |
@@ -157,15 +157,15 @@ discard block |
||
157 | 157 | */ |
158 | 158 | public function testCGetValideAvecResultats() |
159 | 159 | { |
160 | - $this->loadFixtureFiles([ |
|
160 | + $this->loadFixtureFiles([ |
|
161 | 161 | '@StarkerxpUserBundle/Tests/DataFixtures/UserManager/DefaultUser.yml', |
162 | - '@StarkerxpLeadBundle/Tests/DataFixtures/LeadManager/LeadManager.yml', |
|
163 | - ]); |
|
164 | - $url = $this->generateUrl( |
|
162 | + '@StarkerxpLeadBundle/Tests/DataFixtures/LeadManager/LeadManager.yml', |
|
163 | + ]); |
|
164 | + $url = $this->generateUrl( |
|
165 | 165 | 'starkerxp_lead.lead.cget', |
166 | 166 | [ |
167 | 167 | |
168 | - ] |
|
168 | + ] |
|
169 | 169 | ); |
170 | 170 | $client = $this->getAuthClient(); |
171 | 171 | $client->request('GET', $url, []); |
@@ -185,14 +185,14 @@ discard block |
||
185 | 185 | */ |
186 | 186 | public function testCGetValideSansResultat() |
187 | 187 | { |
188 | - $this->loadFixtureFiles([ |
|
188 | + $this->loadFixtureFiles([ |
|
189 | 189 | '@StarkerxpUserBundle/Tests/DataFixtures/UserManager/DefaultUser.yml', |
190 | - ]); |
|
191 | - $url = $this->generateUrl( |
|
190 | + ]); |
|
191 | + $url = $this->generateUrl( |
|
192 | 192 | 'starkerxp_lead.lead.cget', |
193 | 193 | [ |
194 | 194 | |
195 | - ] |
|
195 | + ] |
|
196 | 196 | ); |
197 | 197 | $client = $this->getAuthClient(); |
198 | 198 | $client->request('GET', $url, []); |
@@ -209,14 +209,14 @@ discard block |
||
209 | 209 | */ |
210 | 210 | public function testCGetInvalide() |
211 | 211 | { |
212 | - $this->loadFixtureFiles([ |
|
212 | + $this->loadFixtureFiles([ |
|
213 | 213 | '@StarkerxpUserBundle/Tests/DataFixtures/UserManager/DefaultUser.yml', |
214 | - ]); |
|
215 | - $url = $this->generateUrl( |
|
214 | + ]); |
|
215 | + $url = $this->generateUrl( |
|
216 | 216 | 'starkerxp_lead.lead.cget', |
217 | 217 | [ |
218 | 218 | |
219 | - ] |
|
219 | + ] |
|
220 | 220 | ); |
221 | 221 | $client = $this->getAuthClient(); |
222 | 222 | $client->request('GET', $url, ["filter_erreur" => "+h"]); |
@@ -231,19 +231,19 @@ discard block |
||
231 | 231 | */ |
232 | 232 | public function testGetValideAvecResultats() |
233 | 233 | { |
234 | - $this->loadFixtureFiles([ |
|
234 | + $this->loadFixtureFiles([ |
|
235 | 235 | '@StarkerxpUserBundle/Tests/DataFixtures/UserManager/DefaultUser.yml', |
236 | - '@StarkerxpLeadBundle/Tests/DataFixtures/LeadManager/LeadManager.yml', |
|
237 | - ]); |
|
236 | + '@StarkerxpLeadBundle/Tests/DataFixtures/LeadManager/LeadManager.yml', |
|
237 | + ]); |
|
238 | 238 | $manager = $this->getContainer()->get('starkerxp_lead.manager.lead'); |
239 | 239 | /** @var Lead[] $listeLeads */ |
240 | 240 | $listeLeads = $manager->getRepository()->findAll(); |
241 | 241 | $this->assertCount(10, $listeLeads); |
242 | - $url = $this->generateUrl( |
|
242 | + $url = $this->generateUrl( |
|
243 | 243 | 'starkerxp_lead.lead.get', |
244 | 244 | [ |
245 | - "lead_id" => $listeLeads[0]->getId(), |
|
246 | - ] |
|
245 | + "lead_id" => $listeLeads[0]->getId(), |
|
246 | + ] |
|
247 | 247 | ); |
248 | 248 | $client = $this->getAuthClient(); |
249 | 249 | $client->request('GET', $url, []); |
@@ -261,14 +261,14 @@ discard block |
||
261 | 261 | */ |
262 | 262 | public function testGetValideSansResultat() |
263 | 263 | { |
264 | - $this->loadFixtureFiles([ |
|
264 | + $this->loadFixtureFiles([ |
|
265 | 265 | '@StarkerxpUserBundle/Tests/DataFixtures/UserManager/DefaultUser.yml', |
266 | - ]); |
|
267 | - $url = $this->generateUrl( |
|
266 | + ]); |
|
267 | + $url = $this->generateUrl( |
|
268 | 268 | 'starkerxp_lead.lead.get', |
269 | 269 | [ |
270 | - "lead_id" => 404, |
|
271 | - ] |
|
270 | + "lead_id" => 404, |
|
271 | + ] |
|
272 | 272 | ); |
273 | 273 | $client = $this->getAuthClient(); |
274 | 274 | $client->request('GET', $url, []); |
@@ -285,14 +285,14 @@ discard block |
||
285 | 285 | */ |
286 | 286 | public function testGetInvalide() |
287 | 287 | { |
288 | - $this->loadFixtureFiles([ |
|
288 | + $this->loadFixtureFiles([ |
|
289 | 289 | '@StarkerxpUserBundle/Tests/DataFixtures/UserManager/DefaultUser.yml', |
290 | - ]); |
|
291 | - $url = $this->generateUrl( |
|
290 | + ]); |
|
291 | + $url = $this->generateUrl( |
|
292 | 292 | 'starkerxp_lead.lead.get', |
293 | 293 | [ |
294 | - "lead_id" => 500, |
|
295 | - ] |
|
294 | + "lead_id" => 500, |
|
295 | + ] |
|
296 | 296 | ); |
297 | 297 | $client = $this->getAuthClient(); |
298 | 298 | $client->request('GET', $url, ["filter_erreur" => "+h"]); |