@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | { |
23 | 23 | $result = $this->exec($this->uri); |
24 | 24 | |
25 | - return $this->extractErrors($result, [200], function () use ($result) { |
|
25 | + return $this->extractErrors($result, [200], function() use ($result) { |
|
26 | 26 | return $this->json_mapper->mapArray( |
27 | 27 | $result->getRawData(), new \ArrayObject(), '\JiraRestApi\Webhook\Webhook' |
28 | 28 | ); |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | { |
40 | 40 | $result = $this->exec($this->uri . '/' . $webhookId); |
41 | 41 | |
42 | - return $this->extractErrors($result, [200], function () use ($result) { |
|
42 | + return $this->extractErrors($result, [200], function() use ($result) { |
|
43 | 43 | return $this->json_mapper->map( |
44 | 44 | $result->getRawData(), new Webhook() |
45 | 45 | ); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | |
58 | 58 | $result = $this->exec($this->uri, $data, Request::METHOD_POST); |
59 | 59 | |
60 | - return $this->extractErrors($result, [201], function () use ($result) { |
|
60 | + return $this->extractErrors($result, [201], function() use ($result) { |
|
61 | 61 | return $this->json_mapper->map( |
62 | 62 | $result->getRawData(), new Webhook() |
63 | 63 | ); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | { |
74 | 74 | $result = $this->exec($this->uri . '/' . $webhookId, null, Request::METHOD_DELETE); |
75 | 75 | |
76 | - return $this->extractErrors($result, [204], function () use ($result) { |
|
76 | + return $this->extractErrors($result, [204], function() use ($result) { |
|
77 | 77 | return $result; |
78 | 78 | }); |
79 | 79 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | { |
74 | 74 | if (!is_null($this->self)) { |
75 | 75 | $parts = explode("/", $this->self); |
76 | - return (int)end($parts); |
|
76 | + return (int) end($parts); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | return null; |
@@ -106,16 +106,16 @@ discard block |
||
106 | 106 | self::JIRA_USER_DELETED, |
107 | 107 | ]; |
108 | 108 | |
109 | - if(is_array($events)) { |
|
110 | - foreach($events as $event) { |
|
111 | - if(in_array($event, $allowed_hooks)) { |
|
109 | + if (is_array($events)) { |
|
110 | + foreach ($events as $event) { |
|
111 | + if (in_array($event, $allowed_hooks)) { |
|
112 | 112 | $this->events[] = $event; |
113 | 113 | } |
114 | 114 | } |
115 | 115 | } |
116 | 116 | |
117 | - if(is_string($events)) { |
|
118 | - if(in_array($events, $allowed_hooks)) { |
|
117 | + if (is_string($events)) { |
|
118 | + if (in_array($events, $allowed_hooks)) { |
|
119 | 119 | $this->events[] = $events; |
120 | 120 | } |
121 | 121 | } |
@@ -123,7 +123,7 @@ |
||
123 | 123 | */ |
124 | 124 | public function setError($message) |
125 | 125 | { |
126 | - if(is_array($this->error) && isset($this->error['errorMessages'])) { |
|
126 | + if (is_array($this->error) && isset($this->error['errorMessages'])) { |
|
127 | 127 | $this->error['errorMessages'][] = $message; |
128 | 128 | } else { |
129 | 129 | $this->error = ['errorMessages' => [$message]]; |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | { |
19 | 19 | $app['jira.config'] = []; |
20 | 20 | |
21 | - $app['jira.rest.transport'] = function () use ($app) { |
|
21 | + $app['jira.rest.transport'] = function() use ($app) { |
|
22 | 22 | $cfg = $app['jira.rest.configuration']; |
23 | 23 | |
24 | 24 | return new Client([ |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | }; |
33 | 33 | |
34 | 34 | $app['jira.rest.service.builder'] = $app->protect(function($serviceName) use ($app) { |
35 | - if(class_exists($serviceName)) { |
|
35 | + if (class_exists($serviceName)) { |
|
36 | 36 | return new $serviceName($app['jira.rest.configuration'], $app['jira.rest.transport'], $app['logger']); |
37 | 37 | } |
38 | 38 | |
39 | - throw new \Exception('Service ' . $serviceName .' not found'); |
|
39 | + throw new \Exception('Service ' . $serviceName . ' not found'); |
|
40 | 40 | }); |
41 | 41 | |
42 | 42 | $app['jira.rest.issue'] = function() use ($app) { |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | { |
18 | 18 | $app['jira.config'] = []; |
19 | 19 | |
20 | - $app['jira.rest.transport'] = $app->share(function () use ($app) { |
|
20 | + $app['jira.rest.transport'] = $app->share(function() use ($app) { |
|
21 | 21 | $cfg = $app['jira.rest.configuration']; |
22 | 22 | |
23 | 23 | return new Client([ |
@@ -31,11 +31,11 @@ discard block |
||
31 | 31 | }); |
32 | 32 | |
33 | 33 | $app['jira.rest.service.builder'] = $app->protect(function($serviceName) use ($app) { |
34 | - if(class_exists($serviceName)) { |
|
34 | + if (class_exists($serviceName)) { |
|
35 | 35 | return new $serviceName($app['jira.rest.configuration'], $app['jira.rest.transport'], $app['logger']); |
36 | 36 | } |
37 | 37 | |
38 | - throw new \Exception('Service ' . $serviceName .' not found'); |
|
38 | + throw new \Exception('Service ' . $serviceName . ' not found'); |
|
39 | 39 | }); |
40 | 40 | |
41 | 41 | $app['jira.rest.issue'] = $app->share(function() use ($app) { |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | { |
24 | 24 | $result = $this->exec($this->uri . '/' . $issueIdOrKey); |
25 | 25 | |
26 | - return $this->extractErrors($result, [200], function () use ($result) { |
|
26 | + return $this->extractErrors($result, [200], function() use ($result) { |
|
27 | 27 | return $this->json_mapper->map( |
28 | 28 | $result->getRawData(), new Issue() |
29 | 29 | ); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | /** @var JiraClientResponse $result */ |
53 | 53 | $result = $this->exec($this->searchUri, $data, Request::METHOD_POST); |
54 | 54 | |
55 | - return $this->extractErrors($result, [200], function () use ($result) { |
|
55 | + return $this->extractErrors($result, [200], function() use ($result) { |
|
56 | 56 | return $this->json_mapper->map( |
57 | 57 | $result->getRawData(), new IssueSearchResult() |
58 | 58 | ); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | |
75 | 75 | $result = $this->exec($this->uri, $data, Request::METHOD_POST); |
76 | 76 | |
77 | - return $this->extractErrors($result, [201], function () use ($result) { |
|
77 | + return $this->extractErrors($result, [201], function() use ($result) { |
|
78 | 78 | return $this->json_mapper->map( |
79 | 79 | $result->getRawData(), new Issue() |
80 | 80 | ); |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | |
100 | 100 | $result = $this->exec($this->uri . '/' . $issueIdOrKey, $data, Request::METHOD_PUT); |
101 | 101 | |
102 | - return $this->extractErrors($result, [204], function () use ($result) { |
|
102 | + return $this->extractErrors($result, [204], function() use ($result) { |
|
103 | 103 | return $result; |
104 | 104 | }); |
105 | 105 | } |
@@ -114,11 +114,11 @@ discard block |
||
114 | 114 | */ |
115 | 115 | public function addAttachments($issueIdOrKey, array $filePathArray) |
116 | 116 | { |
117 | - $results = $this->upload($this->uri . '/' . $issueIdOrKey .'/attachments', $filePathArray); |
|
117 | + $results = $this->upload($this->uri . '/' . $issueIdOrKey . '/attachments', $filePathArray); |
|
118 | 118 | |
119 | 119 | $resArr = []; |
120 | 120 | foreach ($results as $result) { |
121 | - $extracted = $this->extractErrors($result, [200], function () use ($result) { |
|
121 | + $extracted = $this->extractErrors($result, [200], function() use ($result) { |
|
122 | 122 | return $this->json_mapper->mapArray( |
123 | 123 | $result->getRawData(), new \ArrayObject(), '\JiraRestApi\Issue\Attachment' |
124 | 124 | ); |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | $data = $this->filterNullVariable($comment); |
155 | 155 | $result = $this->exec($this->uri . '/' . $issueIdOrKey . '/comment', $data, Request::METHOD_POST); |
156 | 156 | |
157 | - return $this->extractErrors($result, [201], function () use ($result) { |
|
157 | + return $this->extractErrors($result, [201], function() use ($result) { |
|
158 | 158 | return $this->json_mapper->map( |
159 | 159 | $result->getRawData(), new Comment() |
160 | 160 | ); |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | |
184 | 184 | $result = $this->exec($this->uri . '/' . $issueIdOrKey . '/comment/' . $commentId, $data, Request::METHOD_PUT); |
185 | 185 | |
186 | - return $this->extractErrors($result, [200], function () use ($result) { |
|
186 | + return $this->extractErrors($result, [200], function() use ($result) { |
|
187 | 187 | return $this->json_mapper->map( |
188 | 188 | $result->getRawData(), new Comment() |
189 | 189 | ); |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | { |
204 | 204 | $result = $this->exec($this->uri . '/' . $issueIdOrKey . '/transitions'); |
205 | 205 | |
206 | - return $this->extractErrors($result, [200], function () use ($result) { |
|
206 | + return $this->extractErrors($result, [200], function() use ($result) { |
|
207 | 207 | $data = $result->getRawData(); |
208 | 208 | return $this->json_mapper->mapArray( |
209 | 209 | $data['transitions'], new \ArrayObject(), '\JiraRestApi\Issue\Transition' |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | |
256 | 256 | $result = $this->exec($this->uri . '/' . $issueIdOrKey . '/transitions', $data, Request::METHOD_POST); |
257 | 257 | |
258 | - return $this->extractErrors($result, [204], function () use ($result) { |
|
258 | + return $this->extractErrors($result, [204], function() use ($result) { |
|
259 | 259 | return $result; |
260 | 260 | }); |
261 | 261 | } |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | |
294 | 294 | $result = $this->exec($this->uri . '/' . $issueIdOrKey, $data, Request::METHOD_PUT); |
295 | 295 | |
296 | - return $this->extractErrors($result, [204], function () use ($result) { |
|
296 | + return $this->extractErrors($result, [204], function() use ($result) { |
|
297 | 297 | return $result; |
298 | 298 | }); |
299 | 299 | } |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | { |
310 | 310 | $result = $this->exec($this->uri . '/' . $issueIdOrKey . '/worklog'); |
311 | 311 | |
312 | - return $this->extractErrors($result, [200], function () use ($result) { |
|
312 | + return $this->extractErrors($result, [200], function() use ($result) { |
|
313 | 313 | return $this->json_mapper->map( |
314 | 314 | $result->getRawData(), new Worklog() |
315 | 315 | ); |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | $data['update']['labels'][]['set'] = $labels; |
330 | 330 | |
331 | 331 | $result = $this->exec($this->uri . '/' . $issueIdOrKey, $data, Request::METHOD_PUT); |
332 | - return $this->extractErrors($result, [204], function () use ($result) { |
|
332 | + return $this->extractErrors($result, [204], function() use ($result) { |
|
333 | 333 | return $result; |
334 | 334 | }); |
335 | 335 | } |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | $data['update']['labels'][]['remove'] = $labels; |
348 | 348 | |
349 | 349 | $result = $this->exec($this->uri . '/' . $issueIdOrKey, $data, Request::METHOD_PUT); |
350 | - return $this->extractErrors($result, [204], function () use ($result) { |
|
350 | + return $this->extractErrors($result, [204], function() use ($result) { |
|
351 | 351 | return $result; |
352 | 352 | }); |
353 | 353 | } |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | { |
16 | 16 | $result = $this->exec($this->uri); |
17 | 17 | |
18 | - return $this->extractErrors($result, [200], function () use ($result) { |
|
18 | + return $this->extractErrors($result, [200], function() use ($result) { |
|
19 | 19 | return $this->json_mapper->mapArray( |
20 | 20 | $result->getRawData(), new \ArrayObject(), '\JiraRestApi\Issue\IssueType' |
21 | 21 | ); |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | { |
32 | 32 | $result = $this->exec($this->uri . '/' . $issuetypeId); |
33 | 33 | |
34 | - return $this->extractErrors($result, [200], function () use ($result) { |
|
34 | + return $this->extractErrors($result, [200], function() use ($result) { |
|
35 | 35 | return $this->json_mapper->map( |
36 | 36 | $result->getRawData(), new \JiraRestApi\Issue\IssueType |
37 | 37 | ); |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | |
231 | 231 | public function setProjectKey($key) |
232 | 232 | { |
233 | - if(is_null($this->project)) { |
|
233 | + if (is_null($this->project)) { |
|
234 | 234 | $this->project = new Project(); |
235 | 235 | } |
236 | 236 | |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | |
242 | 242 | public function setProjectId($id) |
243 | 243 | { |
244 | - if(is_null($this->project)) { |
|
244 | + if (is_null($this->project)) { |
|
245 | 245 | $this->project = new Project(); |
246 | 246 | } |
247 | 247 |
@@ -84,7 +84,7 @@ |
||
84 | 84 | |
85 | 85 | public function setVisibility($visibility, $value = null) |
86 | 86 | { |
87 | - if(is_string($visibility) && is_string($value)) { |
|
87 | + if (is_string($visibility) && is_string($value)) { |
|
88 | 88 | $visibility = ['type' => $visibility, 'value' => $value]; |
89 | 89 | } |
90 | 90 |