diff --git a/src/Conversations/ConversationsEndpoint.php b/src/Conversations/ConversationsEndpoint.php index 8f2640e5..b36ddff6 100644 --- a/src/Conversations/ConversationsEndpoint.php +++ b/src/Conversations/ConversationsEndpoint.php @@ -15,7 +15,7 @@ class ConversationsEndpoint extends Endpoint { - public function get(int $id, ConversationRequest $conversationRequest = null): Conversation + public function get(int $id, ?ConversationRequest $conversationRequest = null): Conversation { $conversationResource = $this->restClient->getResource(Conversation::class, sprintf('/v2/conversations/%d', $id)); @@ -96,8 +96,8 @@ public function updateTags(int $conversationId, $tags): void * @return Conversation[]|PagedCollection */ public function list( - ConversationFilters $conversationFilters = null, - ConversationRequest $conversationRequest = null + ?ConversationFilters $conversationFilters = null, + ?ConversationRequest $conversationRequest = null ): PagedCollection { $uri = '/v2/conversations'; if ($conversationFilters) { diff --git a/src/Conversations/CustomerWaitingSince.php b/src/Conversations/CustomerWaitingSince.php index 1d04c7dc..9500c892 100644 --- a/src/Conversations/CustomerWaitingSince.php +++ b/src/Conversations/CustomerWaitingSince.php @@ -55,7 +55,7 @@ public function extract(): array return $fields; } - public function setTime(DateTime $time = null): self + public function setTime(?DateTime $time = null): self { $this->time = $time; diff --git a/src/Customers/Customer.php b/src/Customers/Customer.php index 30f48ced..63bcb1a2 100644 --- a/src/Customers/Customer.php +++ b/src/Customers/Customer.php @@ -261,7 +261,7 @@ public function getCreatedAt(): ?DateTime return $this->createdAt; } - public function setCreatedAt(DateTime $createdAt = null): Customer + public function setCreatedAt(?DateTime $createdAt = null): Customer { $this->createdAt = $createdAt; @@ -273,7 +273,7 @@ public function getUpdatedAt(): ?DateTime return $this->updatedAt; } - public function setUpdatedAt(DateTime $updatedAt = null): Customer + public function setUpdatedAt(?DateTime $updatedAt = null): Customer { $this->updatedAt = $updatedAt; @@ -432,9 +432,8 @@ public function setChatHandles(Collection $chats): Customer /** * @param ChatHandle|string $chat - * @param string $type */ - public function addChatHandle($chat, string $type = null): Customer + public function addChatHandle($chat, ?string $type = null): Customer { if (is_string($chat)) { $newChatHandle = new ChatHandle(); @@ -480,9 +479,8 @@ public function setEmails(Collection $emails): Customer /** * @param Email|string $email - * @param string $type */ - public function addEmail($email, string $type = null): Customer + public function addEmail($email, ?string $type = null): Customer { if (is_string($email)) { $newEmail = new Email(); @@ -528,9 +526,8 @@ public function setPhones(Collection $phones): Customer /** * @param Phone|string $phone - * @param string $type */ - public function addPhone($phone, string $type = null): Customer + public function addPhone($phone, ?string $type = null): Customer { if (is_string($phone)) { $newPhone = new Phone(); @@ -566,9 +563,8 @@ public function setSocialProfiles(Collection $socialProfiles): Customer /** * @param SocialProfile|string $profile - * @param string $type */ - public function addSocialProfile($profile, string $type = null): Customer + public function addSocialProfile($profile, ?string $type = null): Customer { if (is_string($profile)) { $newProfile = new SocialProfile(); diff --git a/src/Customers/CustomersEndpoint.php b/src/Customers/CustomersEndpoint.php index 3b91b4fb..4212f490 100644 --- a/src/Customers/CustomersEndpoint.php +++ b/src/Customers/CustomersEndpoint.php @@ -34,7 +34,7 @@ public function update(Customer $customer): void ); } - public function get(int $id, CustomerRequest $customerRequest = null): Customer + public function get(int $id, ?CustomerRequest $customerRequest = null): Customer { $customerResource = $this->restClient->getResource( Customer::class, @@ -51,8 +51,8 @@ public function get(int $id, CustomerRequest $customerRequest = null): Customer * @return Customer[]|PagedCollection */ public function list( - CustomerFilters $customerFilters = null, - CustomerRequest $customerRequest = null + ?CustomerFilters $customerFilters = null, + ?CustomerRequest $customerRequest = null ): PagedCollection { $uri = '/v2/customers'; if ($customerFilters) { diff --git a/src/Exception/ValidationErrorException.php b/src/Exception/ValidationErrorException.php index f8dbab78..a82529ba 100644 --- a/src/Exception/ValidationErrorException.php +++ b/src/Exception/ValidationErrorException.php @@ -24,7 +24,7 @@ public function __construct( VndError $error, RequestInterface $request, ResponseInterface $response, - \Exception $previous = null + ?\Exception $previous = null ) { // Append some details on what steps to take to see the underlying validation problems are. $message = $message.' - use getError() to see the underlying validation issues'; diff --git a/src/Http/Authenticator.php b/src/Http/Authenticator.php index 25c491a4..cbad4db7 100644 --- a/src/Http/Authenticator.php +++ b/src/Http/Authenticator.php @@ -49,7 +49,7 @@ class Authenticator */ private $tokenRefreshedCallback; - public function __construct(Client $client, Auth $auth = null) + public function __construct(Client $client, ?Auth $auth = null) { $this->client = $client; $this->auth = $auth ?? new NullCredentials(); diff --git a/src/Http/Hal/VndError.php b/src/Http/Hal/VndError.php index ca90d71b..2b10457f 100644 --- a/src/Http/Hal/VndError.php +++ b/src/Http/Hal/VndError.php @@ -26,7 +26,7 @@ class VndError */ private $errors = []; - public function __construct(string $message, string $logRef = null, string $path = null) + public function __construct(string $message, ?string $logRef = null, ?string $path = null) { $this->message = $message; $this->logRef = $logRef; diff --git a/src/Http/RestClientBuilder.php b/src/Http/RestClientBuilder.php index ce3b7059..aa02d104 100644 --- a/src/Http/RestClientBuilder.php +++ b/src/Http/RestClientBuilder.php @@ -126,8 +126,8 @@ protected function getRetryDecider(): callable return function ( $retries, Request $request, - Response $response = null, - GuzzleException $exception = null + ?Response $response = null, + ?GuzzleException $exception = null ) { // Don't retry unless this is a Connection issue if (!$exception instanceof ConnectException) { diff --git a/src/Mailboxes/Mailbox.php b/src/Mailboxes/Mailbox.php index e9c97b86..b82a1353 100644 --- a/src/Mailboxes/Mailbox.php +++ b/src/Mailboxes/Mailbox.php @@ -99,7 +99,7 @@ public function getCreatedAt() /** * @return Mailbox */ - public function setCreatedAt(DateTime $createdAt = null): self + public function setCreatedAt(?DateTime $createdAt = null): self { $this->createdAt = $createdAt; @@ -117,7 +117,7 @@ public function getUpdatedAt() /** * @return Mailbox */ - public function setUpdatedAt(DateTime $updatedAt = null): self + public function setUpdatedAt(?DateTime $updatedAt = null): self { $this->updatedAt = $updatedAt; diff --git a/src/Mailboxes/MailboxesEndpoint.php b/src/Mailboxes/MailboxesEndpoint.php index dde2a8a9..e3b8d607 100644 --- a/src/Mailboxes/MailboxesEndpoint.php +++ b/src/Mailboxes/MailboxesEndpoint.php @@ -15,7 +15,7 @@ class MailboxesEndpoint extends Endpoint public const LIST_MAILBOXES_URI = '/v2/mailboxes'; public const RESOURCE_KEY = 'mailboxes'; - public function get(int $id, MailboxRequest $mailboxRequest = null): Mailbox + public function get(int $id, ?MailboxRequest $mailboxRequest = null): Mailbox { $mailboxResource = $this->restClient->getResource( Mailbox::class, @@ -30,7 +30,7 @@ public function get(int $id, MailboxRequest $mailboxRequest = null): Mailbox /** * @return Mailbox[]|PagedCollection */ - public function list(MailboxRequest $mailboxRequest = null): PagedCollection + public function list(?MailboxRequest $mailboxRequest = null): PagedCollection { return $this->loadMailboxes( self::LIST_MAILBOXES_URI, diff --git a/src/Teams/Team.php b/src/Teams/Team.php index ab195ecf..aa30c2f2 100644 --- a/src/Teams/Team.php +++ b/src/Teams/Team.php @@ -159,7 +159,7 @@ public function getCreatedAt(): ?DateTime return $this->createdAt; } - public function setCreatedAt(DateTime $createdAt = null): Team + public function setCreatedAt(?DateTime $createdAt = null): Team { $this->createdAt = $createdAt; @@ -171,7 +171,7 @@ public function getUpdatedAt(): ?DateTime return $this->updatedAt; } - public function setUpdatedAt(DateTime $updatedAt = null): Team + public function setUpdatedAt(?DateTime $updatedAt = null): Team { $this->updatedAt = $updatedAt; diff --git a/src/Users/User.php b/src/Users/User.php index 0e7973d0..be95b1a3 100644 --- a/src/Users/User.php +++ b/src/Users/User.php @@ -141,7 +141,7 @@ public function getCreatedAt(): ?DateTime return $this->createdAt; } - public function setCreatedAt(DateTime $createdAt = null): User + public function setCreatedAt(?DateTime $createdAt = null): User { $this->createdAt = $createdAt; @@ -153,7 +153,7 @@ public function getUpdatedAt(): ?DateTime return $this->updatedAt; } - public function setUpdatedAt(DateTime $updatedAt = null): User + public function setUpdatedAt(?DateTime $updatedAt = null): User { $this->updatedAt = $updatedAt; diff --git a/src/Users/UsersEndpoint.php b/src/Users/UsersEndpoint.php index 2ab76aec..12750fa8 100644 --- a/src/Users/UsersEndpoint.php +++ b/src/Users/UsersEndpoint.php @@ -34,7 +34,7 @@ public function getAuthenticatedUser(): User * @return User[]|PagedCollection */ public function list( - UserFilters $userFilters = null + ?UserFilters $userFilters = null ): PagedCollection { $uri = self::LIST_USERS_URI; if ($userFilters) {