Kamil Tekiela
4ec3b99ba3
Improve boolean conditions with arrays ( #18417 )
...
* Remove empty() on array
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Remove boolean count()
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
---------
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-05-12 15:16:26 -03:00
Evgeny Skorlov
4530585ad3
Replace superglobals with serverrequest in controllers
...
Signed-off-by: Evgeny Skorlov <eugene@skorlov.name>
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-04-12 15:49:31 -03:00
Maurício Meneghini Fauth
62d16a07ee
Replace jqPlot with Chart.js in /server/status/queries
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-04-06 18:52:43 -03:00
Maurício Meneghini Fauth
6a2c12bdc8
Add missing traversable type hints
...
Replace array type hint with mixed[] type hint, since it means the same.
This way it's possible to require traversable type hint for new code.
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-04-02 01:32:12 -03:00
Maurício Meneghini Fauth
dd885dc7b8
Use single-line arrays when possible
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-03-27 17:39:17 -03:00
Maurício Meneghini Fauth
e5698c85e9
Require single line for function calls
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-03-26 23:10:10 -03: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
c7855f6e95
Create the PhpMyAdmin\Replication namespace
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-03-20 14:16:01 -03:00
Kamil Tekiela
3ecf14df34
Fixing erroneous params
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-03-17 12:47:43 +00:00
Kamil Tekiela
555c6798eb
Add native param types
...
Includes TypeHints.UnionTypeHintFormat
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-03-17 12:45:18 +00:00
Kamil Tekiela
142f15f373
Use quoteString in controllers ( #18191 )
...
* CreateController
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* FindReplaceController
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* SetVariableController
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* GetVariableController
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* UserGroupsFormController
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* TablesController
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
---------
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-03-03 17:40:45 -03:00
Kamil Tekiela
0bdcaba2d2
Add native property types ( #18143 )
...
* Add native property types
Includes TypeHints.UnionTypeHintFormat
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Set some default values for properties
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Format and promote properties
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Remove redundant asserts
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Redundant cast
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* $tmanager->theme is never null
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Redundant variable
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Fix empty on $statementInfo bool
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Redundant casts
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Redundant issets
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* getPacked() returns nullable string
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Redundant if
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* $this->content can be null
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Simplify ThemeManager::getInstance()
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Use isset for checking if property is initialized
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Use nullable instead of uninitialized property
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* password is no longer nullable
I can't verify that none of the globals ever tried to set it to null, but the variable should never be nullable.
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Update baselines
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* $same_wide_width param can be float or int
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Update Message.php
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Cast Sub_part to int
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Fix one line doc comments
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
---------
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-26 23:30:41 -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
2137664f82
Merge pull request #18116 from kamil-tekiela/Remove-strlen
...
Remove strlen when used in a condition
2023-02-24 20:20:12 -03:00
Kamil Tekiela
e8c5eef6f8
Remove annoying empty statements ( #18114 )
...
* Remove annoying empty statements
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Make $extra strict and stop passing false to it
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Make $page strict and stop passing null
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
---------
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-24 20:11:37 -03:00
Kamil Tekiela
dcc912fdef
Remove strlen when used in a condition
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-24 22:58:47 +00:00
Maurício Meneghini Fauth
0ba371f921
Refactor ConfigStorage\UserGroups::delete()
...
- Extracts dbi global variable
- Replaces escapeString with quoteString
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-21 14:40:25 -03:00
Maurício Meneghini Fauth
4ff3724c3f
Use union with null instead of short nullable type
...
Since union type are now possible, using union with null makes more
clear that it is a union type.
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-20 21:48:19 -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
cfe54a501b
Add union types
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-15 15:23:28 +00: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
f7524fd3b9
Minor code refactoring of Privileges.php ( #17993 )
...
* Small fixes
* Replace escapeString with quoteString
This also fixes bug with $_POST['old_username'].
* Add userExists() method
* Merge if statements
* Use ServerRequest for $initial
* Extract getExportPageTitle from getExportUserDefinitionTextarea
* Update baselines
* Complete redesign of getCurrentAuthenticationPlugin()
* Add method getEmptyUserNotice()
* Remove redundant variable sets and unsets
* Add method checkStructureOfPrivilegeTable()
* Remove testGetHtmlForViewUsersError()
* Privatize getAddUserHtmlFieldset
* Improve tests for mysql.user table checks
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-01-28 20:40:30 -03:00
Kamil Tekiela
7a22334167
Designer controller globals ( #17985 )
...
* Remove globals from DesignerController
* Remove $GLOBALS['params'] in ManageController
* Remove $GLOBALS['params']
* Remove $GLOBALS['total_num_tables']
* Remove $GLOBALS['tooltip_truename']
* Remove $GLOBALS['tooltip_aliasname']
* Remove $GLOBALS['pos']
* Remove $GLOBALS['tables'] (partially)
* Remove $GLOBALS['num_tables'] (partially)
* Remove redundant calls to Util::getDbInfo()
* Move unrelated functionality out of getDbInfo()
* Extract new method getTableListPosition()
* Code style changes
* Update phpstan-baseline.neon
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-01-26 22:58:24 -03:00
Kamil Tekiela
55a6f09ce8
Server privileges controller globals removal ( #17986 )
...
* $GLOBALS['url_dbname']
* $GLOBALS['grants'], $GLOBALS['one_grant']
* $GLOBALS['export']
* $GLOBALS['title']
* $GLOBALS['itemType']
* $GLOBALS['_add_user_error']
* $GLOBALS['queries_for_display']
* $GLOBALS['ret_queries']
* $GLOBALS['ret_message']
* $GLOBALS['queries']
* Remove redundant code
* $GLOBALS['password']
* $GLOBALS['dbname_is_wildcard']
* $GLOBALS['db_and_table']
* $GLOBALS['routinename']
* $GLOBALS['tablename']
* $GLOBALS['post_patterns']
* Update psalm-baseline.xml
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-01-26 11:46:20 -03:00
Maurício Meneghini Fauth
93c77c3784
Merge branch 'QA_5_2'
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-01-24 11:23:53 -03:00
William Desportes
305fe52d9e
Fix #18019 - Error: "Call to a member function fetchAssoc() on bool" with SQL mode ONLY_FULL_GROUP_BY
...
Fixes : #18019
Signed-off-by: William Desportes <williamdes@wdes.fr>
2023-01-20 19:36:52 +04:00
Maurício Meneghini Fauth
41dec1effc
Extract connection type constants to the Connection class
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-01-17 02:21:27 -03:00
Maurício Meneghini Fauth
1d37607132
Update PHPStan/Psalm baselines
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-01-11 00:22:48 -03:00
ru-asdx
87bd27621e
Ref #17769 - replace superglobals with serverrequest in server/ controllers ( #17978 )
...
* replace superglobals with serverrequest in server/ controllers
* replace $_POST['param'] ?? $_GET['value'] with $request->getParam
Signed-off-by: Evgeny Skorlov <eugene@skorlov.name>
2023-01-10 21:22:04 -03:00
ru-asdx
3663fed7ad
Ref #17769 - Replace superglobals with serverrequest in PrivilegesController ( #17977 )
...
* replace superglobals with serverrequest
Signed-off-by: Evgeny Skorlov <eugene@skorlov.name>
2023-01-10 21:15:39 -03:00
Maurício Meneghini Fauth
fdf474abf9
Merge pull request #17981 from kamil-tekiela/getTables-investigation
...
Improve some type inference in various places
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-12-24 13:44:45 -03:00
Kamil Tekiela
2bda275524
Add better type inference
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-12-20 18:55:03 +00:00
Kamil Tekiela
65ab1608f8
Remove dependency in DatabasesController
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-12-16 20:58:48 +00:00
Kamil Tekiela
b29eccd70b
Remove $params
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-11-30 22:20:19 +00:00
ru-asdx
eff7e23b60
Ref #17769 - Replace superglobals with ServerRequest in Server/Status ( #17912 )
...
* Replace superglobals with ServerRequest in Server/Status
Signed-off-by: Evgeny Skorlov <eugene@skorlov.name>
2022-11-30 14:30:46 -03:00
Kamil Tekiela
dd699f348d
Clean up LIKE escaping
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-11-25 00:06:52 +00:00
Maurício Meneghini Fauth
ca489f3b41
Improve type of DatabaseInterface::getLowerCaseNames()
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-11-19 15:50:14 -03:00
Maurício Meneghini Fauth
d0d90551c3
Remove the dblist global variable
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-11-13 21:08:00 -03:00
Maurício Meneghini Fauth
aeb237f629
Fix TypeError in Server\ReplicationController class
...
Fixes https://github.com/phpmyadmin/phpmyadmin/issues/17875
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-11-10 21:44:25 -03:00
Kamil Tekiela
656ddda704
Refactor BinlogController.php
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-11-08 11:59:05 +00:00
Maurício Meneghini Fauth
97aac39a40
Remove the sub_part global variable
...
It's only used inside Util::getDbInfo() for pagination when not
exporting.
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-11-07 22:06:59 -03:00
Maurício Meneghini Fauth
456be438ea
Merge pull request #17872 from kamil-tekiela/Remove-$params-2
...
Refactoring of Processes.php
2022-11-06 17:01:07 -03:00
Kamil Tekiela
94ba7d69d2
Remove $params array
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-11-05 21:24:10 +00:00
Kamil Tekiela
aa3b4ed737
Refactoring of Processes.php
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-11-05 21:13:12 +00:00
Kamil Tekiela
7ee4c77036
Fix Replica bugs
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-11-02 15:47:31 +00:00
William Desportes
81e67d2aa3
Fix type hint on replication controller
...
See: bfd75d04a4 (r87525137)
Signed-off-by: William Desportes <williamdes@wdes.fr>
2022-10-29 20:24:22 +02:00
Luca Perna
cca381a415
#17769 Use ServerRequest Object to access POST-vars ( #17819 )
...
* 17769 - use Request object instead of SuperGlobals
Signed-off-by: Luca Perna <luca@perna.rocks>
2022-10-29 11:57:47 -03:00