Passed
Push — master ( e09dec...e82bb8 )
by Luiz Kim
02:42
created
src/Repository/RouteRepository.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,8 +14,8 @@
 block discarded – undo
14 14
  */
15 15
 class RouteRepository extends ServiceEntityRepository
16 16
 {
17
-  public function __construct(ManagerRegistry $registry)
18
-  {
17
+    public function __construct(ManagerRegistry $registry)
18
+    {
19 19
     parent::__construct($registry, Routes::class);
20
-  }
20
+    }
21 21
 }
Please login to merge, or discard this patch.
src/Repository/MenuRepository.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,8 +14,8 @@
 block discarded – undo
14 14
  */
15 15
 class MenuRepository extends ServiceEntityRepository
16 16
 {
17
-  public function __construct(ManagerRegistry $registry)
18
-  {
17
+    public function __construct(ManagerRegistry $registry)
18
+    {
19 19
     parent::__construct($registry, Menu::class);
20
-  }
20
+    }
21 21
 }
Please login to merge, or discard this patch.
src/Controller/GetActionByPeopleAction.php 1 patch
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -11,58 +11,58 @@  discard block
 block discarded – undo
11 11
 
12 12
 class GetActionByPeopleAction
13 13
 {
14
-  private $manager = null;
15
-  private $security = null;
14
+    private $manager = null;
15
+    private $security = null;
16 16
 
17
-  public function __construct(Security $security, EntityManagerInterface $entityManager)
18
-  {
17
+    public function __construct(Security $security, EntityManagerInterface $entityManager)
18
+    {
19 19
     $this->manager = $entityManager;
20 20
     $this->security = $security;
21
-  }
21
+    }
22 22
 
23
-  public function __invoke(Request $request): JsonResponse
24
-  {
23
+    public function __invoke(Request $request): JsonResponse
24
+    {
25 25
     try {
26
-      $menu = [];
27
-      $company = $request->query->get('myCompany', null);
26
+        $menu = [];
27
+        $company = $request->query->get('myCompany', null);
28 28
 
29
-      if ($company === null) {
29
+        if ($company === null) {
30 30
         throw new Exception("Company not found", 404);
31
-      }
31
+        }
32 32
 
33
-      $myCompany = $this->manager->getRepository(People::class)->find($company);
33
+        $myCompany = $this->manager->getRepository(People::class)->find($company);
34 34
 
35
-      if ($myCompany === null) {
35
+        if ($myCompany === null) {
36 36
         throw new Exception("Company not found", 404);
37
-      }
37
+        }
38 38
 
39
-      $currentUser = $this->security->getToken()->getUser();
40
-      $userPeople = $currentUser->getPeople();
39
+        $currentUser = $this->security->getToken()->getUser();
40
+        $userPeople = $currentUser->getPeople();
41 41
 
42
-      $menu = $this->getMenuByPeople($userPeople, $myCompany);
42
+        $menu = $this->getMenuByPeople($userPeople, $myCompany);
43 43
 
44
-      return new JsonResponse([
44
+        return new JsonResponse([
45 45
         'response' => [
46
-          'data' => $menu,
47
-          'count' => 1,
48
-          'error' => '',
49
-          'success' => true,
46
+            'data' => $menu,
47
+            'count' => 1,
48
+            'error' => '',
49
+            'success' => true,
50 50
         ],
51
-      ]);
51
+        ]);
52 52
     } catch (\Exception $e) {
53
-      return new JsonResponse([
53
+        return new JsonResponse([
54 54
         'response' => [
55
-          'data' => [],
56
-          'count' => 0,
57
-          'error' => $e->getMessage(),
58
-          'success' => false,
55
+            'data' => [],
56
+            'count' => 0,
57
+            'error' => $e->getMessage(),
58
+            'success' => false,
59 59
         ],
60
-      ]);
60
+        ]);
61
+    }
61 62
     }
62
-  }
63 63
 
64
-  private function getMenuByPeople(People $userPeople, People $myCompany)
65
-  {
64
+    private function getMenuByPeople(People $userPeople, People $myCompany)
65
+    {
66 66
     $return = [];
67 67
     $connection = $this->manager->getConnection();
68 68
 
@@ -78,17 +78,17 @@  discard block
 block discarded – undo
78 78
                 GROUP BY action.id';
79 79
 
80 80
     $params = [
81
-      'myCompany' => $myCompany->getId(),
82
-      'userPeople' => $userPeople->getId(),
83
-      'route' => $this->route,
81
+        'myCompany' => $myCompany->getId(),
82
+        'userPeople' => $userPeople->getId(),
83
+        'route' => $this->route,
84 84
     ];
85 85
 
86 86
     $result = $connection->executeQuery($sql, $params)->fetchAllAssociative();
87 87
 
88 88
     foreach ($result as $action) {
89
-      $return['routes'][trim($action['route'])]['actions'][$action['id']] = trim($action['action']);
89
+        $return['routes'][trim($action['route'])]['actions'][$action['id']] = trim($action['action']);
90 90
     }
91 91
 
92 92
     return $return;
93
-  }
93
+    }
94 94
 }
