Passed
Pull Request — master (#86)
by Daniel
38:48 queued 23:54
created
src/ValueObjects/Transporter/QueryParams.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
     /**
31 31
      * Creates a new Query Params value object, with the newly added param, and the existing params.
32 32
      */
33
-    public function withParam(string $name, string|int $value): self
33
+    public function withParam(string $name, string | int $value): self
34 34
     {
35 35
         return new self([
36 36
             ...$this->params,
Please login to merge, or discard this patch.
src/Contracts/TransporterContract.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
      *
23 23
      * @throws ErrorException|UnserializableResponse|TransporterException
24 24
      */
25
-    public function requestObject(Payload $payload): array|string;
25
+    public function requestObject(Payload $payload): array | string;
26 26
 
27 27
     /**
28 28
      * Sends a content request to a server.
Please login to merge, or discard this patch.
src/Transporters/HttpTransporter.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
     /**
40 40
      * {@inheritDoc}
41 41
      */
42
-    public function requestObject(Payload $payload): array|string
42
+    public function requestObject(Payload $payload): array | string
43 43
     {
44 44
         $request = $payload->toRequest($this->baseUri, $this->headers, $this->queryParams);
45 45
 
Please login to merge, or discard this patch.
src/Factory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
      */
118 118
     private function makeStreamHandler(ClientInterface $client): Closure
119 119
     {
120
-        if (! is_null($this->streamHandler)) {
120
+        if (!is_null($this->streamHandler)) {
121 121
             return $this->streamHandler;
122 122
         }
123 123
 
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
             return fn (RequestInterface $request): ResponseInterface => $client->sendRequest($request); // @phpstan-ignore-line
130 130
         }
131 131
 
132
-        return function (RequestInterface $_): never {
132
+        return function(RequestInterface $_): never {
133 133
             throw new Exception('To use stream requests you must provide an stream handler closure via the OpenAI factory.');
134 134
         };
135 135
     }
Please login to merge, or discard this patch.
src/Bookwhen.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
         $eventTickets = [];
261 261
         
262 262
         // attachments
263
-        if($attachments) {
263
+        if ($attachments) {
264 264
             foreach ($event->attachments as $eventAttachment) {
265 265
                 $attachment = $this->client->attachments()->retrieve($eventAttachment['id']);
266 266
                 array_push($eventAttachments, new Attachment(
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 
273 273
         // location
274 274
         // @todo resolve dynamic type
275
-        if(!$location) {
275
+        if (!$location) {
276 276
             $eventLocation = new Location(
277 277
                 null,
278 278
                 null,
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
         }
294 294
         
295 295
         // tickets
296
-        if($tickets) {
296
+        if ($tickets) {
297 297
             foreach ($event->tickets as $eventTicket) {
298 298
                 $ticket = $this->client->tickets()->retrieve($eventTicket['id']);
299 299
                 array_push($eventTickets, new Ticket(
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
                 throw new ValidationException('detail', implode(' ', $detail));
371 371
             } else {
372 372
                 $detail = array_unique($detail);
373
-                foreach($detail as $item) {
373
+                foreach ($detail as $item) {
374 374
                     if (!$this->validator->validLocation($item)) {
375 375
                         throw new ValidationException('detail', $item);
376 376
                     }
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
                 throw new ValidationException('location', implode(' ', $title));
398 398
             } else {
399 399
                 $location = array_unique($location);
400
-                foreach($location as $item) {
400
+                foreach ($location as $item) {
401 401
                     if (!$this->validator->validLocation($item)) {
402 402
                         throw new ValidationException('location', $item);
403 403
                     }
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
                 throw new ValidationException('title', implode(' ', $title));
428 428
             } else {
429 429
                 $title = array_unique($title);
430
-                foreach($title as $item) {
430
+                foreach ($title as $item) {
431 431
                     if (!$this->validator->validTitle($item)) {
432 432
                         throw new ValidationException('title', $item);
433 433
                     }
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
         if (!$this->validator->validInclude($includeAttachments)) {
450 450
             throw new ValidationException('includeAttachments', $includeAttachments);
451 451
         } else {
452
-            if($includeAttachments) {
452
+            if ($includeAttachments) {
453 453
                 array_push($this->includes, 'attachments');
454 454
             }
455 455
         }
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
         if (!$this->validator->validInclude($includeLocation)) {
459 459
             throw new ValidationException('includeLocation', $includeLocation);
460 460
         } else {
461
-            if($includeLocation) {
461
+            if ($includeLocation) {
462 462
                 array_push($this->includes, 'location');
463 463
             }
464 464
         }
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
         if (!$this->validator->validInclude($includeTickets)) {
468 468
             throw new ValidationException('includeTickets', $includeTickets);
469 469
         } else {
470
-            if($includeTickets) {
470
+            if ($includeTickets) {
471 471
                 array_push($this->includes, 'tickets');
472 472
             }
473 473
         }
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
         if (!$this->validator->validInclude($includeTicketsEvents)) {
477 477
             throw new ValidationException('includeTicketsEvents', $includeTicketsEvents);
478 478
         } else {
479
-            if($includeTickets) {
479
+            if ($includeTickets) {
480 480
                 array_push($this->includes, 'tickets.events');
481 481
             }
482 482
         }
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
         if (!$this->validator->validInclude($includeTicketsClassPasses)) {
486 486
             throw new ValidationException('includeTicketsClassPasses', $includeTicketsClassPasses);
487 487
         } else {
488
-            if($includeTicketsClassPasses) {
488
+            if ($includeTicketsClassPasses) {
489 489
                 array_push($this->includes, 'tickets.class_passes');
490 490
             }
491 491
         }
Please login to merge, or discard this patch.
Indentation   +6 added lines, -8 removed lines patch added patch discarded remove patch
@@ -75,17 +75,15 @@  discard block
 block discarded – undo
75 75
      */
76 76
     private array $includes = [];
77 77
     /**
78
-
79 78
      */
80 79
     public Ticket $ticket;
81 80
 
82 81
     /**
83
-
84 82
      */
85 83
     public array $tickets = [];
86 84
 
87 85
     /**
88
-        *
86
+     *
89 87
      */
90 88
     public $locations = [];
91 89
 
@@ -588,11 +586,11 @@  discard block
 block discarded – undo
588 586
         $this->logging = $level;
589 587
     }
590 588
 
591
-     /**
592
-     * Sets the token for all future new instances
593
-     * @deprecated
594
-     * @param $token string The API access token, as obtained on diffbot.com/dev.
595
-     */
589
+        /**
590
+         * Sets the token for all future new instances
591
+         * @deprecated
592
+         * @param $token string The API access token, as obtained on diffbot.com/dev.
593
+         */
596 594
     public static function setToken($token)
597 595
     {
598 596
         $validator = new Validator();
Please login to merge, or discard this patch.
src/Client.php 1 patch
Indentation   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -53,7 +53,6 @@  discard block
 block discarded – undo
53 53
     }
54 54
 
55 55
     /**
56
-
57 56
      */
58 57
     public function classPasses(): ClassPasses
59 58
     {
@@ -66,16 +65,14 @@  discard block
 block discarded – undo
66 65
     {
67 66
         return new Events($this->transporter);
68 67
     }
69
-   /**
70
-
71
-    */
68
+    /**
69
+     */
72 70
     public function locations(): Locations
73 71
     {
74 72
         return new Locations($this->transporter);
75 73
     }
76 74
 /**
77
-
78
- */
75
+     */
79 76
     public function tickets(): Tickets
80 77
     {
81 78
         return new Tickets($this->transporter);
Please login to merge, or discard this patch.
src/Domain/Location.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
         public readonly null | string $additionalInfo = null,
15 15
         public readonly string $id,
16 16
         public readonly float | null $latitude = null,
17
-        public readonly float| null $longitude = null,
17
+        public readonly float | null $longitude = null,
18 18
         public readonly null | string $mapUrl = null,
19 19
         public readonly int | null $zoom = null
20 20
     ) {
Please login to merge, or discard this patch.
src/ValueObjects/Transporter/Payload.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -130,10 +130,10 @@
 block discarded – undo
130 130
 
131 131
         $body = null;
132 132
 
133
-        $uri = $baseUri->toString().$this->uri->toString();
133
+        $uri = $baseUri->toString() . $this->uri->toString();
134 134
 
135
-        if (! empty($this->parameters)) {
136
-            $uri .= '?'.http_build_query($this->parameters);
135
+        if (!empty($this->parameters)) {
136
+            $uri .= '?' . http_build_query($this->parameters);
137 137
         }
138 138
         //die($uri);
139 139
         $request = $psr17Factory->createRequest($this->method->value, $uri);
Please login to merge, or discard this patch.
src/Responses/Events/RetrieveResponse.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
      */
50 50
     public static function from(array $attributes, $included = []): self
51 51
     {
52
-        if(empty($included)) {
52
+        if (empty($included)) {
53 53
             $location = LocationsRetrieveResponse::from([
54 54
                 'attributes' => [
55 55
                     'address_text' => null,
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         }
65 65
         else {
66 66
             foreach ($included as $includedData) {
67
-                if($includedData['type'] === 'location' && $includedData['id'] = $attributes['relationships']['location']['data']['id']) {
67
+                if ($includedData['type'] === 'location' && $includedData['id'] = $attributes['relationships']['location']['data']['id']) {
68 68
                     $location = LocationsRetrieveResponse::from($includedData);
69 69
                 }
70 70
             }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,8 +61,7 @@
 block discarded – undo
61 61
                 ],
62 62
                 'id' => $attributes['relationships']['location']['data']['id']
63 63
             ]);
64
-        }
65
-        else {
64
+        } else {
66 65
             foreach ($included as $includedData) {
67 66
                 if($includedData['type'] === 'location' && $includedData['id'] = $attributes['relationships']['location']['data']['id']) {
68 67
                     $location = LocationsRetrieveResponse::from($includedData);
Please login to merge, or discard this patch.