Skip to content

Commit 87f8ece

Browse files
committed
Deprecate the db and table properties from controllers
The database and table parameters should be got from the server request or from the respective globals. Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
1 parent ae0c17e commit 87f8ece

4 files changed

Lines changed: 277 additions & 4 deletions

File tree

libraries/classes/Controllers/Database/AbstractController.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010

1111
abstract class AbstractController extends Controller
1212
{
13-
/** @var string */
13+
/**
14+
* @deprecated Get the value from $GLOBALS['db'] or from the {@see \PhpMyAdmin\Http\ServerRequest} instance.
15+
*
16+
* @var string
17+
*/
1418
protected $db;
1519

1620
public function __construct(ResponseRenderer $response, Template $template, string $db)

libraries/classes/Controllers/Table/AbstractController.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,18 @@
1010

1111
abstract class AbstractController extends Controller
1212
{
13-
/** @var string */
13+
/**
14+
* @deprecated Get the value from $GLOBALS['db'] or from the {@see \PhpMyAdmin\Http\ServerRequest} instance.
15+
*
16+
* @var string
17+
*/
1418
protected $db;
1519

16-
/** @var string */
20+
/**
21+
* @deprecated Get the value from $GLOBALS['table'] or from the {@see \PhpMyAdmin\Http\ServerRequest} instance.
22+
*
23+
* @var string
24+
*/
1725
protected $table;
1826

1927
public function __construct(ResponseRenderer $response, Template $template, string $db, string $table)

libraries/classes/Error.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ public function getDisplay(): string
479479

480480
$template = new Template();
481481

482-
return $template->render('error/get_display',[
482+
return $template->render('error/get_display', [
483483
'context' => $context,
484484
'isUserError' => $this->isUserError(),
485485
'type' => $this->getType(),

0 commit comments

Comments
 (0)