Skip to content

Commit a7eddce

Browse files
committed
Add native property types in Exceptions
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
1 parent 94f2db2 commit a7eddce

2 files changed

Lines changed: 6 additions & 12 deletions

File tree

src/Exceptions/LexerException.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,13 @@ class LexerException extends Exception
1313
{
1414
/**
1515
* The character that produced this error.
16-
*
17-
* @var string
1816
*/
19-
public $ch;
17+
public string $ch;
2018

2119
/**
2220
* The index of the character that produced this error.
23-
*
24-
* @var int
2521
*/
26-
public $pos;
22+
public int $pos;
2723

2824
/**
2925
* @param string $msg the message of this exception

src/Exceptions/ParserException.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,13 @@ class ParserException extends Exception
1414
{
1515
/**
1616
* The token that produced this error.
17-
*
18-
* @var Token
1917
*/
20-
public $token;
18+
public Token|null $token;
2119

2220
/**
23-
* @param string $msg the message of this exception
24-
* @param Token $token the token that produced this exception
25-
* @param int $code the code of this error
21+
* @param string $msg the message of this exception
22+
* @param Token|null $token the token that produced this exception
23+
* @param int $code the code of this error
2624
*/
2725
public function __construct(string $msg = '', Token|null $token = null, int $code = 0)
2826
{

0 commit comments

Comments
 (0)