Passed
Push — master ( c57dae...f09347 )
by Luiz Kim
07:37 queued 05:02
created
src/Listener/LogListener.php 1 patch
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -125,15 +125,16 @@
 block discarded – undo
125 125
 
126 126
     private function log()
127 127
     {
128
-        if (get_class($this->entity) == 'ControleOnline\Entity\Webapi\Usuario')
129
-            $this->user = $this->entity;
130
-        else
131
-            $this->log[] =
128
+        if (get_class($this->entity) == 'ControleOnline\Entity\Webapi\Usuario') {
129
+                    $this->user = $this->entity;
130
+        } else {
131
+                    $this->log[] =
132 132
                 [
133 133
                     'action' => $this->action,
134 134
                     'class' => str_replace('Proxies\\__CG__\\', '', get_class($this->entity)),
135 135
                     'object' =>    $this->getObject($this->entity)
136 136
                 ];
137
+        }
137 138
     }
138 139
 
139 140
     private function getObject($entity)
Please login to merge, or discard this patch.
src/Controller/GetThemeColorsAction.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
         $css = ':root{' . PHP_EOL;
35 35
         foreach ($theme->getColors(true) as $index => $color) {
36 36
             $css .= '    --q-' . $index . ': ' . $color . ';' . PHP_EOL;
37
-            $css .= '    --'   . $index . ': ' . $color . ';' . PHP_EOL;
37
+            $css .= '    --' . $index . ': ' . $color . ';' . PHP_EOL;
38 38
         }
39 39
         $css .= '}';
