Commit Graph

32 Commits

Author SHA1 Message Date
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
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
Kamil Tekiela
7e5d96b559 Use DI for UserPreferences
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-10 16:23:34 -03:00
Maurício Meneghini Fauth
3bc3c7de4d
Extract Functions.ajaxShowMessage() into ajax-messages.js
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-12-06 08:21:58 -03:00
Kamil Tekiela
959849f446
Introduce ServerRequest::hasBodyParam() (#17870)
* Drop Sql::setUiProp()
* Remove ternary operator
* Improve array guard
* Remove redundant isset
* Implement hasBodyParam()
* Add has() and hasQueryParam()

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-11-05 13:04:45 -03:00
Maurício Meneghini Fauth
3890d11dd8
Fix some coding style issues
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-10-16 17:18:54 -03:00
Maurício Meneghini Fauth
2c5143feda Remove ResponseRenderer::getFooter method
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-04-09 12:32:14 -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
3e0856c77b
Remove useless string concatenations
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-27 21:40:22 -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
bd2ef2b8ee
Get post params from ServerRequest class
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-08-30 17:45:28 -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
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
William Desportes
0c5aa81c78
Inject the error report modal and avoid sending depending on SendErrorReports
Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-03-15 18:22:30 +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
Maurício Meneghini Fauth
e6ec9df84e Remove DBI dep from Controllers/AbstractController
Moves the DatabaseInterface class dependency to the classes that use it.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2020-10-11 22:48:44 -03:00
Maurício Meneghini Fauth
3b285ff17e Use identical operator for non-empty strings
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2020-07-10 18:06:29 -03:00
Maurício Meneghini Fauth
94955f187a Fix function call signatures indentation
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2020-05-26 04:22:02 -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
9269d75fb4 Fix some coding standard issues
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2020-05-25 20:22:18 -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
50bc4ab37f Remove useless PHP docs for functions
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2020-01-20 13:20:01 -03:00
Maurício Meneghini Fauth
39f42f848b Remove some useless docblock comments
Fixes docblock spacing

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2019-12-13 21:15:00 -03:00
Maurício Meneghini Fauth
dd2b05330a Remove useless parentheses
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2019-12-12 00:18:01 -03:00
Maurício Meneghini Fauth
dd06cd38f8 Defines rules for double quote usage
Makes sure that any use of double quotes strings are warranted.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2019-12-01 14:10:07 -03:00
Maurício Meneghini Fauth
e8c5ba4f80 Convert Messages to Bootstrap Alerts
Replaces Messages custom styles with a Bootstrap Alerts theme

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2019-11-12 15:28:47 -03:00
Maurício Meneghini Fauth
271e0033a1 Create ErrorReportController
Refactors error report entry point to use the new controller.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2019-11-06 22:25:52 -03:00