So it's sometimes best to break them up by means of temporary variables.ĭo not write "blocks" as a single-line. Using an amount of indentation different to that used by the body makes it more clear that the conditional part is not the body, but this is not universally observed.Ĭontinuation of conditionals and very long expressions tend to be ugly whichever way you do them. Opinions differ on the amount of indentation that should be used for the conditional part. getParamValue ( 'printable' ) != 'yes' ) getParamValue ( 'redirect' ) != 'no' & mw. get ( 'wgNamespaceNumber' ), whitelistedNamespaces ) != - 1 & mw. The else/elseif is placed on the same line as the previous closing brace. Braces are placed on the same line as the start of the function, conditional, loop, etc. MediaWiki's indenting style is similar to the so-called " One True Brace Style". require_once, require) where they are not necessary.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |