Skip to content

Commit

Permalink
Fix TypeError: checkdnsrr(): Argument #1 ($hostname) must be of type …
Browse files Browse the repository at this point in the history
…string, null given (#55)
  • Loading branch information
blankse authored Aug 26, 2024
1 parent 90893d3 commit 8b1779b
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions src/Tool/Newsletter.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ class Newsletter
protected DataObject\ClassDefinition $class;

/**
*
* @throws Exception
*/
public function __construct(string $classId)
Expand All @@ -62,8 +61,6 @@ public function __construct(string $classId)
}

/**
*
*
* @throws Exception
*/
public static function prepareMail(
Expand Down Expand Up @@ -145,7 +142,6 @@ public static function prepareMail(
}

/**
*
* @throws Exception
*/
public static function sendNewsletterDocumentBasedMail(Mail $mail, SendingParamContainer $sendingContainer): void
Expand Down Expand Up @@ -228,8 +224,6 @@ public function checkParams(array $params): bool
}

/**
*
*
* @throws Exception
*/
public function subscribe(array $params): DataObject\Concrete
Expand Down Expand Up @@ -293,7 +287,6 @@ public function subscribe(array $params): DataObject\Concrete
}

/**
*
* @throws Exception
*/
public function sendConfirmationMail(DataObject\Concrete $object, Email $mailDocument, array $params = []): void
Expand Down Expand Up @@ -353,8 +346,6 @@ public function getObjectByToken(string $token): ?DataObject\Concrete
}

/**
*
*
* @throws Exception
*/
public function confirm(string $token): bool
Expand All @@ -380,8 +371,6 @@ public function confirm(string $token): bool
}

/**
*
*
* @throws Exception
*/
public function unsubscribeByToken(string $token): bool
Expand All @@ -396,8 +385,6 @@ public function unsubscribeByToken(string $token): bool
}

/**
*
*
* @throws Exception
*/
public function unsubscribeByEmail(string $email): bool
Expand All @@ -416,8 +403,6 @@ public function unsubscribeByEmail(string $email): bool
}

/**
*
*
* @throws Exception
*/
public function unsubscribe(DataObject\Concrete $object): bool
Expand Down Expand Up @@ -452,8 +437,6 @@ public function addNoteOnObject(DataObject\Concrete $object, string $title): voi
/**
* Checks if e-mail address already
* exists in the database.
*
*
*/
public function isEmailExists(array $params): bool
{
Expand All @@ -478,11 +461,13 @@ public function getClass(): DataObject\ClassDefinition

/**
* Checks if domain of email has a MX record
*
*
*/
public static function to_domain_exists(string $email): bool
{
if (!str_contains($email, '@')) {
return false;
}

[, $domain] = explode('@', $email);

return checkdnsrr($domain, 'MX');
Expand Down

0 comments on commit 8b1779b

Please sign in to comment.