mirror of
https://github.com/egulias/EmailValidator.git
synced 2026-08-30 12:07:59 +00:00
chore: replace scalar with more precise type specification (#369)
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
This commit is contained in:
@@ -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";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user