40 40
         return new Response($css, Response::HTTP_OK, [
Please login to merge, or discard this patch.
src/Service/HydratorService.php 3 patches
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -89,11 +89,13 @@
 block discarded – undo
89 89
     private function getMembers($class, $groups, mixed $arguments = [], int $limit = 0, int $page = 1, array $orderby = [])
90 90
     {
91 91
 
92
-        if ($limit < 1)
93
-            $limit = $this->request->get('itemsPerPage') ?: 50;
92
+        if ($limit < 1) {
93
+                    $limit = $this->request->get('itemsPerPage') ?: 50;
94
+        }
94 95
 
95
-        if ($page == 1)
96
-            $offset = (($page = $this->request->get('page') ?: 1) - 1) * $limit;
96
+        if ($page == 1) {
97
+                    $offset = (($page = $this->request->get('page') ?: 1) - 1) * $limit;
98
+        }
97 99
 
98 100
         $data =     $this->manager->getRepository($class)->findBy($arguments, $orderby, $limit, $offset);
99 101
 
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -31,23 +31,23 @@  discard block
 block discarded – undo
31 31
         return $e;
32 32
     }
33 33
 
34
-    public function collectionData($data, $class, $groups,  mixed $arguments = [])
34
+    public function collectionData($data, $class, $groups, mixed $arguments = [])
35 35
     {
36 36
         $response = $this->getBasicResponse($class);
37 37
 
38
-        $response['hydra:member']      =   $this->data($data, $groups);
39
-        $response['hydra:search']       =   $this->getSearch($class);
40
-        $response['hydra:totalItems']   =   $this->getCount($class, $arguments);
38
+        $response['hydra:member'] = $this->data($data, $groups);
39
+        $response['hydra:search']       = $this->getSearch($class);
40
+        $response['hydra:totalItems']   = $this->getCount($class, $arguments);
41 41
 
42 42
         return $response;
43 43
     }
44
-    public function collection($class, $groups,  mixed $arguments = [], int $limit = 0, int $page = 1, array $orderby = [])
44
+    public function collection($class, $groups, mixed $arguments = [], int $limit = 0, int $page = 1, array $orderby = [])
45 45
     {
46 46
         $response = $this->getBasicResponse($class);
47 47
 
48
-        $response['hydra:member']      =   $this->getMembers($class, $groups, $arguments, $limit, $page, $orderby);
49
-        $response['hydra:search']       =   $this->getSearch($class);
50
-        $response['hydra:totalItems']   =   $this->getCount($class, $arguments);
48
+        $response['hydra:member'] = $this->getMembers($class, $groups, $arguments, $limit, $page, $orderby);
49
+        $response['hydra:search']       = $this->getSearch($class);
50
+        $response['hydra:totalItems']   = $this->getCount($class, $arguments);
51 51
 
52 52
         return $response;
53 53
     }
@@ -57,8 +57,8 @@  discard block
 block discarded – undo
57 57
         //$response = $this->getBasicResponse($class);
58 58
         //$response['hydra:search']       =   $this->getSearch($class);
59 59
 
60
-        $response['hydra:member']      =  $result;
61
-        $response['hydra:totalItems']   =   count($response['hydra:member']);
60
+        $response['hydra:member'] = $result;
61
+        $response['hydra:totalItems'] = count($response['hydra:member']);
62 62
 
63 63
         return $response;
64 64
     }
@@ -81,8 +81,8 @@  discard block
 block discarded – undo
81 81
         $className = substr($class, strrpos($class, '\\') + 1);
82 82
 
83 83
         $response['@id']        = '/' . strtolower(preg_replace('/(?<!^)[A-Z]/', '_$0', $className)) . 's';
84
-        $response['@context']   =   "/contexts/" . $className;
85
-        $response['@type']      =   "hydra:Collection";
84
+        $response['@context']   = "/contexts/" . $className;
85
+        $response['@type']      = "hydra:Collection";
86 86
 
87 87
         $response['hydra:view'] = [
88 88
             '@id' =>   $this->uri,
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
         if ($page == 1)
101 101
             $offset = (($page = $this->request->get('page') ?: 1) - 1) * $limit;
102 102
 
103
-        $data =     $this->manager->getRepository($class)->findBy($arguments, $orderby, $limit, $offset);
103
+        $data = $this->manager->getRepository($class)->findBy($arguments, $orderby, $limit, $offset);
104 104
 
105 105
         return $this->serialize($data, ['groups' => $groups]);
106 106
     }
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 namespace ControleOnline\Service;
4 4
 
5 5
 use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface
6
- AS Security;
6
+    AS Security;
7 7
 use Symfony\Component\Serializer\SerializerInterface;
8 8
 use Symfony\Component\HttpFoundation\RequestStack;
9 9
 
Please login to merge, or discard this patch.
src/Repository/AddressRepository.php 3 patches
Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -22,65 +22,65 @@
 block discarded – undo
22 22
 
23 23
     public function findOneByCityStateCountryOfPeople(string $city, string $state, string $country, People $people): ?Address
24 24
     {
25
-      $result = $this->createQueryBuilder('a')
26
-                  ->innerJoin         ('a.street'  , 's')
27
-                  ->innerJoin         ('s.district', 'd')
28
-                  ->innerJoin         ('d.city'    , 'c')
29
-                  ->innerJoin         ('c.state'   , 'e')
30
-                  ->innerJoin         ('e.country' , 'u')
25
+        $result = $this->createQueryBuilder('a')
26
+                    ->innerJoin         ('a.street'  , 's')
27
+                    ->innerJoin         ('s.district', 'd')
28
+                    ->innerJoin         ('d.city'    , 'c')
29
+                    ->innerJoin         ('c.state'   , 'e')
30
+                    ->innerJoin         ('e.country' , 'u')
31 31
 
32
-                  ->andWhere          ('c.city        = :city'   )
33
-                  ->andWhere          ('e.uf          = :state'  )
34
-                  ->andWhere          ('u.countryname = :country')
35
-                  ->andWhere          ('a.people      = :people' )
32
+                    ->andWhere          ('c.city        = :city'   )
33
+                    ->andWhere          ('e.uf          = :state'  )
34
+                    ->andWhere          ('u.countryname = :country')
35
+                    ->andWhere          ('a.people      = :people' )
36 36
 
37
-                  ->setParameter      ('city'   , $city   )
38
-                  ->setParameter      ('state'  , $state  )
39
-                  ->setParameter      ('country', $country)
40
-                  ->setParameter      ('people' , $people)
37
+                    ->setParameter      ('city'   , $city   )
38
+                    ->setParameter      ('state'  , $state  )
39
+                    ->setParameter      ('country', $country)
40
+                    ->setParameter      ('people' , $people)
41 41
 
42
-                  ->getQuery()
43
-                  ->getResult()
44
-              ;
42
+                    ->getQuery()
43
+                    ->getResult()
44
+                ;
45 45
 
46
-      if (empty($result))
46
+        if (empty($result))
47 47
         return null;
48 48
 
49
-      return $result[0];
49
+        return $result[0];
50 50
     }
51 51
 
52 52
     public function findPeopleAddressBy(People $people, array $criteria): ?Address
53 53
     {
54
-      $result = $this->createQueryBuilder('a')
55
-                  ->innerJoin         ('a.street'  , 's')
56
-                  ->innerJoin         ('s.district', 'd')
57
-                  ->innerJoin         ('d.city'    , 'c')
58
-                  ->innerJoin         ('c.state'   , 'e')
59
-                  ->innerJoin         ('e.country' , 'u')
54
+        $result = $this->createQueryBuilder('a')
55
+                    ->innerJoin         ('a.street'  , 's')
56
+                    ->innerJoin         ('s.district', 'd')
57
+                    ->innerJoin         ('d.city'    , 'c')
58
+                    ->innerJoin         ('c.state'   , 'e')
59
+                    ->innerJoin         ('e.country' , 'u')
60 60
 
61
-                  ->andWhere          ('a.people      = :people'  )
62
-                  ->andWhere          ('u.countryname = :country' )
63
-                  ->andWhere          ('(e.uf = :state OR e.state = :state)')
64
-                  ->andWhere          ('c.city        = :city'    )
65
-                  ->andWhere          ('d.district    = :district')
66
-                  ->andWhere          ('s.street      = :street'  )
67
-                  ->andWhere          ('a.number      = :number'  )
61
+                    ->andWhere          ('a.people      = :people'  )
62
+                    ->andWhere          ('u.countryname = :country' )
63
+                    ->andWhere          ('(e.uf = :state OR e.state = :state)')
64
+                    ->andWhere          ('c.city        = :city'    )
65
+                    ->andWhere          ('d.district    = :district')
66
+                    ->andWhere          ('s.street      = :street'  )
67
+                    ->andWhere          ('a.number      = :number'  )
68 68
 
69
-                  ->setParameter      ('people'  , $people)
70
-                  ->setParameter      ('country' , $criteria['country'] )
71
-                  ->setParameter      ('state'   , $criteria['state']   )
72
-                  ->setParameter      ('city'    , $criteria['city']    )
73
-                  ->setParameter      ('district', $criteria['district'])
74
-                  ->setParameter      ('street'  , $criteria['street']  )
75
-                  ->setParameter      ('number'  , $criteria['number']  )
69
+                    ->setParameter      ('people'  , $people)
70
+                    ->setParameter      ('country' , $criteria['country'] )
71
+                    ->setParameter      ('state'   , $criteria['state']   )
72
+                    ->setParameter      ('city'    , $criteria['city']    )
73
+                    ->setParameter      ('district', $criteria['district'])
74
+                    ->setParameter      ('street'  , $criteria['street']  )
75
+                    ->setParameter      ('number'  , $criteria['number']  )
76 76
 
77
-                  ->getQuery()
78
-                  ->getResult()
79
-              ;
77
+                    ->getQuery()
78
+                    ->getResult()
79
+                ;
80 80
 
81
-      if (empty($result))
81
+        if (empty($result))
82 82
         return null;
83 83
 
84
-      return $result[0];
84
+        return $result[0];
85 85
     }
86 86
 }
