Commit Graph

48 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
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
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
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
caf19897ac
Remove crossFramingProtection from the Window global
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-11-28 23:43:35 -03:00
Maurício Meneghini Fauth
b2971d618f
Import the AJAX object where possible
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-11-24 15:21:18 -03:00
Maurício Meneghini Fauth
6f54621b41
Create a shared.js file for common JS dependencies
Instead of using the Webpack's dependOn setting, uses the splitChunks
setting to automatically generate the shared.js file.

As the contents of these shared dependencies are being moved to the
shared.js file, the generated file for each dependency is now empty.

Is probably safe to not generate them, but some adjustments are needed
for that first. For example, the AJAX's onload and teardown functions
expects that some of these files exists.

For now, only dependencies that are loaded for all pages should be added
in this shared.js file.

This will facilitate the refactoring of the JS files, but the trade off,
at least for now, is that will be a single large file instead of a few
medium ones.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-11-24 14:43:24 -03:00
Maurício Meneghini Fauth
80b5358bc0
Add an unit test for Header::addDefaultScripts()
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-11-24 14:34:10 -03:00
Maurício Meneghini Fauth
87d695f2c8
Extract js/messages.php entry point into a route
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-08-06 22:25:32 -03:00
Maurício Meneghini Fauth
a8ca6894a7
Create the validator-messages.js file
- Extracts the validator messages from the javascript/variables template
  into a new file.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-02-15 15:13:59 -03:00
Maurício Meneghini Fauth
b86b70d639
Improve type definitions of Scripts class
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-11-18 15:25:00 -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
6ae07c96fb
Replace strpos !== false with str_contains
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-07-09 22:30:42 -03:00
Maurício Meneghini Fauth
33d711215d
Remove the PMA_VERSION constant
Uses the PhpMyAdmin\Version::VERSION constant instead.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-03-08 22:22:55 -03:00
Maurício Meneghini Fauth
86b6fb5817
Rename variables to use the camel case format
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-03-06 01:29:46 -03:00
Maurício Meneghini Fauth
d83abf63e7
Use PSR-12 for control structures spacing
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-03-05 15:27:03 -03:00
William Desportes
d63a72ad51
Fixes #16278 - Remove underscore prefix from property names
Signed-off-by: William Desportes <williamdes@wdes.fr>
2020-08-06 15:46:39 +02:00
Maurício Meneghini Fauth
b30f06455c Remove the blacklist/whitelist terminology
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2020-06-15 17:51:24 -03:00
charliewindred
ca3c5e17b0 Remove underscore prefix from method names
Removed underscore from method names for PSR-12 compliance.
Signed-off-by: charliewindred <charliewindred@gmail.com>
2020-06-02 16:44:16 +01:00
Maurício Meneghini Fauth
3baad2eb1c Fix some coding standard issues
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2020-05-25 22:42:37 -03:00
Maurício Meneghini Fauth
a64393e7f5 Fix some coding standard issues
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2020-05-13 00:23:28 -03:00
Thomas Decaux
3760272baf Add missing base_dir when adding javascript files
Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
2020-04-13 16:51:51 +02:00
Maurício Meneghini Fauth
676f48349a Reference global funcs and consts via use statement
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2020-01-21 22:13:36 -03:00
Maurício Meneghini Fauth
f80d3e3bd4 Remove unnecessary annotations
@package, @subpackage and others.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2020-01-20 17:35:56 -03:00
Maurício Meneghini Fauth
6283caaabf Use one line for comments with a single line
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2020-01-20 16:04:09 -03:00
Maurício Meneghini Fauth
39f42f848b Remove some useless docblock comments
Fixes docblock spacing

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2019-12-13 21:15:00 -03:00
Maurício Meneghini Fauth
77518d341e Remove unused use statements
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2019-12-11 21:20:58 -03:00
Maurício Meneghini Fauth
dd06cd38f8 Defines rules for double quote usage
Makes sure that any use of double quotes strings are warranted.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2019-12-01 14:10:07 -03:00
Maurício Meneghini Fauth
1a14b3e4d3 Remove vim modelines
These settings are no longer required as they are guaranteed through
other coding standard tools.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2019-09-02 09:43:21 -03:00
Maurício Meneghini Fauth
5abc69c280 Extract HTML from Scripts::getDisplay()
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2019-04-19 21:47:27 -03:00
Maurício Meneghini Fauth
21e2ca4c4c Fix some PHPStan and phpcs errors
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2019-03-19 15:17:41 -03:00
Maurício Meneghini Fauth
23c3579804 Format array declarations
Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
2019-01-07 14:31:39 -02:00
Maurício Meneghini Fauth
4cee0cbc12 Adds space after not (!) and type cast
Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
2019-01-05 21:56:34 -02:00
Maurício Meneghini Fauth
285e38e931 Fix some PSR-2 coding standard errors
Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
2018-05-30 09:07:56 -03:00
Maurício Meneghini Fauth
b9c0463d96 Use short array syntax instead of long array syntax
Replaces array() with [].

Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
2018-05-30 01:42:21 -03:00
Maurício Meneghini Fauth
6cf8ee0831 Enable strict mode in some classes
Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
2018-05-15 01:03:57 -03:00
Maurício Meneghini Fauth
c930c7a030 Fix coding standard errors
Automatic fixes by phpcbf.

Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
2017-12-04 13:40:36 -02:00
Michal Čihař
5346416625 Simplify Scripts::addFile API
Removed unused parameter to define ordering of scripts.

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-11-29 15:09:43 +01:00
Michal Čihař
8fbe46f3e8 Remove usage of get_scripts.js.php wrapper
- this adds significant overhead in sending static files from the server
- the benefit of joining requests is minimal since introduction of HTTP/2
- the onload handlers are now fired directly by individual scripts, what
  makes them really execute when the script is loaded (it could be
  previously executed earlier in case of chunked loading)

