diff --git a/HtmlSanitizer.php b/HtmlSanitizer.php
index fb66892..ddc61c3 100644
--- a/HtmlSanitizer.php
+++ b/HtmlSanitizer.php
@@ -30,7 +30,7 @@ final class HtmlSanitizer implements HtmlSanitizerInterface
*/
private array $domVisitors = [];
- public function __construct(HtmlSanitizerConfig $config, ParserInterface $parser = null)
+ public function __construct(HtmlSanitizerConfig $config, ?ParserInterface $parser = null)
{
$this->config = $config;
$this->parser = $parser ?? new MastermindsParser();
diff --git a/TextSanitizer/UrlSanitizer.php b/TextSanitizer/UrlSanitizer.php
index c4643f7..a806981 100644
--- a/TextSanitizer/UrlSanitizer.php
+++ b/TextSanitizer/UrlSanitizer.php
@@ -29,7 +29,7 @@ final class UrlSanitizer
*
* It also transforms the URL to HTTPS if requested.
*/
- public static function sanitize(?string $input, array $allowedSchemes = null, bool $forceHttps = false, array $allowedHosts = null, bool $allowRelative = false): ?string
+ public static function sanitize(?string $input, ?array $allowedSchemes = null, bool $forceHttps = false, ?array $allowedHosts = null, bool $allowRelative = false): ?string
{
if (!$input) {
return null;