Please login to merge, or discard this patch.
src/Entity/DeviceConfig.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
         return $this;
103 103
     }
104 104
 
105
-    public function getConfigs(bool $decode = false): string|array
105
+    public function getConfigs(bool $decode = false): string | array
106 106
     {
107 107
         // Ensure we're decoding a string, even if it was temporarily an array internally
108 108
         $configString = is_array($this->configs) ? json_encode($this->configs) : $this->configs;
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
         return $this->setConfigs($configs);
117 117
     }
118 118
 
119
-    public function setConfigs(string|array|object $configs): self
119
+    public function setConfigs(string | array | object $configs): self
120 120
     {
121 121
         if (is_string($configs))
122 122
             $configs = json_decode($configs, true);
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -118,8 +118,9 @@
 block discarded – undo
118 118
 
119 119
     public function setConfigs(string|array|object $configs): self
120 120
     {
121
-        if (is_string($configs))
122
-            $configs = json_decode($configs, true);
121
+        if (is_string($configs)) {
122
+                    $configs = json_decode($configs, true);
123
+        }
123 124
 
124 125
         $this->configs = json_encode($configs);
125 126
         return $this;
Please login to merge, or discard this patch.
src/Service/FileService.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -10,27 +10,27 @@
 block discarded – undo
10 10
 class FileService
11 11
 {
12 12
 
13
-  public function __construct(
13
+    public function __construct(
14 14
     private  EntityManagerInterface $manager,
15 15
     private DomainService $domainService
16 16
 
17
-  ) {}
17
+    ) {}
18 18
 
19 19
 
20
-  public function getFileUrl(People $people): ?array
21
-  {
20
+    public function getFileUrl(People $people): ?array
21
+    {
22 22
     if ($people->getImage() instanceof File)
23
-      return [
23
+        return [
24 24
         'id'     => $people->getImage()->getId(),
25 25
         'domain' => $this->domainService->getMainDomain(),
26 26
         'url'    => '/files/' . $people->getImage()->getId() . '/download'
27
-      ];
27
+        ];
28 28
 
29 29
     return null;
30
-  }
30
+    }
31 31
 
32
-  public function addFile(People $people, string  $content, string $context, string $fileName, string $fileType, string $extension): File
33
-  {
32
+    public function addFile(People $people, string  $content, string $context, string $fileName, string $fileType, string $extension): File
33
+    {
34 34
     return $this->manager->getRepository(File::class)->addFile($people, $content, $context, $fileName, $fileType, $extension);
35
-  }
35
+    }
36 36
 }
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,12 +19,13 @@
 block discarded – undo
19 19
 
20 20
   public function getFileUrl(People $people): ?array
21 21
   {
22
-    if ($people->getImage() instanceof File)
23
-      return [
22
+    if ($people->getImage() instanceof File) {
23
+          return [
24 24
         'id'     => $people->getImage()->getId(),
25 25
         'domain' => $this->domainService->getMainDomain(),
26 26
         'url'    => '/files/' . $people->getImage()->getId() . '/download'
27 27
       ];
28
+    }
28 29
 
29 30
     return null;
30 31
   }
Please login to merge, or discard this patch.
src/Entity/Spool.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
     #[ORM\Column(name: 'id', type: 'integer', nullable: false)]
40 40
     #[ORM\Id]
41 41
     #[ORM\GeneratedValue(strategy: 'IDENTITY')]
42
-    #[Groups(['spool_item:read', 'spool:read',])]
42
+    #[Groups(['spool_item:read', 'spool:read', ])]
43 43
     private $id;
44 44
 
45 45
 
Please login to merge, or discard this patch.
src/Entity/Status.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -55,14 +55,14 @@  discard block
 block discarded – undo
55 55
     #[ORM\GeneratedValue(strategy: 'IDENTITY')]
56 56
     #[Groups([
57 57
         'contract:read', 'task:read', 'display_queue:read', 'display:read', 'order_product_queue:read', 'order:read', 'order_details:read', 'order:write',
58
-        'invoice:read', 'invoice_details:read', 'status:read','spool_item:read', 'spool:read', 'spool:write', 'status:write', 'order_detail_status:read', 'logistic:read', 'queue:read', 'queue_people_queue:read'
58
+        'invoice:read', 'invoice_details:read', 'status:read', 'spool_item:read', 'spool:read', 'spool:write', 'status:write', 'order_detail_status:read', 'logistic:read', 'queue:read', 'queue_people_queue:read'
59 59
     ])]
