File tree Expand file tree Collapse file tree
libraries/classes/Tracking Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55namespace PhpMyAdmin \Tracking ;
66
7+ use PhpMyAdmin \Dbal \TableName ;
8+
79final class TrackedTable
810{
9- public function __construct (public readonly string $ name , public readonly bool $ active )
11+ public function __construct (public readonly TableName $ name , public readonly bool $ active )
1012 {
1113 }
1214}
Original file line number Diff line number Diff line change 99use PhpMyAdmin \ConfigStorage \Relation ;
1010use PhpMyAdmin \DatabaseInterface ;
1111use PhpMyAdmin \Dbal \Connection ;
12+ use PhpMyAdmin \Dbal \TableName ;
1213use PhpMyAdmin \Util ;
1314
1415use function array_column ;
@@ -31,7 +32,7 @@ public function __construct(
3132 * Get a list of untracked tables.
3233 * Deactivated tracked tables are not included in the list.
3334 *
34- * @return array<int, string>
35+ * @return array<int, string|TableName >
3536 */
3637 public function getUntrackedTableNames (string $ dbName ): array
3738 {
@@ -75,8 +76,8 @@ public function getTrackedTables(string $dbName): array
7576
7677 $ trackedTables = [];
7778 foreach ($ this ->dbi ->queryAsControlUser ($ sqlQuery ) as $ row ) {
78- $ trackedTable = new TrackedTable (( string ) $ row ['table_name ' ], (bool ) $ row ['tracking_active ' ]);
79- $ trackedTables [$ trackedTable ->name ] = $ trackedTable ;
79+ $ trackedTable = new TrackedTable (TableName:: fromValue ( $ row ['table_name ' ]) , (bool ) $ row ['tracking_active ' ]);
80+ $ trackedTables [$ trackedTable ->name -> getName () ] = $ trackedTable ;
8081 }
8182
8283 return $ trackedTables ;
Original file line number Diff line number Diff line change 77use PhpMyAdmin \Cache ;
88use PhpMyAdmin \ConfigStorage \Relation ;
99use PhpMyAdmin \ConfigStorage \RelationParameters ;
10+ use PhpMyAdmin \Dbal \TableName ;
1011use PhpMyAdmin \Tests \AbstractTestCase ;
1112use PhpMyAdmin \Tracking \TrackedTable ;
1213use PhpMyAdmin \Tracking \Tracker ;
@@ -51,8 +52,8 @@ public function testGetTrackedTables(): void
5152 Tracker::enable ();
5253
5354 $ expectation = [
54- 0 => new TrackedTable ('0 ' , true ),
55- 'actor ' => new TrackedTable ('actor ' , false ),
55+ 0 => new TrackedTable (TableName:: fromValue ( '0 ' ) , true ),
56+ 'actor ' => new TrackedTable (TableName:: fromValue ( 'actor ' ) , false ),
5657 ];
5758
5859 $ actual = $ this ->trackingChecker ->getTrackedTables ('dummyDb ' );
You can’t perform that action at this time.
0 commit comments