Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed PHP 8.4 deprecations #926

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Api/Domain.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ public function show(string $domain, array $requestHeaders = [])
*/
public function create(
string $domain,
string $smtpPass = null,
string $spamAction = null,
bool $wildcard = null,
bool $forceDkimAuthority = null,
?string $smtpPass = null,
?string $spamAction = null,
?bool $wildcard = null,
?bool $forceDkimAuthority = null,
?array $ips = null,
?string $pool_id = null,
string $webScheme = 'http',
Expand Down
4 changes: 2 additions & 2 deletions src/Api/DomainV4.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ public function show(string $domain, array $requestHeaders = [])
*/
public function create(
string $domain,
string $smtpPass = null,
string $spamAction = null,
?string $smtpPass = null,
?string $spamAction = null,
?bool $wildcard = null,
?bool $forceDkimAuthority = null,
?array $ips = null,
Expand Down
4 changes: 2 additions & 2 deletions src/Api/MailingList/Member.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Member extends HttpApi
* @return IndexResponse
* @throws ClientExceptionInterface
*/
public function index(string $address, int $limit = 100, bool $subscribed = null, array $requestHeaders = [])
public function index(string $address, int $limit = 100, ?bool $subscribed = null, array $requestHeaders = [])
{
Assert::stringNotEmpty($address);
Assert::greaterThan($limit, 0);
Expand Down Expand Up @@ -92,7 +92,7 @@ public function show(string $list, string $address, array $requestHeaders = [])
public function create(
string $list,
string $address,
string $name = null,
?string $name = null,
array $vars = [],
bool $subscribed = true,
bool $upsert = false,
Expand Down
6 changes: 3 additions & 3 deletions src/Api/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ public function create(string $expression, array $actions, string $description,
*/
public function update(
string $routeId,
string $expression = null,
?string $expression = null,
array $actions = [],
string $description = null,
int $priority = null,
?string $description = null,
?int $priority = null,
array $requestHeaders = []
) {
Assert::stringNotEmpty($routeId);
Expand Down
2 changes: 1 addition & 1 deletion src/Api/Suppression/Complaint.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function show(string $domain, string $address, array $requestHeaders = []
* @return CreateResponse
* @throws ClientExceptionInterface
*/
public function create(string $domain, string $address, string $createdAt = null, array $requestHeaders = [])
public function create(string $domain, string $address, ?string $createdAt = null, array $requestHeaders = [])
{
Assert::stringNotEmpty($domain);
Assert::stringNotEmpty($address);
Expand Down
2 changes: 1 addition & 1 deletion src/Api/Suppression/Unsubscribe.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function create(string $domain, string $address, array $params = [], arra
* @return DeleteResponse
* @throws ClientExceptionInterface
*/
public function delete(string $domain, string $address, string $tag = null, array $requestHeaders = [])
public function delete(string $domain, string $address, ?string $tag = null, array $requestHeaders = [])
{
Assert::stringNotEmpty($domain);
Assert::stringNotEmpty($address);
Expand Down
4 changes: 2 additions & 2 deletions src/Mailgun.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ class Mailgun
*/
public function __construct(
HttpClientConfigurator $configurator,
Hydrator $hydrator = null,
RequestBuilder $requestBuilder = null
?Hydrator $hydrator = null,
?RequestBuilder $requestBuilder = null
) {
$this->requestBuilder = $requestBuilder ?: new RequestBuilder();
$this->hydrator = $hydrator ?: new ModelHydrator();
Expand Down
2 changes: 1 addition & 1 deletion src/Message/Exceptions/MissingRequiredParameter.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class MissingRequiredParameter extends \Exception implements Exception
* @param string|null $message
* @return self
*/
public static function create(string $parameter, string $message = null)
public static function create(string $parameter, ?string $message = null)
{
if (null === $message) {
$message = 'The parameters passed to the API were invalid. Please specify "%s".';
Expand Down
8 changes: 4 additions & 4 deletions src/Message/MessageBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ public function setHtmlBody(string $htmlBody): self
* @param string|null $attachmentName
* @return $this
*/
public function addAttachment(string $attachmentPath, string $attachmentName = null): self
public function addAttachment(string $attachmentPath, ?string $attachmentName = null): self
{
if (!isset($this->message['attachment'])) {
$this->message['attachment'] = [];
Expand All @@ -337,7 +337,7 @@ public function addAttachment(string $attachmentPath, string $attachmentName = n
* @param string|null $attachmentName
* @return $this
*/
public function addStringAttachment(string $attachmentContent, string $attachmentName = null): self
public function addStringAttachment(string $attachmentContent, ?string $attachmentName = null): self
{
if (!isset($this->message['attachment'])) {
$this->message['attachment'] = [];
Expand All @@ -356,7 +356,7 @@ public function addStringAttachment(string $attachmentContent, string $attachmen
* @param string|null $inlineImageName
* @return $this
*/
public function addInlineImage(string $inlineImagePath, string $inlineImageName = null): self
public function addInlineImage(string $inlineImagePath, ?string $inlineImageName = null): self
{
if (!isset($this->message['inline'])) {
$this->message['inline'] = [];
Expand Down Expand Up @@ -466,7 +466,7 @@ public function setClickTracking(bool $enabled, bool $htmlOnly = false): self
* @return $this
* @throws \Exception
*/
public function setDeliveryTime(string $timeDate, string $timeZone = null): self
public function setDeliveryTime(string $timeDate, ?string $timeZone = null): self
{
if (null !== $timeZone) {
$timeZoneObj = new DateTimeZone($timeZone);
Expand Down
Loading