60 60
     private $id;
61 61
 
62 62
     #[ORM\Column(name: 'status', type: 'string', nullable: false)]
63 63
     #[Groups([
64 64
         'contract:read', 'task:read', 'display_queue:read', 'display:read', 'order_product_queue:read', 'order:read', 'order_details:read', 'order:write',
65
-        'invoice:read', 'invoice_details:read', 'status:read','spool_item:read', 'spool:read', 'spool:write', 'status:write', 'order_detail_status:read', 'logistic:read', 'queue:read', 'queue_people_queue:read'
65
+        'invoice:read', 'invoice_details:read', 'status:read', 'spool_item:read', 'spool:read', 'spool:write', 'status:write', 'order_detail_status:read', 'logistic:read', 'queue:read', 'queue_people_queue:read'
66 66
     ])]
67 67
     #[Assert\NotBlank]
68 68
     #[Assert\Type(type: 'string')]
@@ -71,42 +71,42 @@  discard block
 block discarded – undo
71 71
     #[ORM\Column(name: 'real_status', type: 'string', nullable: false)]
72 72
     #[Groups([
73 73
         'contract:read', 'task:read', 'display_queue:read', 'display:read', 'order_product_queue:read', 'order:read', 'order_details:read', 'order:write',
74
-        'invoice:read', 'invoice_details:read', 'status:read','spool_item:read', 'spool:read', 'spool:write', 'status:write', 'order_detail_status:read', 'logistic:read', 'queue:read', 'queue_people_queue:read'
74
+        'invoice:read', 'invoice_details:read', 'status:read', 'spool_item:read', 'spool:read', 'spool:write', 'status:write', 'order_detail_status:read', 'logistic:read', 'queue:read', 'queue_people_queue:read'
75 75
     ])]
76 76
     private $realStatus;
77 77
 
78 78
     #[ORM\Column(name: 'visibility', type: 'string', nullable: false)]
79 79
     #[Groups([
80 80
         'contract:read', 'task:read', 'display_queue:read', 'display:read', 'order_product_queue:read', 'order:read', 'order_details:read', 'order:write',
81
-        'invoice:read', 'invoice_details:read', 'status:read','spool_item:read', 'spool:read', 'spool:write', 'status:write', 'order_detail_status:read', 'logistic:read', 'queue:read', 'queue_people_queue:read'
81
+        'invoice:read', 'invoice_details:read', 'status:read', 'spool_item:read', 'spool:read', 'spool:write', 'status:write', 'order_detail_status:read', 'logistic:read', 'queue:read', 'queue_people_queue:read'
82 82
     ])]
