Add native parameter types to Token constructor #526
Add native parameter types to Token constructor #526MauricioFauth merged 2 commits intophpmyadmin:masterfrom
Conversation
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
Ensures that token are always a string and that flags are always an integer. Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #526 +/- ##
=========================================
Coverage 96.45% 96.45%
Complexity 2152 2152
=========================================
Files 64 64
Lines 5019 5019
=========================================
Hits 4841 4841
Misses 178 178 ☔ View full report in Codecov by Sentry. |
|
@kamil-tekiela What do you think? |
|
On line 256 in Lexer you still assign |
| || ! in_array($next->value, self::OPERATOR_NAME_INDICATORS, true) | ||
| ) | ||
| && ($next->value !== null) | ||
| && ($next->value !== '') |
There was a problem hiding this comment.
I hope that this ok, but I feel like the phpdoc should be updated.
There was a problem hiding this comment.
Token::$value type should definitely be updated. That value is only created by Lexer line 285.
Lines 284 to 285 in 94f2db2
Lexer::$delimiter should only be string. But this is not an issue because it gets coerced to string right after. |
Ensures that
tokenare always a string and thatflagsare always an integer.Using an empty string for the last delimiter has the same effect as using
null.