@@ -30,7 +30,7 @@ |
||
| 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, |
@@ -22,7 +22,7 @@ |
||
| 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. |
@@ -39,7 +39,7 @@ |
||
| 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 | |
@@ -117,7 +117,7 @@ discard block |
||
| 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 |
||
| 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 | } |
@@ -53,7 +53,6 @@ discard block |
||
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | /** |
| 56 | - |
|
| 57 | 56 | */ |
| 58 | 57 | public function classPasses(): ClassPasses |
| 59 | 58 | { |
@@ -66,16 +65,14 @@ discard block |
||
| 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); |
@@ -75,17 +75,15 @@ discard block |
||
| 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 |
||
| 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(); |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | if (!$this->validator->validInclude($includeAttachments)) { |
| 258 | 258 | throw new ValidationException('includeAttachments', $includeAttachments); |
| 259 | 259 | } else { |
| 260 | - if($includeAttachments) { |
|
| 260 | + if ($includeAttachments) { |
|
| 261 | 261 | array_push($this->includes, 'attachments'); |
| 262 | 262 | } |
| 263 | 263 | } |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | if (!$this->validator->validInclude($includeLocation)) { |
| 267 | 267 | throw new ValidationException('includeLocation', $includeLocation); |
| 268 | 268 | } else { |
| 269 | - if($includeLocation) { |
|
| 269 | + if ($includeLocation) { |
|
| 270 | 270 | array_push($this->includes, 'location'); |
| 271 | 271 | } |
| 272 | 272 | } |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | if (!$this->validator->validInclude($includeTickets)) { |
| 276 | 276 | throw new ValidationException('includeTickets', $includeTickets); |
| 277 | 277 | } else { |
| 278 | - if($includeTickets) { |
|
| 278 | + if ($includeTickets) { |
|
| 279 | 279 | array_push($this->includes, 'tickets'); |
| 280 | 280 | } |
| 281 | 281 | } |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | if (!$this->validator->validInclude($includeTicketsEvents)) { |
| 285 | 285 | throw new ValidationException('includeTicketsEvents', $includeTicketsEvents); |
| 286 | 286 | } else { |
| 287 | - if($includeTicketsEvents) { |
|
| 287 | + if ($includeTicketsEvents) { |
|
| 288 | 288 | array_push($this->includes, 'tickets.events'); |
| 289 | 289 | } |
| 290 | 290 | } |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | if (!$this->validator->validInclude($includeTicketsClassPasses)) { |
| 294 | 294 | throw new ValidationException('includeTicketsClassPasses', $includeTicketsClassPasses); |
| 295 | 295 | } else { |
| 296 | - if($includeTicketsClassPasses) { |
|
| 296 | + if ($includeTicketsClassPasses) { |
|
| 297 | 297 | array_push($this->includes, 'tickets.class_passes'); |
| 298 | 298 | } |
| 299 | 299 | } |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | $eventAttachments = []; // deprecated |
| 304 | 304 | |
| 305 | 305 | // attachments |
| 306 | - if($includeAttachments) { |
|
| 306 | + if ($includeAttachments) { |
|
| 307 | 307 | // foreach ($event->attachments as $eventAttachment) { |
| 308 | 308 | // $attachment = $this->client->attachments()->retrieve($eventAttachment['id']); |
| 309 | 309 | // array_push($eventAttachments, new Attachment( |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | |
| 321 | 321 | // eventTickets |
| 322 | 322 | $eventTickets = []; |
| 323 | - foreach($event->tickets as $ticket) { |
|
| 323 | + foreach ($event->tickets as $ticket) { |
|
| 324 | 324 | array_push($eventTickets, new Ticket( |
| 325 | 325 | $ticket->available, |
| 326 | 326 | $ticket->availableFrom, |
@@ -402,7 +402,7 @@ discard block |
||
| 402 | 402 | throw new ValidationException('detail', implode(' ', $detail)); |
| 403 | 403 | } else { |
| 404 | 404 | $detail = array_unique($detail); |
| 405 | - foreach($detail as $item) { |
|
| 405 | + foreach ($detail as $item) { |
|
| 406 | 406 | if (!$this->validator->validLocation($item)) { |
| 407 | 407 | throw new ValidationException('detail', $item); |
| 408 | 408 | } |
@@ -429,7 +429,7 @@ discard block |
||
| 429 | 429 | throw new ValidationException('location', implode(' ', $title)); |
| 430 | 430 | } else { |
| 431 | 431 | $location = array_unique($location); |
| 432 | - foreach($location as $item) { |
|
| 432 | + foreach ($location as $item) { |
|
| 433 | 433 | if (!$this->validator->validLocation($item)) { |
| 434 | 434 | throw new ValidationException('location', $item); |
| 435 | 435 | } |
@@ -459,7 +459,7 @@ discard block |
||
| 459 | 459 | throw new ValidationException('title', implode(' ', $title)); |
| 460 | 460 | } else { |
| 461 | 461 | $title = array_unique($title); |
| 462 | - foreach($title as $item) { |
|
| 462 | + foreach ($title as $item) { |
|
| 463 | 463 | if (!$this->validator->validTitle($item)) { |
| 464 | 464 | throw new ValidationException('title', $item); |
| 465 | 465 | } |
@@ -481,7 +481,7 @@ discard block |
||
| 481 | 481 | if (!$this->validator->validInclude($includeAttachments)) { |
| 482 | 482 | throw new ValidationException('includeAttachments', $includeAttachments); |
| 483 | 483 | } else { |
| 484 | - if($includeAttachments) { |
|
| 484 | + if ($includeAttachments) { |
|
| 485 | 485 | array_push($this->includes, 'attachments'); |
| 486 | 486 | } |
| 487 | 487 | } |
@@ -490,7 +490,7 @@ discard block |
||
| 490 | 490 | if (!$this->validator->validInclude($includeLocation)) { |
| 491 | 491 | throw new ValidationException('includeLocation', $includeLocation); |
| 492 | 492 | } else { |
| 493 | - if($includeLocation) { |
|
| 493 | + if ($includeLocation) { |
|
| 494 | 494 | array_push($this->includes, 'location'); |
| 495 | 495 | } |
| 496 | 496 | } |
@@ -499,7 +499,7 @@ discard block |
||
| 499 | 499 | if (!$this->validator->validInclude($includeTickets)) { |
| 500 | 500 | throw new ValidationException('includeTickets', $includeTickets); |
| 501 | 501 | } else { |
| 502 | - if($includeTickets) { |
|
| 502 | + if ($includeTickets) { |
|
| 503 | 503 | array_push($this->includes, 'tickets'); |
| 504 | 504 | } |
| 505 | 505 | } |
@@ -508,7 +508,7 @@ discard block |
||
| 508 | 508 | if (!$this->validator->validInclude($includeTicketsEvents)) { |
| 509 | 509 | throw new ValidationException('includeTicketsEvents', $includeTicketsEvents); |
| 510 | 510 | } else { |
| 511 | - if($includeTicketsEvents) { |
|
| 511 | + if ($includeTicketsEvents) { |
|
| 512 | 512 | array_push($this->includes, 'tickets.events'); |
| 513 | 513 | } |
| 514 | 514 | } |
@@ -517,7 +517,7 @@ discard block |
||
| 517 | 517 | if (!$this->validator->validInclude($includeTicketsClassPasses)) { |
| 518 | 518 | throw new ValidationException('includeTicketsClassPasses', $includeTicketsClassPasses); |
| 519 | 519 | } else { |
| 520 | - if($includeTicketsClassPasses) { |
|
| 520 | + if ($includeTicketsClassPasses) { |
|
| 521 | 521 | array_push($this->includes, 'tickets.class_passes'); |
| 522 | 522 | } |
| 523 | 523 | } |
@@ -527,7 +527,7 @@ discard block |
||
| 527 | 527 | foreach ($events->data as $event) { |
| 528 | 528 | |
| 529 | 529 | $eventTickets = []; |
| 530 | - foreach($event->tickets as $ticket) { |
|
| 530 | + foreach ($event->tickets as $ticket) { |
|
| 531 | 531 | array_push($eventTickets, new Ticket( |
| 532 | 532 | $ticket->available, |
| 533 | 533 | $ticket->availableFrom, |
@@ -14,7 +14,7 @@ |
||
| 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 | ) { |
@@ -130,10 +130,10 @@ |
||
| 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); |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | public static function from(array $attributes): self |
| 39 | 39 | { |
| 40 | 40 | $included = []; |
| 41 | - if(array_key_exists('included', $attributes)) { |
|
| 41 | + if (array_key_exists('included', $attributes)) { |
|
| 42 | 42 | $included = $attributes['included']; |
| 43 | 43 | } |
| 44 | 44 | |