Please login to merge, or discard this patch.
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -23,21 +23,21 @@  discard block
 block discarded – undo
23 23
     public function findOneByCityStateCountryOfPeople(string $city, string $state, string $country, People $people): ?Address
24 24
     {
25 25
       $result = $this->createQueryBuilder('a')
26
-                  ->innerJoin         ('a.street'  , 's')
27
-                  ->innerJoin         ('s.district', 'd')
28
-                  ->innerJoin         ('d.city'    , 'c')
29
-                  ->innerJoin         ('c.state'   , 'e')
30
-                  ->innerJoin         ('e.country' , 'u')
26
+                  ->innerJoin('a.street', 's')
27
+                  ->innerJoin('s.district', 'd')
28
+                  ->innerJoin('d.city', 'c')
29
+                  ->innerJoin('c.state', 'e')
30
+                  ->innerJoin('e.country', 'u')
31 31
 
32
-                  ->andWhere          ('c.city        = :city'   )
33
-                  ->andWhere          ('e.uf          = :state'  )
34
-                  ->andWhere          ('u.countryname = :country')
35
-                  ->andWhere          ('a.people      = :people' )
32
+                  ->andWhere('c.city        = :city')
33
+                  ->andWhere('e.uf          = :state')
34
+                  ->andWhere('u.countryname = :country')
35
+                  ->andWhere('a.people      = :people')
36 36
 
37
-                  ->setParameter      ('city'   , $city   )
38
-                  ->setParameter      ('state'  , $state  )
39
-                  ->setParameter      ('country', $country)
40
-                  ->setParameter      ('people' , $people)
37
+                  ->setParameter('city', $city)
38
+                  ->setParameter('state', $state)
39
+                  ->setParameter('country', $country)
40
+                  ->setParameter('people', $people)
41 41
 
42 42
                   ->getQuery()
43 43
                   ->getResult()
@@ -52,27 +52,27 @@  discard block
 block discarded – undo
52 52
     public function findPeopleAddressBy(People $people, array $criteria): ?Address
53 53
     {
54 54
       $result = $this->createQueryBuilder('a')
55
-                  ->innerJoin         ('a.street'  , 's')
56
-                  ->innerJoin         ('s.district', 'd')
57
-                  ->innerJoin         ('d.city'    , 'c')
58
-                  ->innerJoin         ('c.state'   , 'e')
59
-                  ->innerJoin         ('e.country' , 'u')
55
+                  ->innerJoin('a.street', 's')
56
+                  ->innerJoin('s.district', 'd')
57
+                  ->innerJoin('d.city', 'c')
58
+                  ->innerJoin('c.state', 'e')
59
+                  ->innerJoin('e.country', 'u')
60 60
 
61
-                  ->andWhere          ('a.people      = :people'  )
62
-                  ->andWhere          ('u.countryname = :country' )
63
-                  ->andWhere          ('(e.uf = :state OR e.state = :state)')
64
-                  ->andWhere          ('c.city        = :city'    )
65
-                  ->andWhere          ('d.district    = :district')
66
-                  ->andWhere          ('s.street      = :street'  )
67
-                  ->andWhere          ('a.number      = :number'  )
61
+                  ->andWhere('a.people      = :people')
62
+                  ->andWhere('u.countryname = :country')
63
+                  ->andWhere('(e.uf = :state OR e.state = :state)')
64
+                  ->andWhere('c.city        = :city')
65
+                  ->andWhere('d.district    = :district')
66
+                  ->andWhere('s.street      = :street')
67
+                  ->andWhere('a.number      = :number')
68 68
 
69
-                  ->setParameter      ('people'  , $people)
70
-                  ->setParameter      ('country' , $criteria['country'] )
71
-                  ->setParameter      ('state'   , $criteria['state']   )
72
-                  ->setParameter      ('city'    , $criteria['city']    )
73
-                  ->setParameter      ('district', $criteria['district'])
74
-                  ->setParameter      ('street'  , $criteria['street']  )
75
-                  ->setParameter      ('number'  , $criteria['number']  )
69
+                  ->setParameter('people', $people)
70
+                  ->setParameter('country', $criteria['country'])
71
+                  ->setParameter('state', $criteria['state'])
72
+                  ->setParameter('city', $criteria['city'])
73
+                  ->setParameter('district', $criteria['district'])
74
+                  ->setParameter('street', $criteria['street'])
75
+                  ->setParameter('number', $criteria['number'])
76 76
 
77 77
                   ->getQuery()
78 78
                   ->getResult()
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,8 +43,9 @@  discard block
 block discarded – undo
43 43
                   ->getResult()
44 44
               ;
45 45
 
46
-      if (empty($result))
47
-        return null;
46
+      if (empty($result)) {
47
+              return null;
48
+      }
48 49
 
49 50
       return $result[0];
50 51
     }
@@ -78,8 +79,9 @@  discard block
 block discarded – undo
78 79
                   ->getResult()
79 80
               ;
80 81
 
81
-      if (empty($result))
82
-        return null;
82
+      if (empty($result)) {
83
+              return null;
84
+      }
83 85
 
84 86
       return $result[0];
85 87
     }
