phpmyadmin/phpmyadmin
`DatabaseName` and `TableName` should be used for `$db` and `$table`
オープン
#17,727 opened on 2022/09/17
Enhancementgood first issuehacktoberfesthelp wantednewbierefactoring
Repository metrics
- Stars
- (6,886 個のスター)
- PR merge metrics
- (平均マージ 2d 17h) (30d で 11 merged PRs)
説明
The PhpMyAdmin\Dbal\DatabaseName and PhpMyAdmin\Dbal\TableName classes should be used as a type for the database and table names instead of using plain strings.
- public function foo(string $db, string $table)
+ public function foo(DatabaseName $db, TableName $table)
The current database and table names can also be got as strings using the Current::$database and Current::$table static properties of the class PhpMyAdmin\Current. These should be using the value objects as well.
- $db = Current::$database;
+ $db = DatabaseName::fromValue(Current::$database);
If you're willing to work on this, you don't need to change all cases before opening a pull request, you can change a small piece of code, test if it's working and then open a pull request. That will make your PR easier to review and merge.