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

18 Commits

Author SHA1 Message Date
Andreas Möller
59c070f557 Enhancement: Enable blank_line_after_opening_tag fixer (#875) 2023-12-07 16:57:19 +01: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
d9bcfed482 Enhancement: Enable array_syntax fixer
Co-authored-by: MathiasReker <mathias@reker.dk>

Closes GH-659.
2022-08-22 18:59:14 +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
Sara Golemon
2735e5f03f Swap uses of _SERVER[DOCUMENT_ROOT] for __DIR__
1/n - Update / and /include/ only.
2019-05-31 11:19:09 -04:00
Peter Kokot
e235f79473 Trim trailing whitespace
This patch cleans all redundant trailing whitespace across the
repository except for the icalendar files.
2018-10-17 10:51:08 +02:00
Peter Kokot
0f95b8c709 Remove unused Git attributes ident
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.

In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.

This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
2018-10-17 07:29:46 +02:00
Adam Harvey
025cd0e346 Add some style overrides to improve the credit styling on the beta site. 2012-09-07 11:53:08 +08:00
Hannes Magnusson
60d5c3b903 Add current config option (ignored in old-web), and FIXME placeholders for pages
not in any menu yet
2010-12-28 11:09:09 +00:00
Gabor Hojtsy
97764145fd Fix for a PHP bug here... Now sites with an actual PHP set up will
have an XHTML 1.0 strict compatible credits page
2003-08-07 15:07:18 +00:00
Gabor Hojtsy
02655718a2 Add credits page syles to the sitewide CSS rules, and move the credits
page to the new CSS based layout...
2003-08-07 11:12:44 +00:00
Gabor Hojtsy
3d8273c020 Reformatting, adding comments, and support for
base href.
2003-07-28 09:25:51 +00:00
Gabor Hojtsy
e2a983bbd3 Minor style corrections 2001-07-01 17:17:52 +00:00
Colin Viebrock
06640e881e Credits open in the main window again ... use smarts to strip off unneeded
HTML.
2001-03-09 19:47:44 +00:00
Colin Viebrock
0339e510a9 pop up credits in their own, non-layed-out page 2001-03-09 04:38:54 +00:00
Zeev Suraski
f50ed5da8c Center credits and fix copyright notice 2001-03-08 08:55:13 +00:00
jim winstead
33c01cb600 here goes nothing. the new php site look. let the torrent of
bitter and angry "i hate change" emails begin.
2001-03-08 00:18:15 +00:00
Zeev Suraski
818fbbb14c Add .php files 2000-05-22 18:30:01 +00:00