Commit Graph

423 Commits

Author SHA1 Message Date
Kamil Tekiela
f58c647271 Refactor $extraData and show_as_php
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-08-15 10:51:07 +01:00
Kamil Tekiela
262905fcf1 Refactor routine execution
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-08-15 10:50:31 +01:00
Kamil Tekiela
95a98ccd04 Constructor property promotion - risky
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-08-14 23:24:49 +01:00
Maurício Meneghini Fauth
c8a50637f4
Remove Template and ResponseRenderer dep from Routines class
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-07-24 15:04:53 -03:00
Maurício Meneghini Fauth
212e115c2e
Extract response handling from Routines::handleRequestCreateOrEdit()
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-07-24 13:51:29 -03:00
Maurício Meneghini Fauth
3cc69d6860
Extract response handling from Routines::handleExecuteRoutine()
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-07-24 12:08:02 -03:00
Maurício Meneghini Fauth
2623661650
Inline the Routines::handleExecute() method
Moves the response handling to controller.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-07-24 11:29:02 -03:00
Maurício Meneghini Fauth
d35586a562
Inline the Routines::handleEditor() method
Moves the response handling to the controller.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-07-24 11:20:06 -03:00
Maurício Meneghini Fauth
60b8f6c61a
Inline the Routines::export() method
Moves the response handling to the controller.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-07-23 18:28:28 -03:00
Maurício Meneghini Fauth
32b92568f3
Inline the Events::getEditorForm() method
Moves the response handling to the controller.
Removes the dependency on ResponseRenderer and Template from the Events
class.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-07-23 18:28:28 -03:00
Maurício Meneghini Fauth
27f4665a4f
Inline the Events::sendEditor() method
Moves the response handling to the controller.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-07-23 18:28:28 -03:00
Maurício Meneghini Fauth
5a67090559
Extract response handling from Events::handleEditor()
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-07-23 18:28:27 -03:00
Maurício Meneghini Fauth
bcd55bb1ff
Inline the Events::export() method
Moves the response handling to the controller.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-07-23 18:28:27 -03:00
Maurício Meneghini Fauth
22c6a2f9d8
Add a wrapper around the exit language construct
Creates the PhpMyAdmin\ResponseRenderer::callExit() method as a wrapper
to the exit language construct. That makes the tests more correct as the
method will always stop the code execution.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-06-06 21:54:07 -03:00
Maurício Meneghini Fauth
5c9847101c
Merge pull request #18453 from kamil-tekiela/quoteString
Use quoteString in CentralColumns
2023-05-30 14:28:19 -03:00
Kamil Tekiela
42c3d84701 Assume that selected fields/tables are always string
Otherwise we would already be seeing plenty of errors when the values are used as string. Therefore this array must contain only strings.

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-05-25 19:54:36 +01:00
Kamil Tekiela
2c611d0009 Move common code into getWhereInColumns()
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-05-25 19:54:36 +01:00
Kamil Tekiela
e08ba58876 Replace escapeString in CentralColumns
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-05-25 19:54:36 +01:00
Maurício Meneghini Fauth
74b1ffbf8c
Merge the DB and table trigger controllers
They are equivalent in current form.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-05-25 15:39:36 -03:00
Kamil Tekiela
fa826f737a Implement InsertEditColumn
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-05-23 15:31:46 +01:00
Kamil Tekiela
fccaaf65a3 Remove all new Psalm issues
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-05-19 16:33:01 +01:00
Kamil Tekiela
231ec1ba8b Remove QBE
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-05-19 11:21:46 +01:00
Maurício Meneghini Fauth
e1398f3402
Merge pull request #18424 from kamil-tekiela/Unused-params
Remove unused params
2023-05-18 20:30:57 -03:00
Kamil Tekiela
0dce80a459
Split Util::getSupportedDatatypes (#18420)
* Split Util::getSupportedDatatypes

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Add test for getSupportedDatatypes

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

---------

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-05-17 14:49:06 -03:00
Kamil Tekiela
15a83c32af $db in addNewRelation()
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-05-12 22:50:32 +01:00
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
Maurício Meneghini Fauth
20d206a705
Merge pull request #18412 from kamil-tekiela/ShortenElseIfRector
Shorten else/if to elseif
2023-05-12 11:16:00 -03:00
Kamil Tekiela
dc471985b9
Short boolean conditions (#18413)
* Short boolean conditions

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Simplify conditions

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

---------

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-05-12 11:09:21 -03:00
Kamil Tekiela
c94657bf77 Use empty string as sentinel instead of false
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-05-12 12:36:55 +01:00
Kamil Tekiela
176645be7b Shorten else/if to elseif
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-05-12 00:12:58 +01:00
William Desportes
66f607c608
Merge branch 'QA_5_2'
Signed-off-by: William Desportes <williamdes@wdes.fr>
2023-05-04 22:30:56 +02:00
William Desportes
a88c9a3dc0
Fix functions/routines modal contents truncated
Related to 5a2baf607f
Related to https://github.com/phpmyadmin/sql-parser/pull/438

Signed-off-by: William Desportes <williamdes@wdes.fr>
2023-04-22 14:52:14 +02: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
Kamil Tekiela
74c48a499b Fix error in normalization
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-03-19 21:56:01 +00:00
Maurício Meneghini Fauth
f13bd41bac
Merge pull request #18247 from kamil-tekiela/Native-param-types
Native param types
2023-03-17 17:52:45 -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
3774c29604 Fix implicit nulls
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-03-17 12:45:18 +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
Maximilian Krög
79ab3dfe11
Fix some comment typos
Signed-off-by: Maximilian Krög <maxi_kroeg@web.de>
2023-03-16 21:26:19 +01:00
Kamil Tekiela
df9d76e2a2 Use quoteString in Events
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-03-03 17:37:44 -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
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
47846068fa
Remove some useless comments
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-20 23:45:06 -03:00