Please login to merge, or discard this patch.
src/Controller/GetMenuByPeopleAction.php 3 patches
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -56,15 +56,17 @@
 block discarded – undo
56 56
 
57 57
       $company = $request->query->get('myCompany', null);
58 58
 
59
-      if ($company === null)
60
-        throw new Exception("Company not found", 404);
59
+      if ($company === null) {
60
+              throw new Exception("Company not found", 404);
61
+      }
61 62
 
62 63
 
63 64
       $myCompany = $this->manager->getRepository(People::class)
64 65
         ->find($company);
65 66
 
66
-      if ($myCompany === null)
67
-        throw new Exception("Company not found", 404);
67
+      if ($myCompany === null) {
68
+              throw new Exception("Company not found", 404);
69
+      }
68 70
 
69 71
 
70 72
 
Please login to merge, or discard this patch.
Indentation   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -9,98 +9,98 @@  discard block
 block discarded – undo
9 9
 use Exception;
10 10
 use Symfony\Component\HttpFoundation\JsonResponse;
11 11
 use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface
12
- AS Security;
12
+    AS Security;
13 13
 use ControleOnline\Repository\MenuRepository;
14 14
 
15 15
 
16 16
 class GetMenuByPeopleAction
17 17
 {
18
-  /**
19
-   * Entity Manager
20
-   *
21
-   * @var EntityManagerInterface
22
-   */
23
-  private $manager = null;
24
-
25
-  /**
26
-   * Request
27
-   *
28
-   * @var Request
29
-   */
30
-  private $request  = null;
31
-
32
-  /**
33
-   * Security
34
-   *
35
-   * @var Security
36
-   */
37
-  private $security = null;
38
-
39
-  /**
40
-   * @var \ControleOnline\Repository\MenuRepository
41
-   */
42
-  private $repository = null;
43
-
44
-
45
-  public function __construct(Security $security, EntityManagerInterface $entityManager)
46
-  {
18
+    /**
19
+     * Entity Manager
20
+     *
21
+     * @var EntityManagerInterface
22
+     */
23
+    private $manager = null;
24
+
25
+    /**
26
+     * Request
27
+     *
28
+     * @var Request
29
+     */
30
+    private $request  = null;
31
+
32
+    /**
33
+     * Security
34
+     *
35
+     * @var Security
36
+     */
37
+    private $security = null;
38
+
39
+    /**
40
+     * @var \ControleOnline\Repository\MenuRepository
41
+     */
42
+    private $repository = null;
43
+
44
+
45
+    public function __construct(Security $security, EntityManagerInterface $entityManager)
46
+    {
47 47
     $this->manager    = $entityManager;
48 48
     $this->security   = $security;
49 49
     $this->repository = $this->manager->getRepository(Menu::class);
50
-  }
50
+    }
51 51
 
52
-  public function __invoke(Request $request): JsonResponse
53
-  {
52
+    public function __invoke(Request $request): JsonResponse
53
+    {
54 54
     try {
55 55
 
56
-      $menu  = [];
56
+        $menu  = [];
57 57
 
58
-      $company = $request->query->get('myCompany', null);
58
+        $company = $request->query->get('myCompany', null);
59 59
 
60
-      if ($company === null)
60
+        if ($company === null)
61 61
         throw new Exception("Company not found", 404);
62 62
 
63 63
 
64
-      $myCompany = $this->manager->getRepository(People::class)
64
+        $myCompany = $this->manager->getRepository(People::class)
65 65
         ->find($company);
66 66
 
67
-      if ($myCompany === null)
67
+        if ($myCompany === null)
68 68
         throw new Exception("Company not found", 404);
69 69
 
70 70
 
71 71
 
72
-      $currentUser = $this->security->getToken()->getUser();
73
-      /**
74
-       * @var People
75
-       */
76
-      $userPeople = $currentUser->getPeople();
72
+        $currentUser = $this->security->getToken()->getUser();
73
+        /**
74
+         * @var People
75
+         */
76
+        $userPeople = $currentUser->getPeople();
77 77
 
78
-      $menu =  $this->getMenuByPeople($userPeople, $myCompany);
78
+        $menu =  $this->getMenuByPeople($userPeople, $myCompany);
79 79
 
80 80
 
81
-      return new JsonResponse([
81
+        return new JsonResponse([
82 82
         'response' => [
83
-          'data'    => $menu,
84
-          'count'   => 1,
85
-          'error'   => '',
86
-          'success' => true,
83
+            'data'    => $menu,
84
+            'count'   => 1,
85
+            'error'   => '',
86
+            'success' => true,
87 87
         ],
88
-      ]);
88
+        ]);
89 89
     } catch (\Exception $e) {
90 90
 
91
-      return new JsonResponse([
91
+        return new JsonResponse([
92 92
         'response' => [
93
-          'data'    => [],
94
-          'count'   => 0,
95
-          'error'   => $e->getMessage(),
96
-          'success' => false,
93
+            'data'    => [],
94
+            'count'   => 0,
95
+            'error'   => $e->getMessage(),
96
+            'success' => false,
97 97
         ],
98
-      ]);
98
+        ]);
99
+    }
99 100
     }
100
-  }
101 101
 
102
-  private function getMenuByPeople(People $userPeople, People $myCompany)
103
-  {
102
+    private function getMenuByPeople(People $userPeople, People $myCompany)
103
+    {
104 104
 
105 105
     $return = [];
106 106
     $connection = $this->manager->getConnection();
@@ -134,22 +134,22 @@  discard block
 block discarded – undo
134 134
 
135 135
     foreach ($result as $menu) {
136 136
 
137
-      $return['modules'][$menu['category_id']]['id'] = $menu['category_id'];
138
-      $return['modules'][$menu['category_id']]['label'] = $menu['category_label'];
139
-      $return['modules'][$menu['category_id']]['color'] = $menu['category_color'];
140
-      $return['modules'][$menu['category_id']]['icon'] = $menu['category_icon'];
141
-      $return['modules'][$menu['category_id']]['menus'][] = [
137
+        $return['modules'][$menu['category_id']]['id'] = $menu['category_id'];
138
+        $return['modules'][$menu['category_id']]['label'] = $menu['category_label'];
139
+        $return['modules'][$menu['category_id']]['color'] = $menu['category_color'];
140
+        $return['modules'][$menu['category_id']]['icon'] = $menu['category_icon'];
141
+        $return['modules'][$menu['category_id']]['menus'][] = [
142 142
         'id' => $menu['id'],
143 143
         'label' =>  $menu['menu'],
144 144
         'icon' =>  $menu['icon'],
145 145
         'color' =>  $menu['color'],
146 146
         'route' =>  $menu['route'],
147 147
         'module' =>  '/modules/' . $menu['module'],
148
-      ];
148
+        ];
149 149
     }
150 150
 
151 151
 
152 152
 
153 153
     return $return;
154
-  }
154
+    }
155 155
 }
