#2281 closed defect (bug) (wontfix)
Massive Code Cleanup: streams.php, vars.php
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Administration | Version: | 2.0 |
| Severity: | normal | Keywords: | massive-code-cleanup bg|has-patch bg|commit |
| Cc: |
Description
The detail obcession continues.
As before, the bulk of the work consists of:
- spaces to tabs
- two newlines between functions
- brackets removed for one-line if ()s
- \t\n => \n
- [space]\n => \n
- \t[space] => \t
- no cramming two lines into one.
- if/else bracket tab matching
- foreach : endforeach; and if : else; are for front-of-house code only
- clean spacing for if, foreach, and for: if ( $condition ) {
- if ( $something == 'value' ) => if ( 'value' == $something ) as per coding guidelines
Also, vars.php was using preg_match and strstr for "does this string exist in that string" test. According to php.net, these should not be used for this purpose, as they are slower. The method to use is strpos($haystack, $needle) !== false
I convented the browser checks in vars.php to use this faster method.
Attachments (1)
Change History (6)
comment:2
markjaquith — 7 years ago
Roger. As soon as we have a stable 2.0.x version, I'm going to do a major refactoring, before major work for 2.1 begins.
markjaquith — 7 years ago
comment:3
markjaquith — 7 years ago
- Owner changed from anonymous to markjaquith
- Status changed from new to assigned
- Summary changed from Massive Code Cleanup: registration-functions.php, streams.php, vars.php to Massive Code Cleanup: streams.php, vars.php
- Resolution set to wontfix
- Status changed from assigned to closed
Out-of-date. Let's close this bug and continue the cleanups in a new bug.
Note: See
TracTickets for help on using
tickets.

Let's put this off until after 2.0.1.