Maurício Meneghini Fauth
63e6410728
Refactor the DbTableExists class
...
- Changes static methods to instance methods
- Extract response handling to the controllers
- Add unit tests for the DbTableExists class
- Remove the AbstractController::hasDatabase() method
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-08-06 01:42:06 -03:00
Maurício Meneghini Fauth
19dad3b153
Add a isAjax() method to ServerRequest class
...
This method belongs to the ServerRequest class instead of the
ResponseRenderer class, as it's a request property.
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-07-26 16:01:37 -03:00
Maximilian Krög
abf49ce9d4
Bettery types for DbiDummy / DummyResult
...
Signed-off-by: Maximilian Krög <maxi_kroeg@web.de>
2023-04-07 21:47:07 +02:00
Maurício Meneghini Fauth
437215cab2
Rename variables to use camel case format
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-03-26 21:47:50 -03:00
Maurício Meneghini Fauth
556594b4cd
Fix coding standard spacing issues
...
- Fixes one line doc comments
- Fixes parent call spacing
- Fixes constant spacing
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-24 21:06:17 -03:00
Maurício Meneghini Fauth
77957a69a5
Add trailing comma for multi-line functions
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-24 20:48:46 -03:00
Maurício Meneghini Fauth
785f8c1c00
Use constructor property promotion where possible
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-20 19:39:02 -03:00
Maurício Meneghini Fauth
613678f8f5
Replace assignments with null coalesce equal operator
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-20 17:03:05 -03:00
Kamil Tekiela
2b35303aae
Remove redundant code ( #18063 )
...
PHPStorm has been a little annoying with showing all these code issues. I took some time to analyse most of them and fix whichever were easy to fix. This kind of change should improve future maintenance as developers do not need to wonder what a line of code does. Code that has no impact on functionality should be removed.
* Remove redundant variables
* Invert condition for better clarity
* Remove some of the redundant casts
* Replace switch with an if
* Fix foreach variable
* Remove redundant variable concat
* Remove redundant concats
* Replace for loop with str_repeat
* Remove always true param
* Turn property $position into local var
* Turn Pdf properties into local vars
* Remove unused properties in Pdf
* Change ternary into condition
* Remove redundant assignments
They are immediately overwritten with a different value.
* Redundant array append
* Collapse if statements into assignments
* Use boolean constants instead of variables
* Remove unneeded parameter
* Remove null-coalesce
* Unnecessary assignment
* Remove redundant isset
* Remove readOnly flag for InsertEdit fields
* Remove function_exists and $mode var
* Remove duplicate condition
* Remove redundant elseif
* Remove redundant isset
* Use hasBodyParam()
* Simplify isRoutesCacheFileValid()
Psalm complains but is wrong.
https://github.com/phpmyadmin/phpmyadmin/pull/18063
---------
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-15 09:11:05 -03:00
Kamil Tekiela
8a1d6f1eaa
Convert var annotations to typed properties
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-12 21:31:04 +00:00
Maurício Meneghini Fauth
3c618c22a9
Add ServerRequest parameter to all controllers
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-07-28 01:00:08 -03:00
Maurício Meneghini Fauth
5950693fb3
Fix possible undefined globals
...
Related to https://github.com/phpmyadmin/phpmyadmin/pull/17427 .
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-03-10 18:05:21 -03:00
Maurício Meneghini Fauth
f940693c75
Move Util::checkParameters method to the AbstractController
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-03-07 22:59:33 -03:00
Maurício Meneghini Fauth
1438cb211e
Replace global keyword with $GLOBALS
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-03-07 17:31:11 -03:00
Maurício Meneghini Fauth
5a34a3bb04
Remove db and table properties from controllers
...
Replaces them with their respective globals.
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-02-02 14:48:43 -03:00
Maurício Meneghini Fauth
a8d514a350
Remove db and table globals from DbTableExists class
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-01-28 16:43:48 -03:00
Kamil Tekiela
47a039d70c
Implement ResultInterface & MysqliResult
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2021-12-31 23:59:24 +00:00
Kamil Tekiela
f446e6da88
Remove unused variables
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2021-12-03 15:12:56 +00:00
Kamil Tekiela
488e7cb5bf
Use array_keys whenever only keys are needed in foreach
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2021-11-29 20:37:39 +00:00
Maurício Meneghini Fauth
f00d70cccb
Remove useless whitespaces
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-15 17:05:40 -03:00
Maurício Meneghini Fauth
3531775b7c
Add type declarations to the controllers contructors
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-11 17:32:22 -03:00
Maurício Meneghini Fauth
a2ed4dfe68
Make controllers callable
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-08-30 13:16:29 -03:00
Maurício Meneghini Fauth
9adaa912e1
Rename Response class to ResponseRenderer
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-06-30 12:35:22 -03:00
Maurício Meneghini Fauth
cc0cc79253
Accept only string for Response::addHTML method
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-06-29 18:04:18 -03:00
Maurício Meneghini Fauth
1c084de30b
Fix coding standard errors
...
Related to 62f142c9fa .
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-06-03 16:50:33 -03:00
Maurício Meneghini Fauth
4dec56d883
Remove get_start_and_number_of_rows_panel() Twig function
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-05-17 17:56:34 -03:00
Maurício Meneghini Fauth
44bdd1d390
Rename $url_params global to $urlParams
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-03-24 22:48:14 -03:00
Maurício Meneghini Fauth
91bd0df2e5
Rename $err_url global to $errorUrl
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-03-24 19:39:28 -03:00
William Desportes
0b440f2652
Ref #16651 - Fix and improve the chart checking for int columns
...
Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-03-15 01:30:35 +01:00
Maurício Meneghini Fauth
d83abf63e7
Use PSR-12 for control structures spacing
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-03-05 15:27:03 -03:00
Maurício Meneghini Fauth
0b8edc5bde
Use PSR-12 for namespace use statements
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-03-05 14:18:35 -03:00
William Desportes
c5155ecae9
Refactor field flags to use an object an not strpos
...
Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-02-24 23:56:33 +01:00
Maurício Meneghini Fauth
c11e8d5f64
Remove Common::database method
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2020-11-02 18:56:58 -03:00
Maurício Meneghini Fauth
ef62d7a9f5
Remove is_system_schema PHP global variable
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2020-11-02 18:48:23 -03:00
Maurício Meneghini Fauth
36d93cf2f9
Remove Common::table method
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2020-11-02 18:48:23 -03:00
Maurício Meneghini Fauth
6b81080127
Remove Common::server method
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2020-11-02 18:48:23 -03:00
Maurício Meneghini Fauth
601ed4649e
Remove DBI dep from Table\AbstractController
...
Moves the DatabaseInterface class dependency to the classes that use it.
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2020-10-12 12:53:03 -03:00
Maurício Meneghini Fauth
3c21cf1853
Remove url_query PHP global
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2020-09-08 13:32:25 -03:00
Maurício Meneghini Fauth
1dccc10493
Extract method for adding script files
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2020-07-12 16:58:33 -03:00
Maurício Meneghini Fauth
f4582e083e
Use early exit when possible
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2020-05-27 00:35:24 -03:00
Maurício Meneghini Fauth
3baad2eb1c
Fix some coding standard issues
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2020-05-25 22:42:37 -03:00
Maurício Meneghini Fauth
a64393e7f5
Fix some coding standard issues
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2020-05-13 00:23:28 -03:00
Maurício Meneghini Fauth
9b7c4931d3
Add AbstractController::render method
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2020-04-16 20:15:42 -03:00
Maurício Meneghini Fauth
206199105e
Remove useless return type annotations
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2020-01-23 13:03:29 -03:00
Maurício Meneghini Fauth
676f48349a
Reference global funcs and consts via use statement
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2020-01-21 22:13:36 -03:00
Maurício Meneghini Fauth
f80d3e3bd4
Remove unnecessary annotations
...
@package, @subpackage and others.
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2020-01-20 17:35:56 -03:00
Maurício Meneghini Fauth
d0f28cef30
Refactor table pages common code
...
Extracts tbl_common.inc.php code to the Common::table() method and
removes the include file.
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2020-01-07 22:49:24 -03:00
Maurício Meneghini Fauth
385e7f86c0
Refactor database pages common code
...
Extracts db_common.inc.php code to the Common::database() method and
removes the include file.
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2020-01-07 22:49:24 -03:00
Maurício Meneghini Fauth
a1bcb9f0f3
Refactor server pages common code
...
Extracts server_common.inc.php code to the Common::server() method and
removes the include file.
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2020-01-07 22:49:24 -03:00
Maurício Meneghini Fauth
e6f9b5bac5
Remove table chart entry point
...
Moves table chart entry point call to the routes file.
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2019-12-23 21:46:52 -03:00