Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#2281 closed defect (bug) (wontfix)

Massive Code Cleanup: streams.php, vars.php

Reported by: markjaquith Owned by: markjaquith
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)

patch.diff (13.3 KB) - added by markjaquith 7 years ago.

Download all attachments as: .zip

Change History (6)

comment:1   ryan7 years ago

  • Milestone changed from 2.0.1 to 2.1

Let's put this off until after 2.0.1.

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.

  • 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

comment:4   ryan7 years ago

  • 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.

  • Milestone 2.1 deleted
Note: See TracTickets for help on using tickets.