Skip to content

Commit

Permalink
chore: replace scalar with more precise type specification (#369)
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Kesselberg <[email protected]>
  • Loading branch information
kesselb authored Oct 22, 2023
1 parent 87b8b85 commit 8775776
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
14 changes: 12 additions & 2 deletions src/Warning/QuotedPart.php
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
}
4 changes: 2 additions & 2 deletions src/Warning/QuotedString.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 8775776

Please sign in to comment.