Drop $GLOBALS['unparsed_sql']
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
This commit is contained in:
parent
a0c6b569f0
commit
cfa9beaa7f
@ -8282,12 +8282,12 @@ parameters:
|
||||
|
||||
-
|
||||
message: "#^Cannot cast mixed to string\\.$#"
|
||||
count: 3
|
||||
count: 2
|
||||
path: src/Html/Generator.php
|
||||
|
||||
-
|
||||
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
|
||||
count: 15
|
||||
count: 14
|
||||
path: src/Html/Generator.php
|
||||
|
||||
-
|
||||
|
||||
@ -6554,7 +6554,6 @@
|
||||
<RedundantCast>
|
||||
<code><![CDATA[(string) $GLOBALS['display_query']]]></code>
|
||||
<code><![CDATA[(string) $GLOBALS['sql_query']]]></code>
|
||||
<code><![CDATA[(string) $GLOBALS['unparsed_sql']]]></code>
|
||||
</RedundantCast>
|
||||
<RiskyCast>
|
||||
<code><![CDATA[$_REQUEST['pos']]]></code>
|
||||
@ -6566,7 +6565,6 @@
|
||||
<code><![CDATA[empty($GLOBALS['show_as_php'])]]></code>
|
||||
<code><![CDATA[empty($GLOBALS['show_as_php'])]]></code>
|
||||
<code><![CDATA[empty($GLOBALS['show_as_php'])]]></code>
|
||||
<code><![CDATA[empty($GLOBALS['unparsed_sql'])]]></code>
|
||||
<code><![CDATA[empty($server['ssl_ca'])]]></code>
|
||||
</RiskyTruthyFalsyComparison>
|
||||
</file>
|
||||
|
||||
@ -111,7 +111,6 @@
|
||||
tbl_storage_engine: string,
|
||||
token_mismatch: bool,
|
||||
token_provided: bool,
|
||||
unparsed_sql?: string,
|
||||
urlParams: array,
|
||||
username: string,
|
||||
xml_export_triggers: bool,
|
||||
|
||||
@ -408,8 +408,6 @@ class Generator
|
||||
if ($sqlQuery === null) {
|
||||
if (! empty($GLOBALS['display_query'])) {
|
||||
$sqlQuery = (string) $GLOBALS['display_query'];
|
||||
} elseif (! empty($GLOBALS['unparsed_sql'])) {
|
||||
$sqlQuery = (string) $GLOBALS['unparsed_sql'];
|
||||
} elseif (! empty($GLOBALS['sql_query'])) {
|
||||
$sqlQuery = (string) $GLOBALS['sql_query'];
|
||||
} else {
|
||||
|
||||
@ -26,9 +26,6 @@ class ParseAnalyze
|
||||
*/
|
||||
public static function sqlQuery(string $sqlQuery, string $db): array
|
||||
{
|
||||
// @todo: move to returned results (also in all the calling chain)
|
||||
$GLOBALS['unparsed_sql'] = $sqlQuery;
|
||||
|
||||
$info = Query::getAll($sqlQuery);
|
||||
|
||||
$table = '';
|
||||
|
||||
@ -476,7 +476,6 @@ class GeneratorTest extends AbstractTestCase
|
||||
{
|
||||
Config::getInstance()->settings['ShowSQL'] = true;
|
||||
$GLOBALS['display_query'] = null;
|
||||
$GLOBALS['unparsed_sql'] = null;
|
||||
$GLOBALS['sql_query'] = 'SELECT 1;';
|
||||
$usingBookmarkMessage = Message::notice('Bookmark message');
|
||||
$GLOBALS['using_bookmark_message'] = $usingBookmarkMessage;
|
||||
@ -533,7 +532,6 @@ HTML;
|
||||
$config->settings['SQLQuery']['Edit'] = false;
|
||||
$config->settings['SQLQuery']['Refresh'] = true;
|
||||
$GLOBALS['display_query'] = 'EXPLAIN SELECT 1;';
|
||||
$GLOBALS['unparsed_sql'] = null;
|
||||
$GLOBALS['sql_query'] = null;
|
||||
DatabaseInterface::$instance = $this->createDatabaseInterface();
|
||||
Current::$database = 'test_db';
|
||||
|
||||
@ -24,12 +24,8 @@ class ParseAnalyzeTest extends AbstractTestCase
|
||||
$GLOBALS['lang'] = 'en';
|
||||
ResponseRenderer::getInstance()->setAjax(false);
|
||||
|
||||
$GLOBALS['unparsed_sql'] = '';
|
||||
|
||||
$actual = ParseAnalyze::sqlQuery('SELECT * FROM `sakila`.`actor`', 'sakila_test');
|
||||
|
||||
/** @psalm-suppress TypeDoesNotContainType */
|
||||
self::assertSame('SELECT * FROM `sakila`.`actor`', $GLOBALS['unparsed_sql']);
|
||||
self::assertSame('sakila', $actual[1]);
|
||||
self::assertSame('actor', $actual[2]);
|
||||
self::assertTrue($actual[0]->flags->reload);
|
||||
@ -44,12 +40,8 @@ class ParseAnalyzeTest extends AbstractTestCase
|
||||
$GLOBALS['lang'] = 'en';
|
||||
ResponseRenderer::getInstance()->setAjax(false);
|
||||
|
||||
$GLOBALS['unparsed_sql'] = '';
|
||||
|
||||
$actual = ParseAnalyze::sqlQuery('SELECT `first_name`, `title` FROM `actor`, `film`', 'sakila');
|
||||
|
||||
/** @psalm-suppress TypeDoesNotContainType */
|
||||
self::assertSame('SELECT `first_name`, `title` FROM `actor`, `film`', $GLOBALS['unparsed_sql']);
|
||||
self::assertSame('sakila', $actual[1]);
|
||||
self::assertSame('', $actual[2]);
|
||||
self::assertFalse($actual[0]->flags->reload);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user