Coding Standard - PHP - HL Vanilla Community
<main> <article class="userContent"> <p>As of May 2014, Vanilla will adhere to <a href="https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md" rel="nofollow noreferrer ugc">PSR-2</a> (and therefore <a href="https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md" rel="nofollow noreferrer ugc">PSR-1</a>) with a few exceptions. We have been mass-updating our source code as possible without breaking backwards compatibility (most notably by refraining from changing the casing of existing variables).</p><p>We’ve named our primary exception to PSR-2 the <a href="https://twitter.com/linc/status/462308222427480065" rel="nofollow noreferrer ugc"><strong>Lord Brackos</strong></a> rule - Same-line open braces on all classes, method, and function definitions.</p><p>We adopted this standard for all the usual reasons: our team is growing, and we want to make sure things stay consistent between our various projects, and it’s annoying and hard to read when everything is styled differently. Key words in this document (“MUST”, “SHOULD”, etc.) are used as described in <a href="http://www.ietf.org/rfc/rfc2119.txt" rel="nofollow noreferrer ugc">RFC 2119</a> which is as boring and obvious as you expect but mercifully brief.</p><h2 data-id="php-version">PHP Version</h2><p>All code in <code class="code codeInline" spellcheck="false" tabindex="0">master</code> must work under PHP 7.2, but we strongly recommend using 7.4.</p><p>For up-to-date information you can look at our <a href="https://github.com/vanilla/vanilla/tree/master#self-hosting-requirements" rel="nofollow noreferrer ugc">self-hosting-requirements</a> section.</p><h2 data-id="validating-your-php-code">Validating your PHP code</h2><p>CodeSniffer is a tool you can plug into your IDE or run from the command line to help you adhere to a coding standard like this one. Vanilla ships with codesniffer and our ruleset as composer dependencies.</p><h3 data-id="codesniffer-phpstorm-integration">CodeSniffer PHPStorm Integration</h3><ol><li>Go to your PHP Preferences.</li><li>Navigate to <code class="code codeInline" spellcheck="false" tabindex="0">Editing > Inspections > PHP > Quality Tools > PHP_CodeSniffer Validation </code></li><li>In the right options panel scroll down to <code class="code codeInline" spellcheck="false" tabindex="0">Coding Standard</code>.</li><li>Hit the 3 dot menu.</li><li>Set the composer vendor path to our ruleset.</li><li><code class="code codeInline" spellcheck="false" tabindex="0">REPO_ROOT/vendor/vanilla/standards/code-sniffer/Vanilla</code></li></ol><h3 data-id="codesniffer-from-the-command-line">CodeSniffer from the Command Line</h3><p>We ship a custom composer command for linting code changed in your branch.</p><pre class="code codeBlock" spellcheck="false" tabindex="0">composer lint-diff </pre><h3 data-id="phpstorm-code-style">PHPStorm Code Style</h3><p>In order to enable the PHPStorm <code class="code codeInline" spellcheck="false" tabindex="0">Code > Reformat Code</code> command to be of any use, your PHPStorm <code class="code codeInline" spellcheck="false" tabindex="0">Editor > Code Style > PHP</code> needs to be configured.</p><p><s>Download our code style.</s> This is deprecated.</p><div class="js-embed embedResponsive" data-embedjson="{"url":"https:\/\/us.v-cdn.net\/6030677\/uploads\/T5N6WEAYM4GD\/vanilla-php-codestyle-xml.zip","name":"Vanilla PHP CodeStyle.xml.zip","type":"application\/zip","size":864,"displaySize":"large","float":"none","mediaID":2632,"dateInserted":"2022-04-20T20:37:38+00:00","insertUserID":84,"foreignType":"embed","foreignID":84,"embedType":"file"}"> <a href="https://us.v-cdn.net/6030677/uploads/T5N6WEAYM4GD/vanilla-php-codestyle-xml.zip" download="" aria-label="Vanilla PHP CodeStyle.xml.zip"> Vanilla PHP CodeStyle.xml.zip </a> </div> <ol><li>Navigate to <code class="code codeInline" spellcheck="false" tabindex="0">Editor > Code Style > PHP</code></li><li>Open the Settings/Cogwheel dropdown at the top.</li><li>Use <code class="code codeInline" spellcheck="false" tabindex="0">Import Scheme > Intellij IDEA code style XML</code> to import the downloaded configuration.</li></ol><h2 data-id="1.-overview">1. Overview</h2><ul><li>Code MUST use 4 spaces for indenting, not tabs.</li><li>Opening braces for classes and functions SHOULD be on the same line.</li><li>Control structure keywords MUST have one space after them; method and function calls MUST NOT.</li><li>Opening braces for control structures MUST go on the same line, and closing braces MUST go on the next line after the body.</li><li>Opening parentheses for control structures MUST NOT have a space after them, and closing parentheses for control structures MUST NOT have a space before.</li><li>There MUST NOT be a hard limit on line length; the soft limit MUST be 120 characters; lines SHOULD be 80 characters or less.</li><li>Namespace is not required.</li><li>Files MUST use only <code class="code codeInline" spellcheck="false" tabindex="0"><?php</code> tag.</li><li>Files MUST use only UTF-8 without BOM for PHP code.</li><li>Files SHOULD <em>either</em> declare symbols (classes, functions, constants, etc.) <em>or</em> cause side-effects (e.g. generate output, change .ini settings, etc.) but SHOULD NOT do both.</li><li>Class names MUST be declared in <code class="code codeInline" spellcheck="false" tabindex="0">StudlyCaps</code>.</li><li>Class constants MUST be declared in all upper case with underscore separators.</li><li>Method names SHOULD be declared in <code class="code codeInline" spellcheck="false" tabindex="0">camelCase</code>.</li><li>View files are excluded from this standard. You SHOULD try to follow as many rules as possible.</li></ul><h3 data-id="1.1.-example">1.1. Example</h3><p>This example encompasses some of the rules below as a quick overview:</p><pre class="code codeBlock" spellcheck="false" tabindex="0"><?php /** * @copyright 2009-2014 Vanilla Forums Inc. * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 */ /** * The is the foo class that does foo. * * This is a longer description that spans multiple * lines. */ class Foo extends Bar implements FooInterface { /** * The is the foo class that does foo. * * This is a longer description that spans multiple * lines. * * @param string $a Must be a full sentence. * @param string|null $b Must be a full sentence. * * @return bool */ public function sampleFunction($a, $b = null) { if ($a === $b) { bar(); } elseif ($a > $b) { $foo->bar($arg1); } else { BazClass::bar($arg2, $arg3); } return true; } } </pre><h2 data-id="2.-general">2. General</h2><h3 data-id="2.1.-files">2.1. Files</h3><p>All PHP files MUST use the Unix LF (linefeed) line ending.</p><p>All PHP files MUST end with a single blank line.</p><p>The closing <code class="code codeInline" spellcheck="false" tabindex="0">?></code> tag MUST be omitted from files containing only PHP.</p><p>All view files are excluded from this standard. You SHOULD try to follow as many rules as possible.</p><h3 data-id="2.2.-php-tags">2.2. PHP Tags</h3><p>PHP code MUST use the long <code class="code codeInline" spellcheck="false" tabindex="0"><?php ?></code> tags; it MUST NOT use the other tag variations.</p><h3 data-id="2.3.-character-encoding">2.3. Character Encoding</h3><p>PHP code MUST use only UTF-8 without BOM.</p><h3 data-id="2.4.-side-effects">2.4. Side Effects</h3><p>A file SHOULD declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it SHOULD execute logic with side effects, but SHOULD NOT do both.</p><p>The phrase “side effects” means execution of logic not directly related to declaring classes, functions, constants, etc., <em>merely from including the file</em>.</p><p>“Side effects” include but are not limited to: generating output, explicit use of <code class="code codeInline" spellcheck="false" tabindex="0">require</code> or <code class="code codeInline" spellcheck="false" tabindex="0">include</code>, connecting to external services, modifying ini settings, emitting errors or exceptions, modifying global or static variables, reading from or writing to a file, and so on.</p><p>The following is an example of a file with both declarations and side effects; i.e, an example of what to avoid:</p><pre class="code codeBlock" spellcheck="false" tabindex="0"><?php // side effect: change ini settings ini_set('error_reporting', E_ALL); // side effect: loads a file include "file.php"; // side effect: generates output echo "<html>\n"; // declaration function foo() { // function body } </pre><p>The following example is of a file that contains declarations without side effects; i.e., an example of what to emulate:</p><pre class="code codeBlock" spellcheck="false" tabindex="0"><?php // declaration function foo() { // function body } // conditional declaration is *not* a side effect if (! function_exists('bar')) { function bar() { // function body } } </pre><h3 data-id="2.5.-lines">2.5. Lines</h3><p>There MUST NOT be a hard limit on line length.</p><p>The soft limit on line length MUST be 120 characters; automated style checkers MUST warn but MUST NOT error at the soft limit.</p><p>Lines SHOULD NOT be longer than 80 characters; lines longer than that SHOULD be split into multiple subsequent lines of no more than 80 characters each.</p><p>There MUST NOT be trailing whitespace at the end of non-blank lines.</p><p>Blank lines MAY be added to improve readability and to indicate related blocks of code.</p><p>There MUST NOT be more than one statement per line.</p><h3 data-id="2.6.-indenting">2.6. Indenting</h3><p>Code MUST use an indent of 4 spaces, and MUST NOT use tabs for indenting.</p><p>N.b.: Using only spaces, and not mixing spaces with tabs, helps to avoid problems with diffs, patches, history, and annotations. The use of spaces also makes it easy to insert fine-grained sub-indentation for inter-line alignment.</p><h3 data-id="2.7.-keywords-and-truefalsenull">2.7. Keywords and True/False/Null</h3><p>PHP <a href="http://php.net/manual/en/reserved.keywords.php" rel="nofollow noreferrer ugc">keywords</a> MUST be in lower case.</p><p>The PHP constants <code class="code codeInline" spellcheck="false" tabindex="0">true</code>, <code class="code codeInline" spellcheck="false" tabindex="0">false</code>, and <code class="code codeInline" spellcheck="false" tabindex="0">null</code> MUST be in lower case.</p><h2 data-id="3.-namespace-and-use-declarations">3. Namespace and Use Declarations</h2><p>No requirements.</p><h3 data-id="4.-class-constants-properties-and-methods">4. Class Constants, Properties, and Methods</h3><p>The term “class” refers to all classes, interfaces, and traits.</p><h3 data-id="4.1.-constants">4.1. Constants</h3><p>Class constants MUST be declared in all upper case with underscore separators. For example:</p><pre class="code codeBlock" spellcheck="false" tabindex="0"><?php namespace Vendor\Model; class Foo { const VERSION = '1.0'; const DATE_APPROVED = '2012-06-01'; } </pre><h3 data-id="4.2.-extends-and-implements">4.2. Extends and Implements</h3><p>The <code class="code codeInline" spellcheck="false" tabindex="0">extends</code> and <code class="code codeInline" spellcheck="false" tabindex="0">implements</code> keywords MUST be declared on the same line as the class name.</p><p>The opening brace for the class MUST go on the same line as the class name; the closing brace for the class MUST go on the next line after the body.</p><pre class="code codeBlock" spellcheck="false" tabindex="0"><?php class ClassName extends ParentClass implements \ArrayAccess, \Countable { // constants, properties, methods } </pre><p>Lists of <code class="code codeInline" spellcheck="false" tabindex="0">implements</code> MAY be split across multiple lines, where each subsequent line is indented once. When doing so, the first item in the list MUST be on the next line, and there MUST be only one interface per line.</p><pre class="code codeBlock" spellcheck="false" tabindex="0"><?php class ClassName extends ParentClass implements \ArrayAccess, \Countable, \Serializable { // constants, properties, methods } </pre><h3 data-id="4.3.-properties">4.3. Properties</h3><p>Visibility MUST be declared on all properties.</p><p>The <code class="code codeInline" spellcheck="false" tabindex="0">var</code> keyword MUST NOT be used to declare a property.</p><p>There MUST NOT be more than one property declared per statement.</p><p>Property names SHOULD NOT be prefixed with a single underscore to indicate protected or private visibility.</p><p>A property declaration looks like the following.</p><pre class="code codeBlock" spellcheck="false" tabindex="0"><?php class ClassName { public $foo = null; } </pre><h3 data-id="4.4.-methods">4.4. Methods</h3><p>Method names MUST be declared in <code class="code codeInline" spellcheck="false" tabindex="0">camelCase()</code>.</p><p>Visibility MUST be declared on all methods.</p><p>Method names SHOULD NOT be prefixed with a single underscore to indicate protected or private visibility.</p><p>Method names MUST NOT be declared with a space after the method name. The opening brace MUST go on the same line as the method name, and the closing brace MUST go on the next line following the body. There MUST NOT be a space after the opening parenthesis, and there MUST NOT be a space before the closing parenthesis.</p><p>A method declaration looks like the following. Note the placement of parentheses, commas, spaces, and braces:</p><pre class="code codeBlock" spellcheck="false" tabindex="0"><?php class ClassName { public function fooBarBaz($arg1, &$arg2, $arg3 = []) { // method body } } </pre><h4 data-id="event-method-exception">Event method exception</h4><p>One major exception to this rule is Event Methods. Any method that has the following patterns:</p><pre class="code codeBlock" spellcheck="false" tabindex="0">'_handler', '_create', '_before', '_override', '_after', 'controller_', </pre><p>Event methods MUST be <code class="code codeInline" spellcheck="false" tabindex="0">camelCase</code> separated by <code class="code codeInline" spellcheck="false" tabindex="0">_</code>.</p><h4 data-id="api-method-exception">API method exception</h4><p>Another exception to this rule is <code class="code codeInline" spellcheck="false" tabindex="0">Controller</code> methods. Controllers routed through <code class="code codeInline" spellcheck="false" tabindex="0">ResourceRoute</code> may have methods prefixed with any of the following:</p><pre class="code codeBlock" spellcheck="false" tabindex="0">'get_', 'patch_', 'post_', 'index_', 'put_', 'options_', 'delete_', </pre><h3 data-id="4.5.-method-arguments">4.5. Method Arguments</h3><p>In the argument list, there MUST NOT be a space before each comma, and there MUST be one space after each comma.</p><p>Method arguments with default values MUST go at the end of the argument list.</p><pre class="code codeBlock" spellcheck="false" tabindex="0"><?php class ClassName { public function foo($arg1, &$arg2, $arg3 = []) { // method body } } </pre><p>Argument lists MAY be split across multiple lines, where each subsequent line is indented once. When doing so, the first item in the list MUST be on the next line, and there MUST be only one argument per line.</p><p>When the argument list is split across multiple lines, the closing parenthesis and opening brace MUST be placed together on their own line with one space between them.</p><pre class="code codeBlock" spellcheck="false" tabindex="0"><?php class ClassName { public function aVeryLongMethodName( ClassTypeHint $arg1, &$arg2, array $arg3 = [] ) { // method body } } </pre><h3 data-id="4.6.-global-functions">4.6. Global Functions</h3><p>New global functions <strong>MUST NOT</strong> be created.</p><h3 data-id="4.7.-abstract-final-and-static">4.7. <code class="code codeInline" spellcheck="false" tabindex="0">abstract</code>, <code class="code codeInline" spellcheck="false" tabindex="0">final</code>, and <code class="code codeInline" spellcheck="false" tabindex="0">static</code></h3><p>When present, the <code class="code codeInline" spellcheck="false" tabindex="0">abstract</code> and <code class="code codeInline" spellcheck="false" tabindex="0">final</code> declarations MUST precede the visibility declaration.</p><p>When present, the <code class="code codeInline" spellcheck="false" tabindex="0">static</code> declaration MUST come after the visibility declaration.</p><pre class="code codeBlock" spellcheck="false" tabindex="0"><?php abstract class ClassName { protected static $foo; abstract protected function zim(); final public static function bar() { // method body } } </pre><h3 data-id="4.8.-method-and-function-calls">4.8. Method and Function Calls</h3><p>When making a method or function call, there MUST NOT be a space between the method or function name and the opening parenthesis, there MUST NOT be a space after the opening parenthesis, and there MUST NOT be a space before the closing parenthesis. In the argument list, there MUST NOT be a space before each comma, and there MUST be one space after each comma.</p><pre class="code codeBlock" spellcheck="false" tabindex="0"><?php bar(); $foo->bar($arg1); Foo::bar($arg2, $arg3); </pre><p>Argument lists MAY be split across multiple lines, where each subsequent line is indented once. When doing so, the first item in the list MUST be on the next line, and there MUST be only one argument per line.</p><pre class="code codeBlock" spellcheck="false" tabindex="0"><?php $foo->bar( $longArgument, $longerArgument, $muchLongerArgument ); </pre><h2 data-id="5.-control-structures">5. Control Structures</h2><p>The general style rules for control structures are as follows:</p><ul><li>There MUST be one space after the control structure keyword</li><li>There MUST NOT be a space after the opening parenthesis</li><li>There MUST NOT be a space before the closing parenthesis</li><li>There MUST be one space between the closing parenthesis and the opening brace</li><li>The structure body MUST be indented once</li><li>The closing brace MUST be on the next line after the body</li></ul><p>The body of each structure MUST be enclosed by braces. This standardizes how the structures look, and reduces the likelihood of introducing errors as new lines get added to the body.</p><h3 data-id="5.1.-if-elseif-else">5.1. <code class="code codeInline" spellcheck="false" tabindex="0">if</code>, <code class="code codeInline" spellcheck="false" tabindex="0">elseif</code>, <code class="code codeInline" spellcheck="false" tabindex="0">else</code></h3><p>An <code class="code codeInline" spellcheck="false" tabindex="0">if</code> structure looks like the following. Note the placement of parentheses, spaces, and braces; and that <code class="code codeInline" spellcheck="false" tabindex="0">else</code> and <code class="code codeInline" spellcheck="false" tabindex="0">elseif</code> are on the same line as the closing brace from the earlier body.</p><pre class="code codeBlock" spellcheck="false" tabindex="0"><?php if ($expr1) { // if body } elseif ($expr2) { // elseif body } else { // else body; } </pre><p>The keyword <code class="code codeInline" spellcheck="false" tabindex="0">elseif</code> SHOULD be used instead of <code class="code codeInline" spellcheck="false" tabindex="0">else if</code> so that all control keywords look like single words.</p><h3 data-id="5.2.-switch-case">5.2. <code class="code codeInline" spellcheck="false" tabindex="0">switch</code>, <code class="code codeInline" spellcheck="false" tabindex="0">case</code></h3><p>A <code class="code codeInline" spellcheck="false" tabindex="0">switch</code> structure looks like the following. Note the placement of parentheses, spaces, and braces. The <code class="code codeInline" spellcheck="false" tabindex="0">case</code> statement MUST be indented once from <code class="code codeInline" spellcheck="false" tabindex="0">switch</code>, and the <code class="code codeInline" spellcheck="false" tabindex="0">break</code> keyword (or other terminating keyword) MUST be indented at the same level as the <code class="code codeInline" spellcheck="false" tabindex="0">case</code> body. There MUST be a comment such as <code class="code codeInline" spellcheck="false" tabindex="0">// no break</code> when fall-through is intentional in a non-empty <code class="code codeInline" spellcheck="false" tabindex="0">case</code> body.</p><pre class="code codeBlock" spellcheck="false" tabindex="0"><?php switch ($expr) { case 0: echo 'First case, with a break'; break; case 1: echo 'Second case, which falls through'; // no break case 2: case 3: case 4: echo 'Third case, return instead of break'; return; default: echo 'Default case'; break; } </pre><h3 data-id="5.3.-while-do-while">5.3. <code class="code codeInline" spellcheck="false" tabindex="0">while</code>, <code class="code codeInline" spellcheck="false" tabindex="0">do while</code></h3><p>A <code class="code codeInline" spellcheck="false" tabindex="0">while</code> statement looks like the following. Note the placement of parentheses, spaces, and braces.</p><pre class="code codeBlock" spellcheck="false" tabindex="0"><?php while ($expr) { // structure body } </pre><p>Similarly, a <code class="code codeInline" spellcheck="false" tabindex="0">do while</code> statement looks like the following. Note the placement of parentheses, spaces, and braces.</p><pre class="code codeBlock" spellcheck="false" tabindex="0"><?php do { // structure body; } while ($expr); </pre><h3 data-id="5.4.-for">5.4. <code class="code codeInline" spellcheck="false" tabindex="0">for</code></h3><p>A <code class="code codeInline" spellcheck="false" tabindex="0">for</code> statement looks like the following. Note the placement of parentheses, spaces, and braces.</p><pre class="code codeBlock" spellcheck="false" tabindex="0"><?php for ($i = 0; $i < 10; $i++) { // for body } </pre><h3 data-id="5.5.-foreach">5.5. <code class="code codeInline" spellcheck="false" tabindex="0">foreach</code></h3><p>A <code class="code codeInline" spellcheck="false" tabindex="0">foreach</code> statement looks like the following. Note the placement of parentheses, spaces, and braces.</p><pre class="code codeBlock" spellcheck="false" tabindex="0"><?php foreach ($iterable as $key => $value) { // foreach body } </pre><h3 data-id="5.6.-try-catch">5.6. <code class="code codeInline" spellcheck="false" tabindex="0">try</code>, <code class="code codeInline" spellcheck="false" tabindex="0">catch</code></h3><p>A <code class="code codeInline" spellcheck="false" tabindex="0">try catch</code> block looks like the following. Note the placement of parentheses, spaces, and braces.</p><pre class="code codeBlock" spellcheck="false" tabindex="0"><?php try { // try body } catch (FirstExceptionType $e) { // catch body } catch (OtherExceptionType $e) { // catch body } </pre><h2 data-id="6.-closures">6. Closures</h2><p>Closures MUST be declared with a space after the <code class="code codeInline" spellcheck="false" tabindex="0">function</code> keyword, and a space before and after the <code class="code codeInline" spellcheck="false" tabindex="0">use</code> keyword.</p><p>The opening brace MUST go on the same line, and the closing brace MUST go on the next line following the body.</p><p>There MUST NOT be a space after the opening parenthesis of the argument list or variable list, and there MUST NOT be a space before the closing parenthesis of the argument list or variable list.</p><p>In the argument list and variable list, there MUST NOT be a space before each comma, and there MUST be one space after each comma.</p><p>Closure arguments with default values MUST go at the end of the argument list.</p><p>A closure declaration looks like the following. Note the placement of parentheses, commas, spaces, and braces:</p><pre class="code codeBlock" spellcheck="false" tabindex="0"><?php $closureWithArgs = function ($arg1, $arg2) { // body }; $closureWithArgsAndVars = function ($arg1, $arg2) use ($var1, $var2) { // body }; </pre><p>Argument lists and variable lists MAY be split across multiple lines, where each subsequent line is indented once. When doing so, the first item in the list MUST be on the next line, and there MUST be only one argument or variable per line.</p><p>When the ending list (whether or arguments or variables) is split across multiple lines, the closing parenthesis and opening brace MUST be placed together on their own line with one space between them.</p><p>The following are examples of closures with and without argument lists and variable lists split across multiple lines.</p><pre class="code codeBlock" spellcheck="false" tabindex="0"><?php $longArgs_noVars = function ( $longArgument, $longerArgument, $muchLongerArgument ) { // body }; $noArgs_longVars = function () use ( $longVar1, $longerVar2, $muchLongerVar3 ) { // body }; $longArgs_longVars = function ( $longArgument, $longerArgument, $muchLongerArgument ) use ( $longVar1, $longerVar2, $muchLongerVar3 ) { // body }; $longArgs_shortVars = function ( $longArgument, $longerArgument, $muchLongerArgument ) use ($var1) { // body }; $shortArgs_longVars = function ($arg) use ( $longVar1, $longerVar2, $muchLongerVar3 ) { // body }; </pre><p>Note that the formatting rules also apply when the closure is used directly in a function or method call as an argument.</p><pre class="code codeBlock" spellcheck="false" tabindex="0"><?php $foo->bar( $arg1, function ($arg2) use ($var1) { // body }, $arg3 ); </pre><h2 data-id="7.-doc-blocks">7. Doc Blocks</h2><ul><li>Descriptions MUST BE a full sentence with a capital to start and period to end</li><li>A short description MUST be provided</li><li>There MUST be one empty line after the short description.</li><li>Param annotations with a description MUST be provided UNLESS<ul><li>An <code class="code codeInline" spellcheck="false" tabindex="0">@inheritdoc</code> param is provided.</li></ul></li><li>If a long description is provided there MUST be an empty line after it</li><li>There MUST be one space before and after parameters</li></ul><pre class="code codeBlock" spellcheck="false" tabindex="0">/** * Short description. * * This a long description. It has more detail than a short one. I must be a sentence with a full stop. * * @param string $string Parameter descriptions must be a sentence with full stop. * * @return bool True if user is added else false. */ /** * @inheritdoc */ </pre><h2 data-id="8.-conclusion">8. Conclusion</h2><p>There are many elements of style and practice intentionally omitted by this guide. These include but are not limited to:</p><ul><li>Declaration of global variables and global constants</li><li>Operators and assignment</li><li>Inter-line alignment</li><li>Class name prefixes and suffixes</li><li>Best practices</li></ul><p>Future recommendations MAY revise and extend this guide to address those or other elements of style and practice.</p> </article> </main>