156 156
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
    *
28 28
    * @var Request
29 29
    */
30
-  private $request  = null;
30
+  private $request = null;
31 31
 
32 32
   /**
33 33
    * Security
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
   {
54 54
     try {
55 55
 
56
-      $menu  = [];
56
+      $menu = [];
57 57
 
58 58
       $company = $request->query->get('myCompany', null);
59 59
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
        */
76 76
       $userPeople = $currentUser->getPeople();
77 77
 
78
-      $menu =  $this->getMenuByPeople($userPeople, $myCompany);
78
+      $menu = $this->getMenuByPeople($userPeople, $myCompany);
79 79
 
80 80
 
81 81
       return new JsonResponse([
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 
108 108
     // build query
109 109
 
110
-    $sql  = 'SELECT menu.*,
110
+    $sql = 'SELECT menu.*,
111 111
             category.name AS category_label,
112 112
             category.color AS category_color,
113 113
             routes.route AS route,
@@ -126,8 +126,8 @@  discard block
 block discarded – undo
126 126
 
127 127
     $params = [];
128 128
 
129
-    $params['myCompany']   = $myCompany->getId();
130
-    $params['userPeople']   = $userPeople->getId();
129
+    $params['myCompany'] = $myCompany->getId();
130
+    $params['userPeople'] = $userPeople->getId();
131 131
     // execute query
132 132
 
133 133
     $result = $connection->executeQuery($sql, $params)->fetchAllAssociative();
Please login to merge, or discard this patch.
src/Repository/ConfigRepository.php 2 patches
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -64,8 +64,9 @@  discard block
 block discarded – undo
64 64
       ->getQuery()
65 65
       ->getResult();
66 66
 
67
-    if (empty($result))
68
-      return null;
67
+    if (empty($result)) {
68
+          return null;
69
+    }
69 70
 
70 71
     $configs = [];
71 72
 
@@ -88,8 +89,9 @@  discard block
 block discarded – undo
88 89
     ]);
