Remove unused method
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
This commit is contained in:
parent
5837fb699f
commit
bdde4ab60b
@ -38,7 +38,6 @@ use function preg_replace;
|
||||
use function rtrim;
|
||||
use function serialize;
|
||||
use function sprintf;
|
||||
use function str_replace;
|
||||
use function strtotime;
|
||||
use function substr;
|
||||
use function trim;
|
||||
@ -90,30 +89,6 @@ class Tracker
|
||||
return $relationParameters->trackingFeature !== null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses the name of a table from a SQL statement substring.
|
||||
*
|
||||
* @param string $string part of SQL statement
|
||||
*
|
||||
* @return string the name of table
|
||||
*/
|
||||
protected static function getTableName(string $string): string
|
||||
{
|
||||
if (mb_strstr($string, '.')) {
|
||||
$temp = explode('.', $string);
|
||||
$tableName = $temp[1];
|
||||
} else {
|
||||
$tableName = $string;
|
||||
}
|
||||
|
||||
$str = explode("\n", $tableName);
|
||||
$tableName = $str[0];
|
||||
|
||||
$tableName = str_replace([';', '`'], '', $tableName);
|
||||
|
||||
return trim($tableName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the tracking status of a table, is it active or disabled ?
|
||||
*
|
||||
|
||||
@ -13652,9 +13652,6 @@
|
||||
<code><![CDATA[$tokens[0]->value]]></code>
|
||||
<code><![CDATA[$tokens[2]->value]]></code>
|
||||
</PossiblyNullPropertyFetch>
|
||||
<PossiblyUnusedMethod>
|
||||
<code>getTableName</code>
|
||||
</PossiblyUnusedMethod>
|
||||
</file>
|
||||
<file src="libraries/classes/Tracking/Tracking.php">
|
||||
<MixedArgument>
|
||||
@ -15536,7 +15533,6 @@
|
||||
<MixedInferredReturnType>
|
||||
<code>mixed[]</code>
|
||||
<code>mixed[]</code>
|
||||
<code>mixed[]</code>
|
||||
</MixedInferredReturnType>
|
||||
<PossiblyUndefinedArrayOffset>
|
||||
<code>$data[0]</code>
|
||||
|
||||
@ -111,32 +111,6 @@ class TrackerTest extends AbstractTestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for Tracker::getTableName()
|
||||
*
|
||||
* @param string $string String to test against
|
||||
* @param string $expected Expected Table Name
|
||||
*
|
||||
* @dataProvider getTableNameData
|
||||
*/
|
||||
public function testGetTableName(string $string, string $expected): void
|
||||
{
|
||||
$this->assertEquals(
|
||||
$expected,
|
||||
$this->callFunction(null, Tracker::class, 'getTableName', [$string]),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Data Provider for testGetTableName
|
||||
*
|
||||
* @return mixed[] Test data
|
||||
*/
|
||||
public static function getTableNameData(): array
|
||||
{
|
||||
return [['`tbl`;', 'tbl'], [' `pma.table` ', 'table'], [" `pma.table\nfoobar` ", 'table']];
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for Tracker::isTracked()
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user