Commit Graph

148 Commits

Author SHA1 Message Date
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
924fcc79f9 Refactor logic for getting Tracking status
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-03-17 22:36:21 +00:00
Kamil Tekiela
c0b367cc57 Create Tracking namespace
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-03-17 22:35:32 +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
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
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
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
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
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
8b0cf8c16c Remove dependancy in Database/StructureController
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-12-16 20:58:47 +00:00
Maurício Meneghini Fauth
f103bdc1e2
Replace $_REQUEST with ServerRequest in Util::getDbInfo()
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-11-08 00:06:25 -03: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
Sebastian Walther
d569fe2f05 Use ServerRequestObject to access POST-vars
Signed-off-by: Sebastian Walther <swalther@complex-it.de>
2022-10-20 01:23:50 -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
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
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
d84af02945
Create VO classes for each RelationParameters features
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-12-26 19:17:58 -03:00
Maurício Meneghini Fauth
fa5c684f27
Replace the master/slave terminology
Replaces master with primary and slave with replica.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-12-18 14:26:56 -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
Maurício Meneghini Fauth
c4575fd48b
Add methods to check for RelationParameters features
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-12-11 08:10:40 -03:00
Kamil Tekiela
f446e6da88 Remove unused variables
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2021-12-03 15:12:56 +00:00
Maurício Meneghini Fauth
b2a51c4d84
Create the RelationParameters value object
Replaces the $cfgRelation array with the RelationParameters value
object.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-11-14 18:22:36 -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
9f3510d11a
Add bool return type where possible
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-14 20:11:51 -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
e3554879ef
Extract actions from controllers to new controllers
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-07 21:19:43 -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
Josep Sanz
de1c381f23
Add suport to the Mroonga engine: with this patch you can see the size
of the Mroonga's tables

Apply an optimization suggested

In reality, I have applied 2 optimizations, the first consists in filter by the object type as @williamdes suggested to me and the second is because we don't need to store all data of each mroonga object, we only need the name of the object that is used to compare with the tables names, thanks @williamdes by the optimization idea

Signed-off-by: Josep Sanz <josep.sanz@saltos.org>
2021-07-11 21:22:06 +02: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
Maurício Meneghini Fauth
011915fe7b
Add the redirect method to controllers
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-05-07 12:23:26 -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
Maurício Meneghini Fauth
b4effdd7f9
Rename Database\StructureController vars to use camel case
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-04-18 13:34:05 -03:00
William Desportes
38422023c5
Merge branch 'QA_5_1'
Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-03-27 01:55:59 +01:00
William Desportes
702a9a444d
Fix "Undefined index: target_db" reported on the error reporting server
Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-03-27 01:10:46 +01: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
Maurício Meneghini Fauth
caa3337411
Extract FK related methods from Util class
Creates the PhpMyAdmin\Utils\ForeignKey class.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-03-21 15:25:45 -03:00
Maurício Meneghini Fauth
c0e85ed76c
Add flash message support for db structure controller
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-03-20 18:56:35 -03:00