Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I document every class, every function, every variable within a class. Simple DocBlocks are the way forward.</p> <p>I'll generally write these docblocks more for automated API documentation than anything else...</p> <p>For example, the first section of one of my PHP classes</p> <pre><code>/** * Class to clean variables * * @package Majyk * @author Martin Meredith &lt;martin@sourceguru.net&gt; * @licence GPL (v2 or later) * @copyright Copyright (c) 2008 Martin Meredith &lt;martin@sourceguru.net&gt; * @version 0.1 */ class Majyk_Filter { /** * Class Constants for Cleaning Types */ const Integer = 1; const PositiveInteger = 2; const String = 3; const NoHTML = 4; const DBEscapeString = 5; const NotNegativeInteger = 6; /** * Do the cleaning * * @param integer Type of Cleaning (as defined by constants) * @param mixed Value to be cleaned * * @return mixed Cleaned Variable * */ </code></pre> <p>But then, I'll also sometimes document significant code (from my init.php</p> <pre><code>// Register the Auto-Loader spl_autoload_register("majyk_autoload"); // Add an Exception Handler. set_exception_handler(array('Majyk_ExceptionHandler', 'handle_exception')); // Turn Errors into Exceptions set_error_handler(array('Majyk_ExceptionHandler', 'error_to_exception'), E_ALL); // Add the generic Auto-Loader to the auto-loader stack spl_autoload_register("spl_autoload"); </code></pre> <p>And, if it's not self explanatory why something does something in a certain way, I'll comment that</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload