1
0
mirror of https://github.com/php/web-php.git synced 2026-03-25 15:52:08 +01:00
Commit Graph

27 Commits

Author SHA1 Message Date
Maurício Meneghini Fauth
cdf59074d3 Replace languages.inc globals with I18n\Languages consts (#1121)
The include/languages.inc file was not removed as it's used in other
repositories. It should be removed after migration.

Tests were added to ensure that the global variables and the constants
are in sync with each other.

Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
2024-11-14 11:37:00 +03:00
Maurício Meneghini Fauth
817a3e7fd9 Move myphpnet_* functions to the UserPreferences class (#1075) 2024-11-11 11:50:15 +03:00
Lucas Azevedo
b62f99f6de Update navbar design and improve search UI (#1084)
Co-authored-by: Gina Peter Banyard <girgias@php.net>
Co-authored-by: Sergey Panteleev <sergey@php.net>
2024-11-02 17:39:04 +03:00
Takuya Aramaki
38ef33f923 Move language_choose_code() into new LangChooser class (#1081) 2024-10-14 18:48:22 +05:00
Maurício Meneghini Fauth
f252981e5b Replace MYPHPNET global var with the UserPreferences class (#1071) 2024-09-17 15:55:10 +08:00
Andreas Möller
7b2c9af6c0 Fix: Run 'make coding-standards' 2023-12-07 11:45:47 +00:00
Andreas Möller
c093fb5382 Enhancement: Enable trailing_comma_in_multiline fixer (#647)
* Enhancement: Enable and configure trailing_comma_in_multiline fixer

* Fix: Run 'make coding-standards'
2023-12-06 23:16:28 +00:00
Andreas Möller
9709f819a4 Enhancement: Enable class_definition fixer (#863) 2023-12-06 15:11:49 +01:00
Andreas Möller
d36359230f Enhancement: Mark class as readonly (#861) 2023-12-06 14:59:15 +01:00
Andreas Möller
878429e644 Enhancement: Use constructor property promotion (#858) 2023-12-06 14:54:37 +01:00
Lu Fei
bf7eff4a9c Fix autoload redirect failure (#788) 2023-06-26 14:19:29 +01:00
Kamil Tekiela
9752e1b90d Introduce UserNote DTO and refactor Sorter (#594) 2022-09-16 12:47:04 +01:00
Andreas Möller
2ae10ff262 Enhancement: Enable and configure increment_style fixer
Co-authored-by: Mathias Reker <mathias@reker.dk>

Closes GH-698.
2022-09-12 15:27:05 +02:00
Andreas Möller
1ebc2c4996 Enhancement: Enable binary_operator_spaces fixer
Closes GH-667.
2022-08-22 19:17:38 +02:00
Andreas Möller
d9bcfed482 Enhancement: Enable array_syntax fixer
Co-authored-by: MathiasReker <mathias@reker.dk>

Closes GH-659.
2022-08-22 18:59:14 +02:00
Andreas Möller
c304829d21 Enhancement: Enable and configure class_attributes_separation fixer
Closes GH-643.
2022-08-22 18:00:08 +02:00
Andreas Möller
f127de5db9 Enhancement: Enable strict_param fixer
We set strict param to false to ensure current behavior,
except for two cases where it is safe to go with true.

Closes GH-658.
2022-07-15 14:48:44 +02:00
Andreas Möller
b3c9551c93 Enhancement: Enable no_extra_blank_lines fixer
Closes GH-646.
2022-07-12 14:26:18 +02:00
Andreas Möller
a35d47d060 Enhancement: Enable ordered_class_elements fixer
Closes GH-641.
2022-07-12 12:39:00 +02:00
Andreas Möller
c68e5a9e4a Enhancement: Enable single_space_after_construct fixer
Closes GH-640.
2022-07-12 11:44:23 +02:00
Andreas Möller
f3585d9bdf Enhancement: Enable indentation_type fixer
Closes GH-622.
2022-07-11 20:34:20 +02:00
Andreas Möller
ba92fc90a2 Enhancement: Enable visibility_required fixer
Closes GH-639.
2022-07-11 20:16:40 +02:00
Andreas Möller
e45bf2b782 Fix: Remove unused methods
Closes GH-607.
2022-07-11 18:41:46 +02:00
Kamil Tekiela
c6acddf116 Remove id prefix (#618) 2022-07-06 15:27:20 +01:00
Ayesh Karunaratne
1b83fd7ab7 Multiple micro-optimizations
* Replace `ob_get_contents();ob_clean()` with `ob_get_clean()`

`ob_get_clean()` is equivalent to `ob_get_contents()` followed by `ob_clean()`.

* Replace `intval()` calls with `(int)` type cast

This is a micro-optimization because `intval()` is a function call, and the type cast is about 6 times fast.

* Replace `preg_replace` call that could be done with an `rtrim()` call

In `./error.php`, there is a `preg_replace('!/+$!', '', $URI);` call that essentially is equivalent to `rtrim()`, that both calls removing trailing slash characters in `$URI`.
The `rtim()` call is more legible and faster.

* Combine consecutive `str_replace` calls to a single `str_replace` call

* Use short ternary operator where possible

Improves code readability.

* Cascade various `else` statements where possible

Cleans up the code by removing unnecessary `else` blocks and moving the code to the parent context if the previous `if` block exits the function by either terminating the script, or with a `return` statement.

* Combine multiple `isset()` calls to a single `isset()`

`isset()` accepts multiple parameters and returns `true` only if all of the parameters are `isset`. It makes sense to combine multiple individual `isset` calls to a single call for better readability.

* Replace `for` loop with a `foreach` loop

* Remove unnecessary character escapes in regular expressions

Regular expression special characters are context-sensitive. For example, special characters such as `.` are not considered special within square braces (`[]`).
This removes several of such instances that certain characters are escaped, but it is not strictly necessary within the context. This improves the readability of the expression.

See more information at [PHP.Watch: Writing better Regular Expressions in PHP](https://php.watch/articles/php-regex-readability#reduce-escape)

* Remove unnecessary break statement

* Remove unnecessary PHP close tags

* Remove redundant JSON_ERROR_NONE check

Remove unnecessary `json_last_error() == JSON_ERROR_NONE` where the decoded object is inspected already.

Closes GH-603.
2022-07-03 12:24:14 +02:00
Kamil Tekiela
0b217c0271 Move ManualNotesSorter to src/ (#593) 2022-06-29 22:24:09 +01:00
Andreas Möller
d6f23ea19b Fix: Move class into src/ (#581) 2022-06-29 19:03:25 +01:00