Passed
Push — master ( 993609...05c126 )
by y
01:36
created
src/Color.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
     /**
36 36
      * @return string
37 37
      */
38
-    public static function random () {
38
+    public static function random() {
39 39
         try {
40 40
             $colors = (new ReflectionClass(self::class))->getConstants();
41 41
             return $colors[array_rand($colors)];
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,8 +39,7 @@
 block discarded – undo
39 39
         try {
40 40
             $colors = (new ReflectionClass(self::class))->getConstants();
41 41
             return $colors[array_rand($colors)];
42
-        }
43
-        catch (Exception $exception) {
42
+        } catch (Exception $exception) {
44 43
             return 'none'; // unreachable
45 44
         }
46 45
     }
Please login to merge, or discard this patch.
src/CustomField/EnumOption.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -37,23 +37,23 @@  discard block
 block discarded – undo
37 37
      * @param CustomField $customField
38 38
      * @param array $data
39 39
      */
40
-    public function __construct (CustomField $customField, array $data = []) {
40
+    public function __construct(CustomField $customField, array $data = []) {
41 41
         parent::__construct($customField, $data);
42 42
         $this->customField = $customField;
43 43
     }
44 44
 
45
-    final public function __toString (): string {
45
+    final public function __toString(): string {
46 46
         return "enum_options/{$this->getGid()}";
47 47
     }
48 48
 
49
-    final protected function _getDir (): string {
49
+    final protected function _getDir(): string {
50 50
         return "{$this->customField}/enum_options";
51 51
     }
52 52
 
53 53
     /**
54 54
      * @return CustomField
55 55
      */
56
-    public function getCustomField () {
56
+    public function getCustomField() {
57 57
         return $this->customField;
58 58
     }
59 59
 
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
      * @param EnumOption $option
62 62
      * @return $this
63 63
      */
64
-    public function insertAfter (EnumOption $option) {
64
+    public function insertAfter(EnumOption $option) {
65 65
         assert($option->hasGid());
66 66
         if ($this->hasGid()) {
67 67
             $this->api->post("{$this->_getDir()}/insert", [
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
      * @param EnumOption $option
81 81
      * @return $this
82 82
      */
83
-    public function insertBefore (EnumOption $option) {
83
+    public function insertBefore(EnumOption $option) {
84 84
         assert($option->hasGid());
85 85
         if ($this->hasGid()) {
86 86
             $this->api->post("{$this->_getDir()}/insert", [
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -68,8 +68,7 @@  discard block
 block discarded – undo
68 68
                 'enum_option' => $this->getGid(),
69 69
                 'after_enum_option' => $option->getGid()
70 70
             ]);
71
-        }
72
-        else {
71
+        } else {
73 72
             unset($this->data['insert_before'], $this->diff['insert_before']);
74 73
             $this->_set('insert_after', $option->getGid());
75 74
         }
@@ -87,8 +86,7 @@  discard block
 block discarded – undo
87 86
                 'enum_option' => $this->getGid(),
88 87
                 'before_enum_option' => $option->getGid()
89 88
             ]);
90
-        }
91
-        else {
89
+        } else {
92 90
             unset($this->data['insert_after'], $this->diff['insert_after']);
93 91
             $this->_set('insert_before', $option->getGid());
94 92
         }
Please login to merge, or discard this patch.
src/Webhook/AbstractWebhook.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,11 +30,11 @@  discard block
 block discarded – undo
30 30
     }
31 31
     use DeleteTrait;
32 32
 
33
-    final public function __toString (): string {
33
+    final public function __toString(): string {
34 34
         return "webhooks/{$this->getGid()}";
35 35
     }
36 36
 
37
-    final protected function _getDir (): string {
37
+    final protected function _getDir(): string {
38 38
         return 'webhooks';
39 39
     }
40 40
 
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
      * @param string $target
44 44
      * @return $this
45 45
      */
46
-    public function create ($resource, string $target) {
46
+    public function create($resource, string $target) {
47 47
         $this->_set('resource', $resource);
48 48
         $this->_set('target', $target);
49 49
         return $this->_create();
Please login to merge, or discard this patch.
src/CustomField.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -62,8 +62,7 @@
 block discarded – undo
62 62
         $option->setName($name);
63 63
         if ($this->hasGid()) {
64 64
             $option->create();
65
-        }
66
-        else {
65
+        } else {
67 66
             $this->diff['enum_options'] = true;
68 67
         }
69 68
         $this->data['enum_options'][] = $option;
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -40,11 +40,11 @@  discard block
 block discarded – undo
40 40
         'enum_options' => [EnumOption::class],
41 41
     ];
42 42
 
43
-    final public function __toString (): string {
43
+    final public function __toString(): string {
44 44
         return "custom_fields/{$this->getGid()}";
45 45
     }
46 46
 
47
-    final protected function _getDir (): string {
47
+    final protected function _getDir(): string {
48 48
         return 'custom_fields';
49 49
     }
50 50
 
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
      * @param string $name
53 53
      * @return EnumOption
54 54
      */
55
-    public function addEnumOption (string $name) {
55
+    public function addEnumOption(string $name) {
56 56
         /** @var EnumOption $option */
57 57
         $option = $this->factory(EnumOption::class);
58 58
         $option->setName($name);
@@ -69,28 +69,28 @@  discard block
 block discarded – undo
69 69
     /**
70 70
      * @return bool
71 71
      */
72
-    public function hasNotificationsEnabled (): bool {
72
+    public function hasNotificationsEnabled(): bool {
73 73
         return $this->_is('has_notifications_enabled');
74 74
     }
75 75
 
76 76
     /**
77 77
      * @return bool
78 78
      */
79
-    public function isEnum (): bool {
79
+    public function isEnum(): bool {
80 80
         return $this->getResourceSubtype() === self::TYPE_ENUM;
81 81
     }
82 82
 
83 83
     /**
84 84
      * @return bool
85 85
      */
86
-    public function isGlobalToWorkspace (): bool {
86
+    public function isGlobalToWorkspace(): bool {
87 87
         return $this->_is('is_global_to_workspace');
88 88
     }
89 89
 
90 90
     /**
91 91
      * @return bool
92 92
      */
93
-    final public function isText (): bool {
93
+    final public function isText(): bool {
94 94
         return $this->getResourceSubtype() === self::TYPE_TEXT;
95 95
     }
96 96
 
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
      * @param bool $flag
99 99
      * @return $this
100 100
      */
101
-    public function setGlobalToWorkspace (bool $flag) {
101
+    public function setGlobalToWorkspace(bool $flag) {
102 102
         return $this->_set('is_global_to_workspace', $flag);
103 103
     }
104 104
 
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
      * @param bool $flag
107 107
      * @return $this
108 108
      */
109
-    public function setNotificationsEnabled (bool $flag) {
109
+    public function setNotificationsEnabled(bool $flag) {
110 110
         return $this->_set('has_notifications_enabled', $flag);
111 111
     }
112 112
 
Please login to merge, or discard this patch.
src/Api.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -460,8 +460,7 @@
 block discarded – undo
460 460
                 'sync' => $token,
461 461
                 'opt_expand' => 'this'
462 462
             ]));
463
-        }
464
-        catch (Error $error) {
463
+        } catch (Error $error) {
465 464
             if ($error->getCode() !== 412) {
466 465
                 throw $error;
467 466
             }
Please login to merge, or discard this patch.
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -52,24 +52,24 @@  discard block
 block discarded – undo
52 52
     /**
53 53
      * @return Cache
54 54
      */
55
-    public static function getCache () {
55
+    public static function getCache() {
56 56
         return static::$cache ?? static::$cache = new Cache();
57 57
     }
58 58
 
59 59
     /**
60 60
      * @return Api
61 61
      */
62
-    public static function getDefault () {
62
+    public static function getDefault() {
63 63
         return self::$default;
64 64
     }
65 65
 
66 66
     /**
67 67
      * @return LoggerInterface
68 68
      */
69
-    public static function getLogger () {
69
+    public static function getLogger() {
70 70
         return static::$logger ?? static::$logger = new class implements LoggerInterface {
71 71
 
72
-                public function log (string $info, string $path, ?array $payload): void {
72
+                public function log(string $info, string $path, ?array $payload): void {
73 73
                     // stub
74 74
                 }
75 75
 
@@ -79,28 +79,28 @@  discard block
 block discarded – undo
79 79
     /**
80 80
      * @param Cache $cache
81 81
      */
82
-    public static function setCache (Cache $cache) {
82
+    public static function setCache(Cache $cache) {
83 83
         static::$cache = $cache;
84 84
     }
85 85
 
86 86
     /**
87 87
      * @param Api $default
88 88
      */
89
-    public static function setDefault (Api $default) {
89
+    public static function setDefault(Api $default) {
90 90
         self::$default = $default;
91 91
     }
92 92
 
93 93
     /**
94 94
      * @param LoggerInterface $logger
95 95
      */
96
-    public static function setLogger (LoggerInterface $logger) {
96
+    public static function setLogger(LoggerInterface $logger) {
97 97
         static::$logger = $logger;
98 98
     }
99 99
 
100 100
     /**
101 101
      * @param string $token
102 102
      */
103
-    public function __construct (string $token) {
103
+    public function __construct(string $token) {
104 104
         $this->token = $token;
105 105
         if (!static::$default) {
106 106
             static::$default = $this;
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
      *
113 113
      * @param string $path
114 114
      */
115
-    public function delete (string $path): void {
115
+    public function delete(string $path): void {
116 116
         $this->exec('DELETE', $path);
117 117
     }
118 118
 
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
      * @return null|array
124 124
      * @internal
125 125
      */
126
-    protected function exec (string $method, string $path, array $opts = null) {
126
+    protected function exec(string $method, string $path, array $opts = null) {
127 127
         /** @var resource $ch */
128 128
         $ch = curl_init();
129 129
         curl_setopt_array($ch, [
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
      * @param array $data
178 178
      * @return mixed|Data|AbstractEntity
179 179
      */
180
-    public function factory (string $class, $caller, array $data = []) {
180
+    public function factory(string $class, $caller, array $data = []) {
181 181
         return new $class($caller, $data);
182 182
     }
183 183
 
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
      * @param array $options
190 190
      * @return null|array
191 191
      */
192
-    public function get (string $path, array $query = [], array $options = []) {
192
+    public function get(string $path, array $query = [], array $options = []) {
193 193
         foreach ($options as $name => $value) {
194 194
             $query["opt_{$name}"] = $value;
195 195
         }
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
      * @param string $gid
204 204
      * @return null|Attachment
205 205
      */
206
-    public function getAttachment (string $gid) {
206
+    public function getAttachment(string $gid) {
207 207
         return $this->load(Attachment::class, $this, "attachments/{$gid}");
208 208
     }
209 209
 
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
      * @param string $gid
214 214
      * @return null|CustomField
215 215
      */
216
-    public function getCustomField (string $gid) {
216
+    public function getCustomField(string $gid) {
217 217
         return $this->load(CustomField::class, $this, "custom_fields/{$gid}");
218 218
     }
219 219
 
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
      *
223 223
      * @return User
224 224
      */
225
-    public function getMe () {
225
+    public function getMe() {
226 226
         return $this->getUser('me');
227 227
     }
228 228
 
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
      * @param array $query
234 234
      * @return string
235 235
      */
236
-    protected function getPath (string $path, array $query): string {
236
+    protected function getPath(string $path, array $query): string {
237 237
         return $query ? $path . '?' . http_build_query($query) : $path;
238 238
     }
239 239
 
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
      * @param string $gid
244 244
      * @return null|Portfolio
245 245
      */
246
-    public function getPortfolio (string $gid) {
246
+    public function getPortfolio(string $gid) {
247 247
         return $this->load(Portfolio::class, $this, "portfolios/{$gid}");
248 248
     }
249 249
 
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
      * @param string $gid
254 254
      * @return null|Project
255 255
      */
256
-    public function getProject (string $gid) {
256
+    public function getProject(string $gid) {
257 257
         return $this->load(Project::class, $this, "projects/{$gid}");
258 258
     }
259 259
 
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
      * @param string $gid
264 264
      * @return null|Section
265 265
      */
266
-    public function getSection (string $gid) {
266
+    public function getSection(string $gid) {
267 267
         return $this->load(Section::class, $this, "sections/{$gid}");
268 268
     }
269 269
 
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
      * @param string $gid
274 274
      * @return null|Story
275 275
      */
276
-    public function getStory (string $gid) {
276
+    public function getStory(string $gid) {
277 277
         return $this->load(Story::class, $this, "stories/{$gid}");
278 278
     }
279 279
 
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
      * @param string $gid
284 284
      * @return null|Tag
285 285
      */
286
-    public function getTag (string $gid) {
286
+    public function getTag(string $gid) {
287 287
         return $this->load(Tag::class, $this, "tags/{$gid}");
288 288
     }
289 289
 
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
      * @param string $gid
294 294
      * @return null|Task
295 295
      */
296
-    public function getTask (string $gid) {
296
+    public function getTask(string $gid) {
297 297
         return $this->load(Task::class, $this, "tasks/{$gid}");
298 298
     }
299 299
 
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
      * @param string $gid
304 304
      * @return null|Team
305 305
      */
306
-    public function getTeam (string $gid) {
306
+    public function getTeam(string $gid) {
307 307
         return $this->load(Team::class, $this, "teams/{$gid}");
308 308
     }
309 309
 
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
      * @param string $gid
314 314
      * @return null|User
315 315
      */
316
-    public function getUser (string $gid) {
316
+    public function getUser(string $gid) {
317 317
         return $this->load(User::class, $this, "users/{$gid}");
318 318
     }
319 319
 
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
      * @param array $data
326 326
      * @return ProjectEvent|TaskEvent|StoryEvent
327 327
      */
328
-    public function getWebhookEvent (array $data) {
328
+    public function getWebhookEvent(array $data) {
329 329
         static $classes = [
330 330
             Project::TYPE => ProjectEvent::class,
331 331
             Task::TYPE => TaskEvent::class,
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
      * @param string $gid
339 339
      * @return null|Workspace
340 340
      */
341
-    public function getWorkspace (string $gid) {
341
+    public function getWorkspace(string $gid) {
342 342
         return $this->load(Workspace::class, $this, "workspaces/{$gid}");
343 343
     }
344 344
 
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
      * @param string $name
347 347
      * @return null|Workspace
348 348
      */
349
-    public function getWorkspaceByName (string $name) {
349
+    public function getWorkspaceByName(string $name) {
350 350
         foreach ($this->getMe()->getWorkspaces() as $workspace) {
351 351
             if ($workspace->getName() === $name) {
352 352
                 return $workspace;
@@ -359,16 +359,16 @@  discard block
 block discarded – undo
359 359
      * @param string $json
360 360
      * @return null|array
361 361
      */
362
-    protected function jsonDecode (string $json) {
363
-        return json_decode($json, true, JSON_BIGINT_AS_STRING | JSON_THROW_ON_ERROR);
362
+    protected function jsonDecode(string $json) {
363
+        return json_decode($json, true, JSON_BIGINT_AS_STRING|JSON_THROW_ON_ERROR);
364 364
     }
365 365
 
366 366
     /**
367 367
      * @param array $data
368 368
      * @return string
369 369
      */
370
-    protected function jsonEncode (array $data): string {
371
-        return json_encode($data, JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR);
370
+    protected function jsonEncode(array $data): string {
371
+        return json_encode($data, JSON_PRETTY_PRINT|JSON_THROW_ON_ERROR);
372 372
     }
373 373
 
374 374
     /**
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
      * @param array $query
383 383
      * @return null|mixed|AbstractEntity
384 384
      */
385
-    public function load (string $class, $caller, string $path, array $query = []) {
385
+    public function load(string $class, $caller, string $path, array $query = []) {
386 386
         $key = $this->getPath($path, $query);
387 387
         return $this->getCache()->get($key, $caller, function($caller) use ($class, $path, $query) {
388 388
             $data = $this->get($path, $query, ['expand' => 'this']);
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
      * @param int $pages If positive, stops after this many pages have been fetched.
403 403
      * @return array|AbstractEntity[]
404 404
      */
405
-    public function loadAll (string $class, $caller, string $path, array $query = [], int $pages = 0) {
405
+    public function loadAll(string $class, $caller, string $path, array $query = [], int $pages = 0) {
406 406
         $query['opt_expand'] = 'this';
407 407
         $query += ['limit' => 100];
408 408
         $path = $this->getPath($path, $query);
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
      * @param array $options
429 429
      * @return null|array
430 430
      */
431
-    public function post (string $path, array $data = [], array $options = []) {
431
+    public function post(string $path, array $data = [], array $options = []) {
432 432
         $response = $this->exec('POST', $path, [
433 433
             CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
434 434
             CURLOPT_POSTFIELDS => $this->jsonEncode(['options' => $options, 'data' => $data])
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
      * @param array $options
445 445
      * @return null|array
446 446
      */
447
-    public function put (string $path, array $data = [], array $options = []) {
447
+    public function put(string $path, array $data = [], array $options = []) {
448 448
         $response = $this->exec('PUT', $path, [
449 449
             CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
450 450
             CURLOPT_POSTFIELDS => $this->jsonEncode(['options' => $options, 'data' => $data])
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
      * @param null|string $token
464 464
      * @return ProjectEvent[]|TaskEvent[]|StoryEvent[]
465 465
      */
466
-    public function sync ($entity, ?string &$token) {
466
+    public function sync($entity, ?string &$token) {
467 467
         try {
468 468
             $response = $this->exec('GET', $this->getPath('events', [
469 469
                 'resource' => $entity->getGid(),
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
      * @param string $file
499 499
      * @return null|array
500 500
      */
501
-    public function upload (string $path, string $file) {
501
+    public function upload(string $path, string $file) {
502 502
         $response = $this->exec('POST', $path, [
503 503
             CURLOPT_POSTFIELDS => ['file' => new CURLFile(realpath($file))] // multipart/form-data
504 504
         ]);
Please login to merge, or discard this patch.
src/Base/AbstractEntity/WorkspaceTrait.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
      * @param Workspace $workspace
18 18
      * @return $this
19 19
      */
20
-    public function setWorkspace (Workspace $workspace) {
20
+    public function setWorkspace(Workspace $workspace) {
21 21
         assert(!$this->hasGid());
22 22
         return $this->_set('workspace', $workspace);
23 23
     }
Please login to merge, or discard this patch.
src/Base/Data.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -291,11 +291,9 @@
 block discarded – undo
291 291
         $dehydrate = function($each) use (&$dehydrate) {
292 292
             if ($each instanceof AbstractEntity and $each->hasGid()) {
293 293
                 return $each->getGid();
294
-            }
295
-            elseif ($each instanceof self) {
294
+            } elseif ($each instanceof self) {
296 295
                 return $each->toArray();
297
-            }
298
-            elseif (is_array($each)) {
296
+            } elseif (is_array($each)) {
299 297
                 return array_map($dehydrate, $each);
300 298
             }
301 299
             return $each;
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
      * @param Api|Data $caller
41 41
      * @param array $data
42 42
      */
43
-    public function __construct ($caller, array $data = []) {
43
+    public function __construct($caller, array $data = []) {
44 44
         $this->api = $caller instanceof self ? $caller->api : $caller;
45 45
         $this->_setData($data);
46 46
     }
@@ -56,9 +56,9 @@  discard block
 block discarded – undo
56 56
      * @param array $args
57 57
      * @return mixed
58 58
      */
59
-    public function __call (string $method, array $args) {
59
+    public function __call(string $method, array $args) {
60 60
         static $cache = [];
61
-        if (!$call =& $cache[$method]) {
61
+        if (!$call = & $cache[$method]) {
62 62
             preg_match('/^(get|has|is|set)(.+)$/', $method, $call);
63 63
             $call[1] = '_' . $call[1];
64 64
             $call[2] = preg_replace_callback('/[A-Z]/', function(array $match) {
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
         return $this->{$call[1]}($call[2], ...$args);
69 69
     }
70 70
 
71
-    public function __debugInfo (): array {
71
+    public function __debugInfo(): array {
72 72
         return $this->data;
73 73
     }
74 74
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
      * @param $key
79 79
      * @return null|Data|mixed
80 80
      */
81
-    final public function __get ($key) {
81
+    final public function __get($key) {
82 82
         return $this->_get($key);
83 83
     }
84 84
 
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
      * @param $key
91 91
      * @return bool
92 92
      */
93
-    final public function __isset ($key) {
93
+    final public function __isset($key) {
94 94
         return true;
95 95
     }
96 96
 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
      * @param string $key
103 103
      * @return mixed
104 104
      */
105
-    protected function _get (string $key) {
105
+    protected function _get(string $key) {
106 106
         return $this->data[$key] ?? null;
107 107
     }
108 108
 
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
      * @param string $key
117 117
      * @return bool
118 118
      */
119
-    protected function _has (string $key): bool {
119
+    protected function _has(string $key): bool {
120 120
         $value = $this->_get($key);
121 121
         if (isset($value)) {
122 122
             if (is_countable($value)) {
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
      * @param string $key
140 140
      * @return bool
141 141
      */
142
-    protected function _is (string $key): bool {
142
+    protected function _is(string $key): bool {
143 143
         return !empty($this->_get($key));
144 144
     }
145 145
 
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
      * @param mixed $value
153 153
      * @return $this
154 154
      */
155
-    protected function _set (string $key, $value) {
155
+    protected function _set(string $key, $value) {
156 156
         $this->data[$key] = $value;
157 157
         $this->diff[$key] = true;
158 158
         return $this;
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
      *
164 164
      * @param array $data
165 165
      */
166
-    protected function _setData (array $data): void {
166
+    protected function _setData(array $data): void {
167 167
         $this->data = $this->diff = [];
168 168
         foreach ($data as $key => $value) {
169 169
             $this->_setMapped($key, $value);
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
      * @param string $key
177 177
      * @param null|Data|array $value
178 178
      */
179
-    protected function _setMapped (string $key, $value): void {
179
+    protected function _setMapped(string $key, $value): void {
180 180
         unset($this->diff[$key]);
181 181
 
182 182
         // use unmapped values, null, [], Data, and Data[] as-is
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
      * @param array $data
217 217
      * @return mixed|Data|AbstractEntity
218 218
      */
219
-    final protected function factory (string $class, array $data = []) {
219
+    final protected function factory(string $class, array $data = []) {
220 220
         return $this->api->factory($class, $this, $data);
221 221
     }
222 222
 
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
      *
226 226
      * @return array
227 227
      */
228
-    public function getDiff (): array {
228
+    public function getDiff(): array {
229 229
         $convert = function($each) use (&$convert) {
230 230
             // convert existing entities to gids
231 231
             if ($each instanceof AbstractEntity and $each->hasGid()) {
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
      *
251 251
      * @return bool
252 252
      */
253
-    final public function isDiff (): bool {
253
+    final public function isDiff(): bool {
254 254
         return (bool)$this->diff;
255 255
     }
256 256
 
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
      * @see toArray()
259 259
      * @return array
260 260
      */
261
-    public function jsonSerialize (): array {
261
+    public function jsonSerialize(): array {
262 262
         return $this->toArray();
263 263
     }
264 264
 
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
      * @param array $query
273 273
      * @return null|mixed|AbstractEntity
274 274
      */
275
-    final protected function load (string $class, string $path, array $query = []) {
275
+    final protected function load(string $class, string $path, array $query = []) {
276 276
         return $this->api->load($class, $this, $path, $query);
277 277
     }
278 278
 
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
      * @param int $pages
288 288
      * @return array|AbstractEntity[]
289 289
      */
290
-    final protected function loadAll (string $class, string $path, array $query = [], int $pages = 0) {
290
+    final protected function loadAll(string $class, string $path, array $query = [], int $pages = 0) {
291 291
         return $this->api->loadAll($class, $this, $path, $query, $pages);
292 292
     }
293 293
 
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
      *
297 297
      * @return string
298 298
      */
299
-    public function serialize (): string {
299
+    public function serialize(): string {
300 300
         return serialize($this->toArray());
301 301
     }
302 302
 
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
      *
306 306
      * @return array
307 307
      */
308
-    public function toArray (): array {
308
+    public function toArray(): array {
309 309
         if (!$this->api) {
310 310
             return $this->data;
311 311
         }
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
      *
330 330
      * @param $serialized
331 331
      */
332
-    public function unserialize ($serialized): void {
332
+    public function unserialize($serialized): void {
333 333
         $this->api = Api::getDefault();
334 334
         $this->data = unserialize($serialized);
335 335
     }
Please login to merge, or discard this patch.
src/Api/LoggerInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,5 +12,5 @@
 block discarded – undo
12 12
      * @param string $path
13 13
      * @param null|array $payload
14 14
      */
15
-    public function log (string $info, string $path, ?array $payload): void;
15
+    public function log(string $info, string $path, ?array $payload): void;
16 16
 }
17 17
\ No newline at end of file
Please login to merge, or discard this patch.
src/Error.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
      */
21 21
     protected $curlInfo;
22 22
 
23
-    public function __construct (int $code, string $message, array $curlInfo) {
23
+    public function __construct(int $code, string $message, array $curlInfo) {
24 24
         parent::__construct($message, $code);
25 25
         $this->curlInfo = $curlInfo;
26 26
     }
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
     /**
29 29
      * @return array
30 30
      */
31
-    public function getCurlInfo (): array {
31
+    public function getCurlInfo(): array {
32 32
         return $this->curlInfo;
33 33
     }
34 34
 }
35 35
\ No newline at end of file
Please login to merge, or discard this patch.