Skip to content

Commit

Permalink
Merge pull request #534 from kamil-tekiela/types-in-Token
Browse files Browse the repository at this point in the history
Add native property types in Token
  • Loading branch information
MauricioFauth committed Jan 16, 2024
2 parents 31bf535 + 26d1c5f commit 69db6d8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 23 deletions.
16 changes: 2 additions & 14 deletions psalm-baseline.xml
Expand Up @@ -178,10 +178,6 @@
<PossiblyInvalidPropertyFetch>
<code><![CDATA[ArrayObj::parse($parser, $list)->values]]></code>
</PossiblyInvalidPropertyFetch>
<PossiblyNullArgument>
<code><![CDATA[$token->keyword]]></code>
<code><![CDATA[$token->keyword]]></code>
</PossiblyNullArgument>
<PossiblyNullOperand>
<code><![CDATA[$this->dest]]></code>
</PossiblyNullOperand>
Expand Down Expand Up @@ -431,9 +427,9 @@
<PossiblyNullPropertyAssignmentValue>
<code><![CDATA[$tmp->expr]]></code>
</PossiblyNullPropertyAssignmentValue>
<RedundantConditionGivenDocblockType>
<RedundantCondition>
<code><![CDATA[$token->value === ',']]></code>
</RedundantConditionGivenDocblockType>
</RedundantCondition>
</file>
<file src="src/Components/UnionKeyword.php">
<PossiblyUnusedMethod>
Expand Down Expand Up @@ -630,7 +626,6 @@
</MixedArrayOffset>
<PossiblyNullArrayOffset>
<code><![CDATA[$list->tokens]]></code>
<code>self::STATEMENT_PARSERS</code>
</PossiblyNullArrayOffset>
<PossiblyNullOperand>
<code><![CDATA[$list->idx]]></code>
Expand Down Expand Up @@ -783,9 +778,6 @@
<code><![CDATA[$fromExpr->column]]></code>
<code><![CDATA[$fromExpr->table]]></code>
</MixedPropertyFetch>
<PossiblyNullArgument>
<code><![CDATA[$token->keyword]]></code>
</PossiblyNullArgument>
<PossiblyNullIterator>
<code><![CDATA[$this->from]]></code>
</PossiblyNullIterator>
Expand Down Expand Up @@ -1095,10 +1087,6 @@
<code><![CDATA[$clauses[$token->keyword]]]></code>
<code><![CDATA[$clauses[$token->keyword]]]></code>
</MixedArrayOffset>
<MixedArrayTypeCoercion>
<code><![CDATA[$clauses[$token->keyword]]]></code>
<code><![CDATA[$clauses[$token->keyword]]]></code>
</MixedArrayTypeCoercion>
<MixedAssignment>
<code>$expr</code>
<code>$expressions[]</code>
Expand Down
12 changes: 3 additions & 9 deletions src/Token.php
Expand Up @@ -69,17 +69,13 @@ class Token

/**
* The value this token contains (i.e. token after some evaluation).
*
* @var mixed
*/
public $value;
public mixed $value;

/**
* The keyword value this token contains, always uppercase.
*
* @var mixed|string|null
*/
public $keyword = null;
public mixed $keyword = null;

/**
* The type of this token.
Expand All @@ -96,10 +92,8 @@ class Token
*
* The position is counted in chars, not bytes, so you should
* use mb_* functions to properly handle utf-8 multibyte chars.
*
* @var int|null
*/
public $position;
public int|null $position = null;

/**
* @param string $token the value of the token
Expand Down

0 comments on commit 69db6d8

Please sign in to comment.