Fixes #13840

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-11-29 15:09:43 +01:00
Michal Čihař
e572e43f03 Avoid using mbstring function on filename
We do not have multibyte filenames...

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-11-27 14:40:03 +01:00
Michal Čihař
9d99c637e4 Remove not needed condition
It is always true.

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-11-27 14:33:13 +01:00
Michal Čihař
3a00028ecb Generate scripts as an array and concatenate once
This avoids recalculating the result string several times.

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-11-27 14:30:50 +01:00
Michal Čihař
cedad5f931 Remove sprites from the themes
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-11-13 14:12:12 +01:00
Maurício Meneghini Fauth
1d4125f15c Add array type declarations
Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
2017-09-24 23:49:59 -03:00
Michal Čihař
8621b70c88 Various coding style fixes
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-08-23 15:43:54 +02:00
Maurício Meneghini Fauth
ca910e8de8 Move classes to PhpMyAdmin namespace
- Move Table to PhpMyAdmin namespace
- Move Template to PhpMyAdmin namespace
- Move ThemeManager to PhpMyAdmin namespace
- Move Theme to PhpMyAdmin namespace
- Move Tracker to PhpMyAdmin namespace
- Move Transformations to PhpMyAdmin namespace
- Move TypesMySQL to PhpMyAdmin namespace
- Move Types to PhpMyAdmin namespace
- Move Util to PhpMyAdmin namespace
- Move VersionInformation to PhpMyAdmin namespace
- Move Url to PhpMyAdmin namespace

Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
2017-07-08 10:54:21 -03:00
Maurício Meneghini Fauth
8f943ae1c0 Move classes to PhpMyAdmin namespace
- Move Sanitize to PhpMyAdmin namespace
- Move SavedSearches to PhpMyAdmin namespace
- Move Scripts to PhpMyAdmin namespace
- Move ServerStatusData to PhpMyAdmin namespace
- Move Sql to PhpMyAdmin namespace
- Move StorageEngine to PhpMyAdmin namespace
- Move SubPartition to PhpMyAdmin namespace
- Move SysInfoLinux to PhpMyAdmin namespace
- Move SysInfoSunOS to PhpMyAdmin namespace
- Move SysInfoWINNT to PhpMyAdmin namespace
- Move SysInfo to PhpMyAdmin namespace
- Move SystemDatabase to PhpMyAdmin namespace

Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
2017-07-07 01:46:08 -03:00