Skip to content

Commit 46520d8

Browse files
Add types to public and protected properties
1 parent 7d09c45 commit 46520d8

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

Expression.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919
class Expression
2020
{
21-
protected $expression;
21+
protected string $expression;
2222

2323
public function __construct(string $expression)
2424
{

Node/Node.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
*/
2121
class Node
2222
{
23-
public $nodes = [];
24-
public $attributes = [];
23+
public array $nodes = [];
24+
public array $attributes = [];
2525

2626
/**
2727
* @param array $nodes An array of nodes

Token.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
*/
1919
class Token
2020
{
21-
public $value;
22-
public $type;
23-
public $cursor;
21+
public string $type;
22+
public string|int|float|null $value;
23+
public ?int $cursor;
2424

2525
public const EOF_TYPE = 'end of expression';
2626
public const NAME_TYPE = 'name';

TokenStream.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919
class TokenStream
2020
{
21-
public $current;
21+
public Token $current;
2222

2323
private array $tokens;
2424
private int $position = 0;

0 commit comments

Comments
 (0)