89 90
 
90 91
 
91
-    if (empty($config) || $config->getConfigValue() != 'itau')
92
-      return null;
92
+    if (empty($config) || $config->getConfigValue() != 'itau') {
93
+          return null;
94
+    }
93 95
 
94 96
     $result = $this->createQueryBuilder('a')
95 97
       ->andWhere('a.people = :people')
@@ -99,8 +101,9 @@  discard block
 block discarded – undo
99 101
       ->getQuery()
100 102
       ->getResult();
101 103
 
102
-    if (empty($result))
103
-      return null;
104
+    if (empty($result)) {
105
+          return null;
106
+    }
104 107
 
105 108
     $configs = [];
106 109
 
@@ -125,8 +128,9 @@  discard block
 block discarded – undo
125 128
       ->getQuery()
126 129
       ->getResult();
127 130
 
128
-    if (empty($result))
129
-      return null;
131
+    if (empty($result)) {
132
+          return null;
133
+    }
130 134
 
131 135
     $configs = [];
132 136
 
Please login to merge, or discard this patch.
Indentation   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -15,57 +15,57 @@  discard block
 block discarded – undo
15 15
  */
16 16
 class ConfigRepository extends ServiceEntityRepository
17 17
 {
18
-  public function __construct(ManagerRegistry $registry)
19
-  {
18
+    public function __construct(ManagerRegistry $registry)
19
+    {
20 20
     parent::__construct($registry, Config::class);
21
-  }
21
+    }
22 22
 
23
-  public function updatePeopleConfigKey(People $people, string $key, string $value): void
24
-  {
23
+    public function updatePeopleConfigKey(People $people, string $key, string $value): void
24
+    {
25 25
     try {
26
-      $params = [];
26
+        $params = [];
27 27
 
28
-      $this->getEntityManager()->getConnection()
28
+        $this->getEntityManager()->getConnection()
29 29
         ->executeQuery('START TRANSACTION', $params);
30 30
 
31
-      $rawSQL = <<<SQL
31
+        $rawSQL = <<<SQL
32 32
           UPDATE config
33 33
             SET configValue = :value
34 34
           WHERE people_id = :id AND configKey = :key
35 35
         SQL;
36 36
 
37
-      $params = [
37
+        $params = [
38 38
         'id'    => $people->getId(),
39 39
         'key'   => $key,
40 40
         'value' => $value,
41
-      ];
41
+        ];
42 42
 
43
-      $this->getEntityManager()->getConnection()
43
+        $this->getEntityManager()->getConnection()
44 44
         ->executeQuery($rawSQL, $params);
45 45
 
46
-      $this->getEntityManager()->getConnection()
46
+        $this->getEntityManager()->getConnection()
47 47
         ->executeQuery('COMMIT', $params);
48 48
     } catch (\Exception $e) {
49
-      $this->getEntityManager()->getConnection()
49
+        $this->getEntityManager()->getConnection()
50 50
         ->executeQuery('ROLLBACK', $params);
51 51
 
52
-      throw new \Exception($e->getMessage());
52
+        throw new \Exception($e->getMessage());
53
+    }
53 54
     }
54
-  }
55 55
 
56
-  public function getKeyValuesByPeople(People $people, string $key): ?array
57
-  {
56
+    public function getKeyValuesByPeople(People $people, string $key): ?array
57
+    {
58 58
     $result = $this->createQueryBuilder('a')
59
-      ->andWhere('a.people = :people')
60
-      ->andWhere('a.configKey LIKE :prefix')
61
-      ->setParameter('people', $people)
62
-      ->setParameter('prefix', $key . '-%')
59
+        ->andWhere('a.people = :people')
60
+        ->andWhere('a.configKey LIKE :prefix')
61
+        ->setParameter('people', $people)
62
+        ->setParameter('prefix', $key . '-%')
63 63
 
64
-      ->getQuery()
65
-      ->getResult();
64
+        ->getQuery()
65
+        ->getResult();
66 66
 
67 67
     if (empty($result))
68
-      return null;
68
+        return null;
69 69
 
70 70
     $configs = [];
71 71
 
@@ -73,34 +73,34 @@  discard block
 block discarded – undo
73 73
      * @var Config $config
74 74
      */
75 75
     foreach ($result as $config) {
76
-      $configs[$config->getConfigKey()] = $config->getConfigValue();
76
+        $configs[$config->getConfigKey()] = $config->getConfigValue();
77 77
     }
78 78
 
79 79
     return $configs;
80
-  }
80
+    }
81 81
 
82
-  public function getItauConfigByPeople(People $people): ?array
83
-  {
82
+    public function getItauConfigByPeople(People $people): ?array
83
+    {
84 84
 
85 85
     $config = $this->getEntityManager()->getRepository(Config::class)->findOneBy([
86
-      'people' => $people,
87
-      'configKey' => 'payment_type'
86
+        'people' => $people,
87
+        'configKey' => 'payment_type'
88 88
     ]);
89 89
 
90 90
 
91 91
     if (empty($config) || $config->getConfigValue() != 'itau')
92
-      return null;
92
+        return null;
93 93
 
94 94
     $result = $this->createQueryBuilder('a')
95
-      ->andWhere('a.people = :people')
96
-      ->andWhere('a.configKey LIKE :prefix')
97
-      ->setParameter('people', $people)
98
-      ->setParameter('prefix', 'itau-shopline-%')
99
-      ->getQuery()
100
-      ->getResult();
95
+        ->andWhere('a.people = :people')
96
+        ->andWhere('a.configKey LIKE :prefix')
97
+        ->setParameter('people', $people)
98
+        ->setParameter('prefix', 'itau-shopline-%')
99
+        ->getQuery()
100
+        ->getResult();
101 101
 
102 102
     if (empty($result))
103
-      return null;
103
+        return null;
104 104
 
105 105
     $configs = [];
106 106
 
@@ -108,25 +108,25 @@  discard block
 block discarded – undo
108 108
      * @var Config $config
109 109
      */
110 110
     foreach ($result as $config) {
111
-      $configs[$config->getConfigKey()] = $config->getConfigValue();
111
+        $configs[$config->getConfigKey()] = $config->getConfigValue();
112 112
     }
113 113
 
114 114
     return $configs;
115
-  }
115
+    }
116 116
 
117
-  public function getMauticConfigByPeople(People $people): ?array
118
-  {
117
+    public function getMauticConfigByPeople(People $people): ?array
118
+    {
119 119
     $result = $this->createQueryBuilder('a')
120
-      ->andWhere('a.people = :people')
121
-      ->andWhere('a.configKey LIKE :prefix')
122
-      ->setParameter('people', $people)
123
-      ->setParameter('prefix', 'mautic-%')
120
+        ->andWhere('a.people = :people')
121
+        ->andWhere('a.configKey LIKE :prefix')
122
+        ->setParameter('people', $people)
123
+        ->setParameter('prefix', 'mautic-%')
124 124
 
125
-      ->getQuery()
126
-      ->getResult();
125
+        ->getQuery()
126
+        ->getResult();
127 127
 
128 128
     if (empty($result))
129
-      return null;
129
+        return null;
130 130
 
131 131
     $configs = [];
132 132
 
@@ -134,9 +134,9 @@  discard block
 block discarded – undo
134 134
      * @var Config $config
135 135
      */
136 136
     foreach ($result as $config) {
137
-      $configs[$config->getConfigKey()] = $config->getConfigValue();
137
+        $configs[$config->getConfigKey()] = $config->getConfigValue();
138 138
     }
139 139
 
140 140
     return $configs;
141
-  }
141
+    }
142 142
 }
