Passed
Push — master ( 2763ba...d4bcf5 )
by Jérémy
01:59
created
src/Model/SummaryReportSettingsDto.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@
 block discarded – undo
12 12
     public static function fromArray(array $data): self
13 13
     {
14 14
         return new self(
15
-            $data['group'],
16
-            $data['subgroup']
15
+            $data[ 'group' ],
16
+            $data[ 'subgroup' ]
17 17
         );
18 18
     }
19 19
 
Please login to merge, or discard this patch.
src/Model/UserDto.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -19,20 +19,20 @@
 block discarded – undo
19 19
     public static function fromArray(array $data): self
20 20
     {
21 21
         return new self(
22
-            $data['activeWorkspace'],
23
-            $data['defaultWorkspace'],
24
-            $data['email'],
25
-            $data['id'],
22
+            $data[ 'activeWorkspace' ],
23
+            $data[ 'defaultWorkspace' ],
24
+            $data[ 'email' ],
25
+            $data[ 'id' ],
26 26
             array_map(
27 27
                 static function(array $membership): MembershipDto {
28 28
                     return MembershipDto::fromArray($membership);
29 29
                 },
30
-                $data['memberships']
30
+                $data[ 'memberships' ]
31 31
             ),
32
-            $data['name'],
33
-            $data['profilePicture'],
34
-            UserSettingsDto::fromArray($data['settings']),
35
-            new UserStatus($data['status'])
32
+            $data[ 'name' ],
33
+            $data[ 'profilePicture' ],
34
+            UserSettingsDto::fromArray($data[ 'settings' ]),
35
+            new UserStatus($data[ 'status' ])
36 36
         );
37 37
     }
38 38
 
Please login to merge, or discard this patch.
src/Api/TimeEntry/TimeEntry.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -40,13 +40,13 @@  discard block
 block discarded – undo
40 40
         return TimeEntryDtoImpl::fromArray($data);
41 41
     }
42 42
 
