Manual talk:Coding conventions

From MediaWiki.org

Jump to: navigation, search

[edit] Globals and Top-Level Functions

Since Manual:Global variables discourages the use of globals, this Manual:Coding conventions should encourage the use of static class members and functions in lieu of globals and top-level functions. Instead of

$wgVersion;
$wgTitle;
 
function wfFuncname() { ... }

it could encourage

class SomeClass {
    public static $version;
    public static $title;
 
    public static function funcname() { ... }
}

Sledged (talk) 19:23, 5 March 2008 (UTC)

Personal tools