Please login to merge, or discard this patch.
src/Service/PusherService.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
         try {
18 18
             $this->logger->info('Attempting to push message', ['data' => $data, 'topic' => $topic]);
19 19
             
20
-            $webSocketClient =  new Client('localhost', '8080');
20
+            $webSocketClient = new Client('localhost', '8080');
21 21
             $webSocketClient->connect();
22 22
             $webSocketClient->publish($topic, json_encode($data));
23 23
             $webSocketClient->disconnect();
Please login to merge, or discard this patch.
src/Controller/GetFileDataAction.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
         $this->manager = $entityManager;
36 36
     }
37 37
 
38
-    public function __invoke(File $data,  Request $request)
38
+    public function __invoke(File $data, Request $request)
39 39
     {
40 40
 
41 41
         try {
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 
47 47
 
48 48
             $content  = $file->getContent();
49
-            $response = new StreamedResponse(function () use ($content) {
49
+            $response = new StreamedResponse(function() use ($content) {
50 50
                 fputs(fopen('php://output', 'wb'), $content);
51 51
             });
52 52
 
Please login to merge, or discard this patch.
Braces   +8 added lines, -6 removed lines patch added patch discarded remove patch
@@ -52,8 +52,9 @@  discard block
 block discarded – undo
52 52
             ]);
53 53
             $file = $data;
54 54
             //$file = $this->manager->getRepository(File::class)->findOneBy(['url' => $request->getPathInfo()]);
55
-            if (!$file)
56
-                throw new \Exception('Not found', 404);
55
+            if (!$file) {
56
+                            throw new \Exception('Not found', 404);
57
+            }
57 58
 
58 59
 
59 60
             $content  = $file->getContent();
@@ -69,10 +70,11 @@  discard block
 block discarded – undo
69 70
                 $response->headers->set('Content-Type', "$fileType/$ext");
70 71
             }
71 72
 
72
-            if ($fileType == 'image')
73
-                $disposition = HeaderUtils::makeDisposition(HeaderUtils::DISPOSITION_INLINE, basename($request->getPathInfo()));
74
-            else
75
-                $disposition = HeaderUtils::makeDisposition(HeaderUtils::DISPOSITION_ATTACHMENT, basename($request->getPathInfo()));
73
+            if ($fileType == 'image') {
74
+                            $disposition = HeaderUtils::makeDisposition(HeaderUtils::DISPOSITION_INLINE, basename($request->getPathInfo()));
75
+            } else {
76
+                            $disposition = HeaderUtils::makeDisposition(HeaderUtils::DISPOSITION_ATTACHMENT, basename($request->getPathInfo()));
77
+            }
76 78
 
77 79
             $response->headers->set('Content-Disposition', $disposition);
78 80
 
Please login to merge, or discard this patch.
src/Service/PdfService.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 
14 14
     public function showPdf($content)
15 15
     {
16
-        $response = new StreamedResponse(function () use ($content) {
16
+        $response = new StreamedResponse(function() use ($content) {
17 17
             fputs(fopen('php://output', 'wb'), $content);
18 18
         });
19 19
 
Please login to merge, or discard this patch.