Commit Graph

135 Commits

Author SHA1 Message Date
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
Kamil Tekiela
8a5ce0b557 Split long lines
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-03-17 12:48:12 +00: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
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
Maurício Meneghini Fauth
47846068fa
Remove some useless comments
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-20 23:45:06 -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
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
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
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
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
6264f6f1ea
Various refactorings 2 (#17965)
* Remove extra blank lines
* Remove useless param annotations
* Refactor Index::singleton
* Refactor Config.php
* Refactor Header::addRecentTable()
* Collapse return statement into a single line
* Refactor Message.php
* Convert $getUniqueCondition into a scalar
* Code style
* Fix invalid return phpdoc
* Remove unused variable
* Remove redundant empty array checks
* Refactor Export::closeFile()
* Simplify else statement
* Remove redundant else
* Refactor TablePartitionDefinition::getDetails
* Simpler returns
* Add types for getCellContent()
* Remove useless method mngInsideStructComm

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-12-24 12:54:23 -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
f783bdea6c Change variable name case
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-12-13 09:47:30 -03: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
Kamil Tekiela
3b49a5bedb Implement quoteString()
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-11-06 19:06:48 +00:00
Maurício Meneghini Fauth
478b1c03a7
Merge branch 'QA_5_2'
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-10-16 13:52:33 -03:00
Maurício Meneghini Fauth
4d1546f7c5
Fix indentation issues
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-10-16 13:41:31 -03:00
Maurício Meneghini Fauth
c51b5fa437
Use DatabaseName for the newname param in OperationsController
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-09-13 20:36:06 -03:00
Maurício Meneghini Fauth
873eb098b9
Remove crlf global variable
The crlf global variable is only diferent for SQL export method,
otherwise is always the value of the PHP_EOL constant.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-09-13 14:08:57 -03:00
Maurício Meneghini Fauth
5d74cd134e
Get 'newname' param from ServerRequest object
Instead of the $_POST superglobal in OperationsController and Operations
classes.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-09-12 23:36:07 -03:00
Maurício Meneghini Fauth
e96fab654d
Move DBI's getProceduresOrFunctions into Routines class
Splits the method into Routines::getFunctionNames and
Routines::getProcedureNames and adds tests.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-09-11 17:32:44 -03:00
Maurício Meneghini Fauth
7975f5fb05
Move DBI's getDefinition into the Routines and Events classes
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-09-11 15:48:26 -03:00
Maurício Meneghini Fauth
a8421efd56
Move DBI getTriggers method into the Triggers class
DatabaseInterface::getTriggers -> Database\Triggers::getDetails

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-09-10 16:00:42 -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
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
c411121fd8
Move Relation classes into the ConfigStorage namespace
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-12-17 12:09:13 -03: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
c1e864b1d7
Add Warning value object for SHOW WARNINGS rows
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-10-09 00:09:01 -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
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
7f6472b2c2
Add void return type where possible
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-13 15:29:11 -03:00
Maurício Meneghini Fauth
5f4fd07483
Remove some assignments to the $_POST global
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-03 15:49:39 -03:00
Maurício Meneghini Fauth
8f2f3eff40
Remove the Core::isValid method
This improves the type checking and simplifies the code.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-02 13:20:50 -03:00
Maurício Meneghini Fauth
78c266d98f
Move partition classes to the Partitioning namespace
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-08-21 14:01:25 -03:00
William Desportes
cbe4eae632
Merge branch 'QA_5_1'
Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-07-22 18:46:28 +02:00
William Desportes
eeae64f307
Ref #17004 - Support removed variable innodb_file_format
Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-07-22 16:27:40 +02:00
William Desportes
c830c1e93a
Merge branch 'origin/QA_5_1'
Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-07-15 02:34:29 +02:00
Fawzi E. Abdulfattah
751d415216 fixing the case-sensitive issue of innodb_file_format
Signed-off-by: Fawzi E. Abdulfattah <iifawzie@gmail.com>
2021-07-15 00:02:57 +02: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
8d0c2a339c
Move both operands of an assignment to the same line
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-04-20 22:35:21 -03:00
William Desportes
7aabad9b7a
Move queries from Operations class to the Query\Generator class
Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-03-06 02:11:25 +01:00