1
0
mirror of https://github.com/php/web-php.git synced 2026-03-23 23:02:13 +01:00
Commit Graph

11698 Commits

Author SHA1 Message Date
Ayesh Karunaratne
c1dce9083b Minor optimizations in CSS files to shed some weight (#612)
- Removes px suffix from 0px.
 - Combines CSS properties where they are immediately overridden in the same selector block, or can be combined without side effects.

 This saves about 50 bytes off the CSS scripts. it ain't much but it's honest work
2022-07-05 11:38:25 +01:00
Sergey Panteleev
90cc484d04 Postponement PHP Russia 2022 to November (#611) 2022-07-05 11:40:48 +03:00
Ayesh Karunaratne
746d3d71ef HTML A11y improvements in add-note.php, my.php and vote-note.php
Also use strict comparison in pages that are changed.

Closes GH-610.
2022-07-04 13:25:36 +02:00
Ayesh Karunaratne
d40890db1b Micro Optimizations - Round #2
* .gitignore: Remove redundant entry

* Minor optimizations with ternary operators

* Use `const` instead of `define()` where appropriate

`const` is quite faster because of the compile-time optimizations. Because the replaced statements are not declaring constant conditionally, it's safe to use `const` in all of these places.

Closes GH-608.
2022-07-03 20:33:22 +02: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
Ayesh Karunaratne
38d4e0721c phpversion() replacements and code branch collapsing for older PHP versions
Closes GH-600.
2022-07-02 12:37:14 +02:00
Andreas Möller
c3f9653226 Remove useless function manual_header()
Closes GH-584.
2022-07-02 11:53:37 +02:00
Javier Eguiluz
7f4ecb06f2 Announce SymfonyWorld Online 2022 Winter Edition conference
Closes GH-597.
2022-07-01 18:38:29 +02:00
Javier Eguiluz
007d9cc997 Announce SymfonyCon Disneyland Paris 2022 conference
Closes GH-596.
2022-06-30 18:34:39 +02:00
Kamil Tekiela
1a7521e738 Refactor manual_notes() (#592) 2022-06-29 22:36:16 +01:00
Kamil Tekiela
0b217c0271 Move ManualNotesSorter to src/ (#593) 2022-06-29 22:24:09 +01:00
Levi Morrison
67c7fe15fa Use accent color for hero buttons (#591)
I've always wanted the accent to be used more, but it's kind of hard.
I think this is a great opportunity for it!
2022-06-29 20:46:04 +01:00
Andreas Möller
d6f23ea19b Fix: Move class into src/ (#581) 2022-06-29 19:03:25 +01:00
Andreas Möller
98430dbeb5 Avoid variable function invocation
Closes GH-586.
2022-06-29 18:36:38 +02:00
Andreas Möller
65254462c6 Fix: Remove extra closing tag
Closes GH-589.
2022-06-29 11:43:33 +02:00
Andreas Möller
c6fecd8529 Fix: Add type and return type declaration (#587) 2022-06-28 22:13:58 +01:00
Andreas Möller
c73856319c Remove arguments identical to default values of parameters
Closes GH-583.
2022-06-28 18:51:03 +02:00
Andreas Möller
879d410643 Inline unnecessary local variables
Closes GH-582.
2022-06-28 18:47:39 +02:00
Andreas Möller
1e7a49e268 Fix: Remove unused local variables
Closes GH-578.
2022-06-28 15:25:35 +02:00
Kamil Tekiela
b2ff80507c Remove get_magic_quotes_gpc (#575) 2022-06-28 13:57:16 +01:00
Andreas Möller
9fc38ed6e4 Fix: Remove unused local variable
Closes GH-576.
2022-06-28 14:56:29 +02:00
Andreas Möller
d3876f68ea Fix: Remove unused parameter
* Fix: Remove unused parameter
* Fix: Remove unused local variable

Closes GH-574.
2022-06-28 14:50:11 +02:00
Andreas Möller
5e659e0dc4 Fix: Remove parameter where argument is never specified
Closes GH-573.
2022-06-28 14:40:31 +02:00
Andreas Möller
30796f6f06 Fix: Remove unused parameter
Closes GH-571.
2022-06-28 14:32:24 +02:00
Andreas Möller
1c2bd8ad42 Fix: Remove unused parameter
Closes GH-572.
2022-06-28 14:27:56 +02:00
Andreas Möller
22fffaad7a Fix: Remove unused references to a global variable (#563) 2022-06-28 13:20:52 +01:00
Kamil Tekiela
996c06e1bc Remove old countries lists (#569) 2022-06-28 12:46:27 +01:00
Kamil Tekiela
4e251d6993 Remove duplicated !isset($var) (#570) 2022-06-28 12:45:50 +01:00
Mathias Reker ⚡️
6f06ab9a28 Short scalar cast (#531) 2022-06-28 12:09:43 +01:00
Kamil Tekiela
fa3391b9dc Refactor compare_version function (#568) 2022-06-28 11:30:39 +01:00
Kamil Tekiela
1435387ce2 Redesign Docs.php (#567)
* Fixed typo

* Move PHP 4 & 5 links to "more documentation"

* Change paragraph about URL and move down

* Remove duplication
2022-06-28 10:01:56 +01:00
Christoph M. Becker
cc81e8e340 Drop useless documentation table
Closes GH-560.
2022-06-27 23:55:23 +02:00
Kamil Tekiela
a6c79eca2e Remove fetch_contents and fetch_header (#566) 2022-06-27 22:49:22 +01:00
Andreas Möller
139d12d908 Fix: Remove useless function
Closes GH-562.
2022-06-27 23:41:53 +02:00
Andreas Möller
e5ad28094f Fix: Remove duplicate key-value pairs (#565) 2022-06-27 21:06:30 +01:00
Andreas Möller
8fbbe3bb89 Fix: Remove unused private property (#561) 2022-06-27 19:24:21 +01:00
Andreas Möller
51b196dff8 Enhancement: Add .editorconfig
Closes GH-554.
2022-06-27 19:15:41 +02:00
Andreas Möller
c40cac09f2 Remove superfluous note
Closes GH-558.
2022-06-27 16:13:23 +02:00
Pierrick Charron
144acf6e9c Announce PHP 8.2.0alpha2 2022-06-23 11:04:29 -04:00
Mathias Reker ⚡️
546b144fe3 Use elseif instead of else if
Closes GH-534.
2022-06-17 19:19:12 +02:00
Mathias Reker ⚡️
530b28e95b Add void return types
Add void return type to functions with missing or empty return statements.

Closes GH-535.
2022-06-17 19:16:52 +02:00
Mathias Reker ⚡️
ede0cad42f Ternary to null coalescing
Use null coalescing operator ?? where possible.

Closes GH-528.
2022-06-17 18:43:40 +02:00
Mathias Reker ⚡️
89ac76cd81 No alias functions
Canonical functions shall be used instead of aliases.

Closes GH-530.
2022-06-17 17:14:03 +02:00
Mathias Reker ⚡️
7dd64e1b79 No spaces inside parenthesis
For consistency with the rest of the code.

Closes GH-551.
2022-06-17 16:47:11 +02:00
Andreas Möller
0cfc90abf2 Allow copying and pasting commands to set up the local development environment
Closes GH-552.
2022-06-17 16:44:11 +02:00
Mathias Reker ⚡️
855860ae25 Single blank line at eof
A PHP file without end tag should always end with a single empty line feed.

Closes GH-541.
2022-06-17 16:36:32 +02:00
Mathias Reker ⚡️
11866535bf Combine consecutive issets
Using isset($var) && multiple times should be done in one call.

Co-authored-by: Andreas Möller <am@localheinz.com>

Closes GH-542.
2022-06-17 16:29:04 +02:00
Andreas Möller
32f5a0283c Fix wording (repo → repository)
Closes GH-553.
2022-06-17 16:17:58 +02:00
Mathias Reker ⚡️
63f1e9d004 No superfluous elseif
Replaces superfluous elseif with if.

Closes GH-549.
2022-06-17 16:00:47 +02:00
Lucas Azevedo
bab1fa9a92 Add home page social preview (#524) 2022-06-15 12:49:23 +03:00