chore: replace scalar with more precise type specification (#369)

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
This commit is contained in:
Daniel
2023-10-22 23:56:40 +02:00
committed by GitHub
parent 87b8b8506e
commit 8775776563
2 changed files with 14 additions and 4 deletions
+12 -2
View File
@@ -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";
}
}
+2 -2
View File
@@ -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)
{