83 83
     private $visibility = 1;
84 84
 
85 85
     #[ORM\Column(name: 'notify', type: 'boolean', nullable: false)]
86 86
     #[Groups([
87 87
         'contract:read', 'task:read', 'display_queue:read', 'display:read', 'order_product_queue:read', 'order:read', 'order_details:read', 'order:write',
88
-        'invoice:read', 'invoice_details:read', 'status:read','spool_item:read', 'spool:read', 'spool:write', 'status:write', 'order_detail_status:read', 'logistic:read', 'queue:read', 'queue_people_queue:read'
88
+        'invoice:read', 'invoice_details:read', 'status:read', 'spool_item:read', 'spool:read', 'spool:write', 'status:write', 'order_detail_status:read', 'logistic:read', 'queue:read', 'queue_people_queue:read'
89 89
     ])]
90 90
     private $notify = 1;
91 91
 
92 92
     #[ORM\Column(name: 'system', type: 'boolean', nullable: false)]
93 93
     #[Groups([
94 94
         'contract:read', 'task:read', 'display_queue:read', 'display:read', 'order_product_queue:read', 'order:read', 'order_details:read', 'order:write',
95
-        'invoice:read', 'invoice_details:read', 'status:read','spool_item:read', 'spool:read', 'spool:write', 'status:write', 'order_detail_status:read', 'logistic:read', 'queue:read', 'queue_people_queue:read'
95
+        'invoice:read', 'invoice_details:read', 'status:read', 'spool_item:read', 'spool:read', 'spool:write', 'status:write', 'order_detail_status:read', 'logistic:read', 'queue:read', 'queue_people_queue:read'
96 96
     ])]
97 97
     private $system = 0;
98 98
 
99 99
     #[ORM\Column(name: 'color', type: 'string', nullable: false)]
100 100
     #[Groups([
101 101
         'contract:read', 'task:read', 'display_queue:read', 'display:read', 'order_product_queue:read', 'order:read', 'order_details:read', 'order:write',
102
-        'invoice:read', 'invoice_details:read', 'status:read','spool_item:read', 'spool:read', 'spool:write', 'status:write', 'order_detail_status:read', 'logistic:read', 'queue:read', 'queue_people_queue:read'
102
+        'invoice:read', 'invoice_details:read', 'status:read', 'spool_item:read', 'spool:read', 'spool:write', 'status:write', 'order_detail_status:read', 'logistic:read', 'queue:read', 'queue_people_queue:read'
103 103
     ])]
104 104
     private $color = '';
105 105
 
106 106
     #[ORM\Column(name: 'context', type: 'string', nullable: false)]
107 107
     #[Groups([
108 108
         'contract:read', 'task:read', 'display_queue:read', 'display:read', 'order_product_queue:read', 'order:read', 'order_details:read', 'order:write',
109
-        'invoice:read', 'invoice_details:read', 'status:read','spool_item:read', 'spool:read', 'spool:write', 'status:write', 'order_detail_status:read', 'logistic:read', 'queue:read', 'queue_people_queue:read'
109
+        'invoice:read', 'invoice_details:read', 'status:read', 'spool_item:read', 'spool:read', 'spool:write', 'status:write', 'order_detail_status:read', 'logistic:read', 'queue:read', 'queue_people_queue:read'
110 110
     ])]
111 111
     private $context;
112 112
 
Please login to merge, or discard this patch.
src/Entity/File.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -70,31 +70,31 @@
 block discarded – undo
70 70
 #[Entity(repositoryClass: FileRepository::class)]
71 71
 class File
