Skip to content

Commit ff97eaf

Browse files
Merge pull request #19762 from MauricioFauth/route-attribute
Collect routes from the Route attribute in controller classes
2 parents eb07284 + 1e334d5 commit ff97eaf

File tree

204 files changed

+599
-331
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

204 files changed

+599
-331
lines changed

src/Controllers/BrowseForeignersController.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@
99
use PhpMyAdmin\Http\Response;
1010
use PhpMyAdmin\Http\ServerRequest;
1111
use PhpMyAdmin\ResponseRenderer;
12+
use PhpMyAdmin\Routing\Route;
1213

1314
/**
1415
* Display selection for relational field values
1516
*/
17+
#[Route('/browse-foreigners', ['GET', 'POST'])]
1618
final class BrowseForeignersController implements InvocableController
1719
{
1820
public function __construct(

src/Controllers/ChangeLogController.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use PhpMyAdmin\Http\Response;
1111
use PhpMyAdmin\Http\ServerRequest;
1212
use PhpMyAdmin\ResponseRenderer;
13+
use PhpMyAdmin\Routing\Route;
1314
use PhpMyAdmin\Template;
1415
use PhpMyAdmin\Url;
1516

@@ -26,6 +27,7 @@
2627
use function sprintf;
2728
use function str_ends_with;
2829

30+
#[Route('/changelog', ['GET'])]
2931
final class ChangeLogController implements InvocableController
3032
{
3133
public function __construct(

src/Controllers/CheckRelationsController.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
1111
use PhpMyAdmin\Http\ServerRequest;
1212
use PhpMyAdmin\Identifiers\DatabaseName;
1313
use PhpMyAdmin\ResponseRenderer;
14+
use PhpMyAdmin\Routing\Route;
1415
use PhpMyAdmin\Tracking\Tracker;
1516

1617
use const SQL_DIR;
1718

1819
/**
1920
* Displays status of phpMyAdmin configuration storage
2021
*/
22+
#[Route('/check-relations', ['GET', 'POST'])]
2123
final readonly class CheckRelationsController implements InvocableController
2224
{
2325
public function __construct(private ResponseRenderer $response, private Relation $relation, private Config $config)

src/Controllers/CollationConnectionController.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
use PhpMyAdmin\Http\Response;
99
use PhpMyAdmin\Http\ServerRequest;
1010
use PhpMyAdmin\ResponseRenderer;
11+
use PhpMyAdmin\Routing\Route;
1112
use PhpMyAdmin\Url;
1213

14+
#[Route('/collation-connection', ['POST'])]
1315
final class CollationConnectionController implements InvocableController
1416
{
1517
public function __construct(private readonly ResponseRenderer $response, private readonly Config $config)

src/Controllers/ColumnController.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
use PhpMyAdmin\Http\ServerRequest;
1010
use PhpMyAdmin\Message;
1111
use PhpMyAdmin\ResponseRenderer;
12+
use PhpMyAdmin\Routing\Route;
1213

14+
#[Route('/columns', ['POST'])]
1315
final class ColumnController implements InvocableController
1416
{
1517
public function __construct(private readonly ResponseRenderer $response, private readonly DatabaseInterface $dbi)

src/Controllers/Console/Bookmark/AddController.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@
1010
use PhpMyAdmin\Http\Response;
1111
use PhpMyAdmin\Http\ServerRequest;
1212
use PhpMyAdmin\ResponseRenderer;
13+
use PhpMyAdmin\Routing\Route;
1314

1415
use function __;
1516

17+
#[Route('/console/bookmark/add', ['POST'])]
1618
final readonly class AddController implements InvocableController
1719
{
1820
public function __construct(

src/Controllers/Console/Bookmark/RefreshController.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
use PhpMyAdmin\Http\Response;
1010
use PhpMyAdmin\Http\ServerRequest;
1111
use PhpMyAdmin\ResponseRenderer;
12+
use PhpMyAdmin\Routing\Route;
1213

14+
#[Route('/console/bookmark/refresh', ['GET'])]
1315
final class RefreshController implements InvocableController
1416
{
1517
public function __construct(private readonly ResponseRenderer $response, private readonly Console $console)

src/Controllers/Console/UpdateConfigController.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@
1111
use PhpMyAdmin\Http\Response;
1212
use PhpMyAdmin\Http\ServerRequest;
1313
use PhpMyAdmin\ResponseRenderer;
14+
use PhpMyAdmin\Routing\Route;
1415

1516
use function __;
1617
use function in_array;
1718
use function is_numeric;
1819

20+
#[Route('/console/update-config', ['POST'])]
1921
final class UpdateConfigController implements InvocableController
2022
{
2123
public function __construct(

src/Controllers/Database/CentralColumns/PopulateColumnsController.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
use PhpMyAdmin\Http\Response;
1111
use PhpMyAdmin\Http\ServerRequest;
1212
use PhpMyAdmin\ResponseRenderer;
13+
use PhpMyAdmin\Routing\Route;
1314

15+
#[Route('/database/central-columns/populate', ['POST'])]
1416
final class PopulateColumnsController implements InvocableController
1517
{
1618
public function __construct(

src/Controllers/Database/CentralColumnsController.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use PhpMyAdmin\Identifiers\DatabaseName;
1717
use PhpMyAdmin\Message;
1818
use PhpMyAdmin\ResponseRenderer;
19+
use PhpMyAdmin\Routing\Route;
1920
use Webmozart\Assert\Assert;
2021

2122
use function __;
@@ -24,6 +25,7 @@
2425
use function parse_str;
2526
use function sprintf;
2627

28+
#[Route('/database/central-columns', ['GET', 'POST'])]
2729
final readonly class CentralColumnsController implements InvocableController
2830
{
2931
public function __construct(

0 commit comments

Comments
 (0)