Add native property types in Lexer #547
Annotations
11 warnings
Infection:
src/Lexer.php#L124
Escaped Mutant for Mutator "InstanceOf_":
--- Original
+++ New
@@ @@
}
// `strlen` is used instead of `mb_strlen` because the lexer needs to
// parse each byte of the input.
- $len = $str instanceof UtfString ? $str->length() : strlen($str);
+ $len = false ? $str->length() : strlen($str);
// For multi-byte strings, a new instance of `UtfString` is initialized.
if (!$str instanceof UtfString && $len !== mb_strlen($str, 'UTF-8')) {
$str = new UtfString($str);
|
Infection:
src/Lexer.php#L127
Escaped Mutant for Mutator "InstanceOf_":
--- Original
+++ New
@@ @@
// parse each byte of the input.
$len = $str instanceof UtfString ? $str->length() : strlen($str);
// For multi-byte strings, a new instance of `UtfString` is initialized.
- if (!$str instanceof UtfString && $len !== mb_strlen($str, 'UTF-8')) {
+ if (!false && $len !== mb_strlen($str, 'UTF-8')) {
$str = new UtfString($str);
}
$this->str = $str;
|
Infection:
src/Lexer.php#L147
Escaped Mutant for Mutator "PublicVisibility":
--- Original
+++ New
@@ @@
*
* @param string $delimiter the new delimiter
*/
- public function setDelimiter(string $delimiter) : void
+ protected function setDelimiter(string $delimiter) : void
{
$this->delimiter = $delimiter;
$this->delimiterLen = strlen($delimiter);
|
Infection:
src/Lexer.php#L156
Escaped Mutant for Mutator "PublicVisibility":
--- Original
+++ New
@@ @@
/**
* Parses the string and extracts lexemes.
*/
- public function lex() : void
+ protected function lex() : void
{
// TODO: Sometimes, static::parse* functions make unnecessary calls to
// is* functions. For a better performance, some rules can be deduced
|
Infection:
src/Lexer.php#L184
Escaped Mutant for Mutator "BitwiseAnd":
--- Original
+++ New
@@ @@
// @Assert($this->last === $lastIdx);
$token = new Token($this->str[$this->last]);
$this->error('Unexpected character.', $this->str[$this->last], $this->last);
- } elseif ($lastToken !== null && $token->type === TokenType::Symbol && $token->flags & Token::FLAG_SYMBOL_VARIABLE && ($lastToken->type === TokenType::String || $lastToken->type === TokenType::Symbol && $lastToken->flags & Token::FLAG_SYMBOL_BACKTICK)) {
+ } elseif ($lastToken !== null && $token->type === TokenType::Symbol && $token->flags | Token::FLAG_SYMBOL_VARIABLE && ($lastToken->type === TokenType::String || $lastToken->type === TokenType::Symbol && $lastToken->flags & Token::FLAG_SYMBOL_BACKTICK)) {
// Handles ```... FROM 'user'@'%' ...```.
$lastToken->token .= $token->token;
$lastToken->type = TokenType::Symbol;
|
Infection:
src/Lexer.php#L189
Escaped Mutant for Mutator "BitwiseAnd":
--- Original
+++ New
@@ @@
// @Assert($this->last === $lastIdx);
$token = new Token($this->str[$this->last]);
$this->error('Unexpected character.', $this->str[$this->last], $this->last);
- } elseif ($lastToken !== null && $token->type === TokenType::Symbol && $token->flags & Token::FLAG_SYMBOL_VARIABLE && ($lastToken->type === TokenType::String || $lastToken->type === TokenType::Symbol && $lastToken->flags & Token::FLAG_SYMBOL_BACKTICK)) {
+ } elseif ($lastToken !== null && $token->type === TokenType::Symbol && $token->flags & Token::FLAG_SYMBOL_VARIABLE && ($lastToken->type === TokenType::String || $lastToken->type === TokenType::Symbol && $lastToken->flags | Token::FLAG_SYMBOL_BACKTICK)) {
// Handles ```... FROM 'user'@'%' ...```.
$lastToken->token .= $token->token;
$lastToken->type = TokenType::Symbol;
|
Infection:
src/Lexer.php#L218
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
$list->tokens[$list->count++] = $token;
// Handling delimiters.
if ($token->type === TokenType::None && $token->value === 'DELIMITER') {
- if ($this->last + 1 >= $this->len) {
+ if ($this->last + 2 >= $this->len) {
$this->error('Expected whitespace(s) before delimiter.', '', $this->last + 1);
continue;
}
|
Infection:
src/Lexer.php#L245
Escaped Mutant for Mutator "LessThan":
--- Original
+++ New
@@ @@
// Parsing the delimiter.
$this->delimiter = '';
$delimiterLen = 0;
- while (++$this->last < $this->len && !Context::isWhitespace($this->str[$this->last]) && $delimiterLen < 15) {
+ while (++$this->last <= $this->len && !Context::isWhitespace($this->str[$this->last]) && $delimiterLen < 15) {
$this->delimiter .= $this->str[$this->last];
++$delimiterLen;
}
|
Infection:
src/Lexer.php#L372
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
*
* @throws LexerException throws the exception, if strict mode is enabled.
*/
- public function error(string $msg, string $str = '', int $pos = 0, int $code = 0) : void
+ public function error(string $msg, string $str = '', int $pos = -1, int $code = 0) : void
{
$error = new LexerException(Translator::gettext($msg), $str, $pos, $code);
if ($this->strict) {
|
Infection:
src/Lexer.php#L372
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
*
* @throws LexerException throws the exception, if strict mode is enabled.
*/
- public function error(string $msg, string $str = '', int $pos = 0, int $code = 0) : void
+ public function error(string $msg, string $str = '', int $pos = 1, int $code = 0) : void
{
$error = new LexerException(Translator::gettext($msg), $str, $pos, $code);
if ($this->strict) {
|
Get Composer cache directory
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
The logs for this run have expired and are no longer available.
Loading