72 72
 {
73
-    #[Groups(['file:read', 'spool:read',  'category:read', 'product_category:read', 'order_product:read', 'product_file:read', 'product:read', 'spool_item:read', 'file_item:read', 'contract:read', 'model:read', 'people:read'])]
73
+    #[Groups(['file:read', 'spool:read', 'category:read', 'product_category:read', 'order_product:read', 'product_file:read', 'product:read', 'spool_item:read', 'file_item:read', 'contract:read', 'model:read', 'people:read'])]
74 74
     #[Column(type: 'integer', nullable: false)]
75 75
     #[Id]
76 76
     #[GeneratedValue(strategy: 'IDENTITY')]
77 77
     private int $id = 0;
78 78
 
79
-    #[Groups(['file:read', 'spool:read',  'category:read', 'product_category:read', 'order_product:read', 'product_file:read', 'product:read', 'spool_item:read', 'file_item:read', 'file:write', 'contract:read', 'model:read', 'people:read'])]
79
+    #[Groups(['file:read', 'spool:read', 'category:read', 'product_category:read', 'order_product:read', 'product_file:read', 'product:read', 'spool_item:read', 'file_item:read', 'file:write', 'contract:read', 'model:read', 'people:read'])]
80 80
     #[NotBlank]
81 81
     #[ApiFilter(filterClass: SearchFilter::class, properties: ['fileType' => 'exact'])]
82 82
     #[Column(type: 'string', length: 255, nullable: false)]
83 83
     private string $fileType;
84 84
 
85
-    #[Groups(['file:read', 'spool:read',  'category:read', 'product_category:read', 'order_product:read', 'product_file:read', 'product:read', 'spool_item:read', 'file_item:read', 'file:write', 'contract:read', 'model:read', 'people:read'])]
85
+    #[Groups(['file:read', 'spool:read', 'category:read', 'product_category:read', 'order_product:read', 'product_file:read', 'product:read', 'spool_item:read', 'file_item:read', 'file:write', 'contract:read', 'model:read', 'people:read'])]
86 86
     #[NotBlank]
87 87
     #[ApiFilter(filterClass: SearchFilter::class, properties: ['fileName' => 'exact'])]
88 88
     #[Column(type: 'string', length: 255, nullable: false)]
89 89
     private string $fileName;
90 90
 
91
-    #[Groups(['file:read', 'spool:read',  'category:read', 'product_category:read', 'order_product:read', 'product_file:read', 'product:read', 'spool_item:read', 'file_item:read', 'file:write', 'contract:read', 'model:read', 'people:read'])]
91
+    #[Groups(['file:read', 'spool:read', 'category:read', 'product_category:read', 'order_product:read', 'product_file:read', 'product:read', 'spool_item:read', 'file_item:read', 'file:write', 'contract:read', 'model:read', 'people:read'])]
92 92
     #[NotBlank]
93 93
     #[ApiFilter(filterClass: SearchFilter::class, properties: ['context' => 'exact'])]
94 94
     #[Column(type: 'string', length: 255, nullable: false)]
95 95
     private string $context;
96 96
 
97
-    #[Groups(['file:read', 'spool:read',  'category:read', 'product_category:read', 'order_product:read', 'product_file:read', 'product:read', 'spool_item:read', 'file_item:read', 'file:write', 'contract:read', 'model:read', 'people:read'])]
97
+    #[Groups(['file:read', 'spool:read', 'category:read', 'product_category:read', 'order_product:read', 'product_file:read', 'product:read', 'spool_item:read', 'file_item:read', 'file:write', 'contract:read', 'model:read', 'people:read'])]
98 98
     #[NotBlank]
99 99
     #[ApiFilter(filterClass: SearchFilter::class, properties: ['extension' => 'exact'])]
100 100
     #[Column(type: 'string', length: 255, nullable: false)]
Please login to merge, or discard this patch.
src/Service/StatusService.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
 
18 18
     public function discoveryStatus($realStatus, $name, $context): Status
19 19
     {
20
-        $status =  $this->manager->getRepository(Status::class)->findOneBy([
20
+        $status = $this->manager->getRepository(Status::class)->findOneBy([
21 21
             'realStatus' => $realStatus,
22 22
             'status' => $name,
23 23
             'context' => $context,
Please login to merge, or discard this patch.