Skip to content

Commit 5f7535e

Browse files
committed
Don't assign null to $delimiter
Signed-off-by: Kamil Tekiela <[email protected]>
1 parent fe06c29 commit 5f7535e

File tree

3 files changed

+2
-11
lines changed

3 files changed

+2
-11
lines changed

phpstan-baseline.neon

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -385,11 +385,6 @@ parameters:
385385
count: 3
386386
path: src/Lexer.php
387387

388-
-
389-
message: "#^Property PhpMyAdmin\\\\SqlParser\\\\Lexer\\:\\:\\$delimiter \\(string\\) does not accept null\\.$#"
390-
count: 1
391-
path: src/Lexer.php
392-
393388
-
394389
message: "#^Strict comparison using \\=\\=\\= between non\\-empty\\-array\\<non\\-empty\\-string, int\\> and array\\{\\} will always evaluate to false\\.$#"
395390
count: 1

psalm-baseline.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,6 @@
590590
<code>$token</code>
591591
</PossiblyNullArgument>
592592
<PossiblyNullOperand>
593-
<code><![CDATA[$this->delimiter]]></code>
594593
<code><![CDATA[$this->str[$this->last++]]]></code>
595594
<code><![CDATA[$this->str[$this->last++]]]></code>
596595
<code><![CDATA[$this->str[$this->last]]]></code>
@@ -616,9 +615,6 @@
616615
<code><![CDATA[$this->str[++$this->last]]]></code>
617616
<code><![CDATA[$this->str[++$this->last]]]></code>
618617
</PossiblyNullOperand>
619-
<PossiblyNullPropertyAssignmentValue>
620-
<code>null</code>
621-
</PossiblyNullPropertyAssignmentValue>
622618
<PossiblyNullPropertyFetch>
623619
<code><![CDATA[$next->type]]></code>
624620
<code><![CDATA[$next->value]]></code>

src/Lexer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ public function lex(): void
239239
$pos = $this->last + 1;
240240

241241
// Parsing the delimiter.
242-
$this->delimiter = null;
242+
$this->delimiter = '';
243243
$delimiterLen = 0;
244244
while (
245245
++$this->last < $this->len
@@ -250,7 +250,7 @@ public function lex(): void
250250
++$delimiterLen;
251251
}
252252

253-
if (empty($this->delimiter)) {
253+
if ($this->delimiter === '') {
254254
$this->error('Expected delimiter.', '', $this->last);
255255
$this->delimiter = ';';
256256
}

0 commit comments

Comments
 (0)