@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | */ |
25 | 25 | public function testFindAll() |
26 | 26 | { |
27 | - $this->loadFixtureFiles(['@StarkerxpLeadBundle/Tests/DataFixtures/LeadManager/LeadManager.yml',]); |
|
27 | + $this->loadFixtureFiles(['@StarkerxpLeadBundle/Tests/DataFixtures/LeadManager/LeadManager.yml', ]); |
|
28 | 28 | $this->assertCount(10, $this->manager->findAll()); |
29 | 29 | } |
30 | 30 | |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | */ |
35 | 35 | public function testInsertNewLead() |
36 | 36 | { |
37 | - $this->loadFixtureFiles(['@StarkerxpLeadBundle/Tests/DataFixtures/LeadManager/DefaultLead.yml',]); |
|
37 | + $this->loadFixtureFiles(['@StarkerxpLeadBundle/Tests/DataFixtures/LeadManager/DefaultLead.yml', ]); |
|
38 | 38 | $lead = new Lead(); |
39 | 39 | $this->manager->insert($lead); |
40 | 40 | $this->assertCount(2, $this->manager->findAll()); |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | */ |
47 | 47 | public function testUpdateLead() |
48 | 48 | { |
49 | - $this->loadFixtureFiles(['@StarkerxpLeadBundle/Tests/DataFixtures/LeadManager/DefaultLead.yml',]); |
|
49 | + $this->loadFixtureFiles(['@StarkerxpLeadBundle/Tests/DataFixtures/LeadManager/DefaultLead.yml', ]); |
|
50 | 50 | $criteria = ['createdAt' => new \DateTime("2016-08-05 12:12:12")]; |
51 | 51 | $lead = $this->manager->findOneBy($criteria); |
52 | 52 | $this->manager->update($lead); |
@@ -11,6 +11,9 @@ |
||
11 | 11 | return $contenu; |
12 | 12 | } |
13 | 13 | |
14 | + /** |
|
15 | + * @param string $contenu |
|
16 | + */ |
|
14 | 17 | public function remplacerLesCaracteresSpeciaux($contenu) |
15 | 18 | { |
16 | 19 | // Gestion des accents. |
@@ -33,6 +33,9 @@ discard block |
||
33 | 33 | return $contenuReplace; |
34 | 34 | } |
35 | 35 | |
36 | + /** |
|
37 | + * @param string $type |
|
38 | + */ |
|
36 | 39 | private function renderLien($type, $contenu) |
37 | 40 | { |
38 | 41 | $arrayContenu = []; |
@@ -49,6 +52,11 @@ discard block |
||
49 | 52 | |
50 | 53 | } |
51 | 54 | |
55 | + /** |
|
56 | + * @param string $lien |
|
57 | + * @param string $texte |
|
58 | + * @param string $style |
|
59 | + */ |
|
52 | 60 | protected function retournerLaChaine($type, $lien, $texte, $style = null) |
53 | 61 | { |
54 | 62 | if ($type == "unsub") { |
@@ -58,7 +58,7 @@ |
||
58 | 58 | return "<a href='{{unsubscribe:".$lien."}}' style='".$style."' title='Désinscription'>".$texte.'</a>'; |
59 | 59 | } |
60 | 60 | |
61 | - return "<a href='{{click:".$lien."}}' style='".$style."'>".$texte.'</a>';; |
|
61 | + return "<a href='{{click:".$lien."}}' style='".$style."'>".$texte.'</a>'; ; |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | public function getSupport($api, $version) |
@@ -64,6 +64,9 @@ |
||
64 | 64 | return true; |
65 | 65 | } |
66 | 66 | |
67 | + /** |
|
68 | + * @return \Starkerxp\StructureBundle\Entity\UserInterface |
|
69 | + */ |
|
67 | 70 | protected function getUser() |
68 | 71 | { |
69 | 72 | if (!$token = $this->user->getToken()) { |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | return new JsonResponse([]); |
65 | 65 | } |
66 | 66 | $retour = array_map( |
67 | - function ($element) use ($manager, $options) { |
|
67 | + function($element) use ($manager, $options) { |
|
68 | 68 | return $manager->toArray($element, $this->getFields($options['fields'])); |
69 | 69 | }, |
70 | 70 | $resultSets |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | return new JsonResponse(["payload" => $this->translate("user.entity.not_found", "user")], 404); |
185 | 185 | } |
186 | 186 | // Un user ne peut modifier un autre user sauf si ce dernier est un super admin. |
187 | - if($this->getUser()->getId() != $user->getId() && !$this->isGranted("ROLE_SUPER_ADMIN")){ |
|
187 | + if ($this->getUser()->getId() != $user->getId() && !$this->isGranted("ROLE_SUPER_ADMIN")) { |
|
188 | 188 | return new JsonResponse(["payload" => $this->translate("user.entity.not_updated_is_not_admin", "user")], 400); |
189 | 189 | } |
190 | 190 | $manager->beginTransaction(); |
@@ -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'); |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | */ |
25 | 25 | public function testFindAll() |
26 | 26 | { |
27 | - $this->loadFixtureFiles(['@StarkerxpUserBundle/Tests/DataFixtures/UserManager/UserManager.yml',]); |
|
27 | + $this->loadFixtureFiles(['@StarkerxpUserBundle/Tests/DataFixtures/UserManager/UserManager.yml', ]); |
|
28 | 28 | $this->assertCount(10, $this->manager->findAll()); |
29 | 29 | } |
30 | 30 | |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | */ |
35 | 35 | public function testInsertNewUser() |
36 | 36 | { |
37 | - $this->loadFixtureFiles(['@StarkerxpUserBundle/Tests/DataFixtures/UserManager/DefaultUser.yml',]); |
|
37 | + $this->loadFixtureFiles(['@StarkerxpUserBundle/Tests/DataFixtures/UserManager/DefaultUser.yml', ]); |
|
38 | 38 | $user = new User('[email protected]', ["ROLE_SUPER_ADMIN"]); |
39 | 39 | $user->setPlainPassword("azerty"); |
40 | 40 | $this->manager->insert($user); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | */ |
48 | 48 | public function testUpdateUser() |
49 | 49 | { |
50 | - $this->loadFixtureFiles(['@StarkerxpUserBundle/Tests/DataFixtures/UserManager/DefaultUser.yml',]); |
|
50 | + $this->loadFixtureFiles(['@StarkerxpUserBundle/Tests/DataFixtures/UserManager/DefaultUser.yml', ]); |
|
51 | 51 | $criteria = ['createdAt' => new \DateTime("2017-05-20 00:31:47")]; |
52 | 52 | /** @var User $user */ |
53 | 53 | $user = $this->manager->findOneBy($criteria); |
@@ -40,7 +40,7 @@ |
||
40 | 40 | $monTexte = implode( |
41 | 41 | "\n", |
42 | 42 | array_map( |
43 | - function ($ligne) { |
|
43 | + function($ligne) { |
|
44 | 44 | return trim($ligne); |
45 | 45 | }, |
46 | 46 | explode("\n", $monTexte) |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | 'class' => Campaign::class, |
35 | 35 | 'multiple' => false, |
36 | 36 | 'required' => false, |
37 | - 'query_builder' => function (CampaignRepository $repository) { |
|
37 | + 'query_builder' => function(CampaignRepository $repository) { |
|
38 | 38 | return $repository->getQueryListe(); |
39 | 39 | }, |
40 | 40 | 'constraints' => [ |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | 'class' => Template::class, |
52 | 52 | 'multiple' => false, |
53 | 53 | 'required' => false, |
54 | - 'query_builder' => function (TemplateRepository $repository) { |
|
54 | + 'query_builder' => function(TemplateRepository $repository) { |
|
55 | 55 | return $repository->getQueryListe(); |
56 | 56 | }, |
57 | 57 | 'constraints' => [ |