Skip to content

Commit da494f7

Browse files
committed
Remove class Tokens
It was not used anywhere in PMA project. It's very likely broken. It has serious feature envy on TokensList. The two methods had very unclear purpose and behaviour. Signed-off-by: Kamil Tekiela <[email protected]>
1 parent 49e122f commit da494f7

File tree

5 files changed

+0
-332
lines changed

5 files changed

+0
-332
lines changed

phpstan-baseline.neon

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -810,26 +810,6 @@ parameters:
810810
count: 2
811811
path: src/Utils/Table.php
812812

813-
-
814-
message: "#^Binary operation \"&\" between int\\|string and int results in an error\\.$#"
815-
count: 1
816-
path: src/Utils/Tokens.php
817-
818-
-
819-
message: "#^Cannot cast mixed to string\\.$#"
820-
count: 1
821-
path: src/Utils/Tokens.php
822-
823-
-
824-
message: "#^Parameter \\#1 \\$string1 of function strcasecmp expects string, int\\|string given\\.$#"
825-
count: 1
826-
path: src/Utils/Tokens.php
827-
828-
-
829-
message: "#^Parameter \\#2 \\$pattern of static method PhpMyAdmin\\\\SqlParser\\\\Utils\\\\Tokens\\:\\:match\\(\\) expects array\\<string, int\\|string\\|null\\>, PhpMyAdmin\\\\SqlParser\\\\Token given\\.$#"
830-
count: 1
831-
path: src/Utils/Tokens.php
832-
833813
-
834814
message: "#^Cannot call method __toString\\(\\) on PhpMyAdmin\\\\SqlParser\\\\Components\\\\Expression\\|null\\.$#"
835815
count: 2
@@ -940,11 +920,6 @@ parameters:
940920
count: 1
941921
path: tests/Utils/TableTest.php
942922

943-
-
944-
message: "#^Parameter \\#2 \\$find of static method PhpMyAdmin\\\\SqlParser\\\\Utils\\\\Tokens\\:\\:replaceTokens\\(\\) expects array\\<PhpMyAdmin\\\\SqlParser\\\\Token\\>, array\\<array\\<string, string\\>\\> given\\.$#"
945-
count: 1
946-
path: tests/Utils/TokensTest.php
947-
948923
-
949924
message: "#^Expression \"\\$str1\\[\\$i\\]\" on a separate line does not do anything\\.$#"
950925
count: 1

psalm-baseline.xml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,17 +1320,6 @@
13201320
<code>has</code>
13211321
</PossiblyNullReference>
13221322
</file>
1323-
<file src="src/Utils/Tokens.php">
1324-
<InvalidArgument>
1325-
<code>$find[$k]</code>
1326-
</InvalidArgument>
1327-
<PossiblyInvalidArgument>
1328-
<code><![CDATA[$pattern['value_str']]]></code>
1329-
</PossiblyInvalidArgument>
1330-
<PossiblyInvalidOperand>
1331-
<code><![CDATA[$pattern['flags']]]></code>
1332-
</PossiblyInvalidOperand>
1333-
</file>
13341323
<file src="tests/Builder/AlterStatementTest.php">
13351324
<PossiblyUnusedMethod>
13361325
<code>provideBuilderForRenameColumn</code>
@@ -1769,15 +1758,6 @@
17691758
<code>getForeignKeysProvider</code>
17701759
</PossiblyUnusedMethod>
17711760
</file>
1772-
<file src="tests/Utils/TokensTest.php">
1773-
<InvalidArgument>
1774-
<code>$find</code>
1775-
</InvalidArgument>
1776-
<PossiblyUnusedMethod>
1777-
<code>matchProvider</code>
1778-
<code>replaceTokensProvider</code>
1779-
</PossiblyUnusedMethod>
1780-
</file>
17811761
<file src="tests/benchmarks/UtfStringBench.php">
17821762
<MissingConstructor>
17831763
<code>$testContents</code>

src/Lexer.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -144,21 +144,6 @@ class Lexer extends Core
144144
*/
145145
public $delimiterLen;
146146

147-
/**
148-
* Gets the tokens list parsed by a new instance of a lexer.
149-
*
150-
* @param string|UtfString $str the query to be lexed
151-
* @param bool $strict whether strict mode should be
152-
* enabled or not
153-
* @param string $delimiter the delimiter to be used
154-
*/
155-
public static function getTokens($str, $strict = false, $delimiter = null): TokensList
156-
{
157-
$lexer = new self($str, $strict, $delimiter);
158-
159-
return $lexer->list;
160-
}
161-
162147
/**
163148
* @param string|UtfString $str the query to be lexed
164149
* @param bool $strict whether strict mode should be

src/Utils/Tokens.php

Lines changed: 0 additions & 151 deletions
This file was deleted.

tests/Utils/TokensTest.php

Lines changed: 0 additions & 121 deletions
This file was deleted.

0 commit comments

Comments
 (0)