diff --git a/src/Warning/QuotedPart.php b/src/Warning/QuotedPart.php index c3e017d..db0850c 100644 --- a/src/Warning/QuotedPart.php +++ b/src/Warning/QuotedPart.php @@ -2,16 +2,26 @@ namespace Egulias\EmailValidator\Warning; +use UnitEnum; + class QuotedPart extends Warning { public const CODE = 36; /** - * @param scalar|null $prevToken - * @param scalar|null $postToken + * @param UnitEnum|string|int|null $prevToken + * @param UnitEnum|string|int|null $postToken */ public function __construct($prevToken, $postToken) { + if ($prevToken instanceof UnitEnum) { + $prevToken = $prevToken->name; + } + + if ($postToken instanceof UnitEnum) { + $postToken = $postToken->name; + } + $this->message = "Deprecated Quoted String found between $prevToken and $postToken"; } } diff --git a/src/Warning/QuotedString.php b/src/Warning/QuotedString.php index c152ec2..388da0b 100644 --- a/src/Warning/QuotedString.php +++ b/src/Warning/QuotedString.php @@ -7,8 +7,8 @@ class QuotedString extends Warning public const CODE = 11; /** - * @param scalar $prevToken - * @param scalar $postToken + * @param string|int $prevToken + * @param string|int $postToken */ public function __construct($prevToken, $postToken) {