Kamil Tekiela
276577ca2a
Remove $GLOBALS['PMA_PHP_SELF'] ( #18149 )
...
* Remove $GLOBALS['PMA_PHP_SELF']
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Remove $GLOBALS['PMA_PHP_SELF'] from tests
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Moved cleanupPathInfo to Routing
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Remove parse_url from getRootPath
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Update baselines
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Remove invalid tests
Surely, we never expect PATH to be backslash delimited. The code is not designed to handle this and the tests for this don't make much sense.
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Fix trailing slash in path
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
---------
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-27 17:56:27 -03:00
Maurício Meneghini Fauth
342ab3f67a
Merge branch 'QA_5_2'
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-27 14:36:32 -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
Maximilian Krög
4f76f8eb32
Only create one GisVisualization object
...
Signed-off-by: Maximilian Krög <maxi_kroeg@web.de>
2023-02-25 04:40:36 +01:00
Maximilian Krög
3417030100
Remove globals usage in GisDataEditorController
...
Signed-off-by: Maximilian Krög <maxi_kroeg@web.de>
2023-02-25 04:40:35 +01: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
Kamil Tekiela
902d1a1e77
Add native return type hints ( #18126 )
...
* Add remaining native return type hints to flush out bugs
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Cast the mixed value to int
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Fix tests
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* getAutoIncrement() is supposed to return string
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Cast values to string in DummyResult
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Make getCollation() return non-nullable string
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Cast seqInIndex to int
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Cast $cardinality to int
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* createFile may return false
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Remove redundant cast
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Update baselines
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
---------
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-23 15:43:36 -03:00
William Desportes
24ac923632
Fix Internal error in ./libraries/classes/Controllers/HomeController.php#314
...
TypeError: mb_strlen(): Argument #1 ($string) must be of type string, bool given
Signed-off-by: William Desportes <williamdes@wdes.fr>
2023-02-22 12:47:59 +01: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
efed55320d
Fix invalid PHP doc blocks
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-20 18:46:35 -03:00
Maurício Meneghini Fauth
b0bc4f460e
Use null safe object operator where possible
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-20 18:21:56 -03:00
Maurício Meneghini Fauth
5aeaca0a9a
Remove unnecessary global vars from QBE controller
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-20 17:51:18 -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
Maurício Meneghini Fauth
4b71da0566
Merge pull request #18127 from kamil-tekiela/nonUnique-to-bool
...
Change nonUnique prop to be bool
2023-02-20 16:32:44 -03:00
Maurício Meneghini Fauth
2a4803a81b
Merge branch 'QA_5_2'
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-20 15:18:28 -03:00
Maurício Meneghini Fauth
0fa4ebdc59
Fix coding standard issues and update SA baselines
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-20 12:50:47 -03:00
ru-asdx
6dca8e722b
Ref #17769 - replace superglobals with serverrequest in database/ controllers ( #17991 )
...
* replace superglobals with serverrequest in database/ controllers
Signed-off-by: Evgeny Skorlov <eugene@skorlov.name>
* fix trailing whitespace
Signed-off-by: Evgeny Skorlov <eugene@skorlov.name>
* Update libraries/classes/Controllers/Database/QueryByExampleController.php
Co-authored-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
* Update libraries/classes/Controllers/Database/QueryByExampleController.php
Co-authored-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
* Update libraries/classes/Controllers/Database/QueryByExampleController.php
Co-authored-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
* Update libraries/classes/Controllers/Database/QueryByExampleController.php
Co-authored-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
* Update libraries/classes/Controllers/Database/TrackingController.php
Co-authored-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
* Update libraries/classes/Controllers/Database/TrackingController.php
Co-authored-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
---------
Signed-off-by: Evgeny Skorlov <eugene@skorlov.name>
Co-authored-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-20 12:35:18 -03:00
Evgeny Skorlov
673882b281
libraries/classes/Controllers/Database/ExportController.php
...
Signed-off-by: Evgeny Skorlov <eugene@skorlov.name>
2023-02-20 12:29:09 -03:00
Kamil Tekiela
1967a2511f
Change nonUnique prop to be bool
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-20 12:30:53 +00:00
Kamil Tekiela
80c4db7253
Use strict check when type is known
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-19 23:19:54 +00:00
Kamil Tekiela
69f7a915eb
Replace getTablesFull with getTables
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-18 14:33:41 +00:00
Kamil Tekiela
e0ef08d871
Extract functionality into methods for better readability
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-16 12:38:49 +00:00
Kamil Tekiela
87419d3cd2
Fix bug caused by earlier refactoring
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-16 12:13:33 +00:00
Maurício Meneghini Fauth
05963de7a8
Fix unused variable after merge
...
Introduced by 0819043d0e .
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-15 15:58:20 -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
164bf08f4c
Move getColumnMapFromSql() to SystemDatabase
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-15 12:41:47 +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
8433f66447
Remove unused variable in catch
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-14 12:10:23 +00:00
Maurício Meneghini Fauth
07594eda44
Remove Image\ImageWrapper::destroy method
...
This method has no operation in PHP 8.0.
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-13 10:34:12 -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
d76b240176
Remove redundant pass-by-ref
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-10 16:30:12 -03:00
Kamil Tekiela
7e5d96b559
Use DI for UserPreferences
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-10 16:23:34 -03:00
Kamil Tekiela
22cb5f2a84
Remove globals from create controller ( #18046 )
...
* $GLOBALS['column_map']
* Replace globals with constants
* $GLOBALS['sep']
* $GLOBALS['arr']
* $GLOBALS['view_columns']
* $GLOBALS['systemDb']
* $GLOBALS['pma_transformation_data']
* $GLOBALS['new_transformations_sql']
* $GLOBALS['view']
* $GLOBALS['item']
* $GLOBALS['parts']
* Add TODO comment
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
---------
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-10 16:17:49 -03:00
Maurício Meneghini Fauth
0819043d0e
Merge branch 'QA_5_2'
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-08 14:09:59 -03:00
William Desportes
9d92dafdcb
Merge #17923 - Fix #17766 - Allow to open in a new tab copy and edit row actions
...
Pull-request: #17923
Fixes : #17766
Signed-off-by: William Desportes <williamdes@wdes.fr>
2023-02-08 13:13:39 +01:00
Maurício Meneghini Fauth
ede1e82c28
Refactor DB designer JS to use modules
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-04 18:26:08 -03: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
Evgeny Skorlov
1eb0e001d8
replace superglobas with serverrequest in database/designercontroller
...
Signed-off-by: Evgeny Skorlov <eugene@skorlov.name>
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-01-27 11:49:30 -03:00
Maurício Meneghini Fauth
4bbf1e86b0
Merge pull request #18029 from kamil-tekiela/Forms-refactoring
...
Refactor config forms
2023-01-26 23:13:47 -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
a4a2915b94
Merge pull request #18024 from kamil-tekiela/Fix-ColumnPreferencesController
...
Fix ColumnPreferencesController
2023-01-26 11:27:23 -03:00
Kamil Tekiela
e3e351c676
Remove dead code
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-01-25 00:59:43 +00: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