43
-    public function entry(string $workspaceId, string $id, array $params = []): TimeEntryDtoImpl
43
+    public function entry(string $workspaceId, string $id, array $params = [ ]): TimeEntryDtoImpl
44 44
     {
45
-        if (isset($params['consider-duration-format']) && !is_bool($params['consider-duration-format'])) {
45
+        if (isset($params[ 'consider-duration-format' ]) && !is_bool($params[ 'consider-duration-format' ])) {
46 46
             throw new ClockifyException('Invalid "consider-duration-format" parameter (should be a boolean value)');
47 47
         }
48 48
 
49
-        if (isset($params['hydrated']) && !is_bool($params['hydrated'])) {
49
+        if (isset($params[ 'hydrated' ]) && !is_bool($params[ 'hydrated' ])) {
50 50
             throw new ClockifyException('Invalid "hydrated" parameter (should be a boolean value)');
51 51
         }
52 52
 
@@ -67,57 +67,57 @@  discard block
 block discarded – undo
67 67
         return TimeEntryDtoImpl::fromArray($data);
68 68
     }
69 69
 
70
-    public function find(string $workspaceId, string $userId, array $params = []): array
70
+    public function find(string $workspaceId, string $userId, array $params = [ ]): array
71 71
     {
72
-        if (isset($params['description']) && !is_string($params['description'])) {
72
+        if (isset($params[ 'description' ]) && !is_string($params[ 'description' ])) {
73 73
             throw new ClockifyException('Invalid "description" parameter');
74 74
         }
75 75
 
76
-        if (isset($params['start']) && !is_string($params['start'])) {
76
+        if (isset($params[ 'start' ]) && !is_string($params[ 'start' ])) {
77 77
             throw new ClockifyException('Invalid "start" parameter');
78 78
         }
79 79
 
80
-        if (isset($params['end']) && !is_string($params['end'])) {
80
+        if (isset($params[ 'end' ]) && !is_string($params[ 'end' ])) {
81 81
             throw new ClockifyException('Invalid "end" parameter');
82 82
         }
83 83
 
84
-        if (isset($params['project']) && !is_string($params['project'])) {
84
+        if (isset($params[ 'project' ]) && !is_string($params[ 'project' ])) {
85 85
             throw new ClockifyException('Invalid "project" parameter');
86 86
         }
87 87
 
88
-        if (isset($params['task']) && !is_string($params['task'])) {
88
+        if (isset($params[ 'task' ]) && !is_string($params[ 'task' ])) {
89 89
             throw new ClockifyException('Invalid "task" parameter');
90 90
         }
91 91
 
92
-        if (isset($params['tags']) && !is_array($params['tags'])) {
92
+        if (isset($params[ 'tags' ]) && !is_array($params[ 'tags' ])) {
93 93
             throw new ClockifyException('Invalid "tags" parameter');
94 94
         }
95 95
 
96
-        if (isset($params['project-required']) && !is_bool($params['project-required'])) {
96
+        if (isset($params[ 'project-required' ]) && !is_bool($params[ 'project-required' ])) {
97 97
             throw new ClockifyException('Invalid "project-required" parameter');
98 98
         }
99 99
 
100
-        if (isset($params['task-required']) && !is_bool($params['task-required'])) {
100
+        if (isset($params[ 'task-required' ]) && !is_bool($params[ 'task-required' ])) {
101 101
             throw new ClockifyException('Invalid "task-required" parameter');
102 102
         }
103 103
 
104
-        if (isset($params['consider-duration-format']) && !is_bool($params['consider-duration-format'])) {
104
+        if (isset($params[ 'consider-duration-format' ]) && !is_bool($params[ 'consider-duration-format' ])) {
105 105
             throw new ClockifyException('Invalid "consider-duration-format" parameter');
106 106
         }
107 107
 
108
-        if (isset($params['hydrated']) && !is_bool($params['hydrated'])) {
108
+        if (isset($params[ 'hydrated' ]) && !is_bool($params[ 'hydrated' ])) {
109 109
             throw new ClockifyException('Invalid "hydrated" parameter');
110 110
         }
111 111
 
112
-        if (isset($params['in-progress']) && !is_bool($params['in-progress'])) {
112
+        if (isset($params[ 'in-progress' ]) && !is_bool($params[ 'in-progress' ])) {
113 113
             throw new ClockifyException('Invalid "in-progress" parameter');
114 114
         }
115 115
 
116
-        if (isset($params['page']) && (!is_int($params['page']) || $params['page'] < 1)) {
116
+        if (isset($params[ 'page' ]) && (!is_int($params[ 'page' ]) || $params[ 'page' ] < 1)) {
117 117
             throw new ClockifyException('Invalid "page" parameter');
118 118
         }
119 119
 
120
-        if (isset($params['page-size']) && (!is_int($params['page-size']) || $params['page-size'] < 1)) {
120
+        if (isset($params[ 'page-size' ]) && (!is_int($params[ 'page-size' ]) || $params[ 'page-size' ] < 1)) {
121 121
             throw new ClockifyException('Invalid "page-size" parameter');
122 122
         }
123 123
 
Please login to merge, or discard this patch.
src/Client.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
         $this->http = $http;
24 24
     }
25 25
 
26
-    public function get(string $uri, array $params = []): array
26
+    public function get(string $uri, array $params = [ ]): array
27 27
     {
28 28
         if (!empty($params)) {
29 29
             $uri .= '?'.http_build_query($params);
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
     public function post(string $uri, array $data): array
42 42
     {
43
-        $response = $this->http->post($uri, [], json_encode($data, JSON_THROW_ON_ERROR));
43
+        $response = $this->http->post($uri, [ ], json_encode($data, JSON_THROW_ON_ERROR));
44 44
 
45 45
         if (201 !== $response->getStatusCode()) {
46 46
             throw $this->createExceptionFromResponse($response);
@@ -51,9 +51,9 @@  discard block
 block discarded – undo
51 51
 
52 52
     public function put(string $uri, array $data): array
53 53
     {
54
-        $response = $this->http->put($uri, [], json_encode($data, JSON_THROW_ON_ERROR));
54
+        $response = $this->http->put($uri, [ ], json_encode($data, JSON_THROW_ON_ERROR));
55 55
 
56
-        if (!in_array($response->getStatusCode(), [200, 201], true)) {
56
+        if (!in_array($response->getStatusCode(), [ 200, 201 ], true)) {
57 57
             throw $this->createExceptionFromResponse($response);
58 58
         }
59 59
 
@@ -62,9 +62,9 @@  discard block
 block discarded – undo
62 62
 
63 63
     public function patch(string $uri, array $data): array
64 64
     {
65
-        $response = $this->http->patch($uri, [], json_encode($data, JSON_THROW_ON_ERROR));
65
+        $response = $this->http->patch($uri, [ ], json_encode($data, JSON_THROW_ON_ERROR));
66 66
 
67
-        if (!in_array($response->getStatusCode(), [200, 204], true)) {
67
+        if (!in_array($response->getStatusCode(), [ 200, 204 ], true)) {
68 68
             throw $this->createExceptionFromResponse($response);
69 69
         }
70 70
 
@@ -83,8 +83,8 @@  discard block
 block discarded – undo
83 83
     private function createExceptionFromResponse(ResponseInterface $response): ClockifyException
84 84
     {
85 85
         $data = json_decode((string) $response->getBody(), true);
86
-        $message = $data['message'] ?? '';
87
-        $code = $data['code'] ?? 0;
86
+        $message = $data[ 'message' ] ?? '';
87
+        $code = $data[ 'code' ] ?? 0;
88 88
 
89 89
         switch ($response->getStatusCode()) {
90 90
             case 400:
Please login to merge, or discard this patch.