Skip to content

Commit

Permalink
Improved comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Pliakas committed Mar 13, 2012
1 parent 666999f commit cf89c57
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
5 changes: 4 additions & 1 deletion library/Nagiostatus/Parser.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -141,11 +141,14 @@ public function buildDocument(Nagiostatus_Plugin_Abstract $plugin)
* *
* @param string $pluginName * @param string $pluginName
* The name of the plugin used to render the data, i.e. "xml" or "json". * The name of the plugin used to render the data, i.e. "xml" or "json".
* Defaults to null meaning the default plugin is used.
* @param bool $return * @param bool $return
* Return the variable representation instead of outputing it. * Return the variable representation instead of outputing it.
* *
* @return string|bool * @return string|bool
* The rendered status data, false if there are errors. * Returns false on errors. If $return is false, this method returns true
* on success. If $return is true, this method returns the parsed document
* as a string in the machine readable format determined by the plugin.
*/ */
public function render($pluginName = null, $return = false) public function render($pluginName = null, $return = false)
{ {
Expand Down
16 changes: 9 additions & 7 deletions library/Nagiostatus/Plugin/Abstract.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -16,35 +16,37 @@
/** /**
* Base class for Nagiostatus plugins. * Base class for Nagiostatus plugins.
* *
* Plugins render the status.dat file in machine readable formats and output the
* data directly to STDOUT as opposed to building the document in memory.
*
* @package Nagiostatus * @package Nagiostatus
* @subpackage Plugin * @subpackage Plugin
*/ */
abstract class Nagiostatus_Plugin_Abstract abstract class Nagiostatus_Plugin_Abstract
{ {

/** /**
* The Nagiostatus_Parser instance containing the parsed data. * The calling Nagiostatus_Parser instance.
* *
* @var Nagiostatus * @var Nagiostatus
*/ */
protected $_parser; protected $_parser;


/** /**
* Sets the Nagiostatus_Parser instance containing the parsed data. * Sets the calling Nagiostatus_Parser instance.
* *
* @param Nagiostatus_Parser $status * @param Nagiostatus_Parser $status
* The Nagiostatus_Parser instance containing the parsed data. * The calling Nagiostatus_Parser instance.
*/ */
public function __construct(Nagiostatus_Parser $parser) public function __construct(Nagiostatus_Parser $parser)
{ {
$this->_parser = $parser; $this->_parser = $parser;
} }


/** /**
* Returns the Nagiostatus_Parser instance containing the parsed data * Returns the calling Nagiostatus_Parser instance.
* *
* @return Nagiostatus_Parser * @return Nagiostatus_Parser
* The Nagiostatus_Parser instance containing the parsed data * The calling Nagiostatus_Parser instance.
*/ */
public function getParser() public function getParser()
{ {
Expand All @@ -63,7 +65,7 @@ public function initDocument()
* Outputs the status data in machine readable format. * Outputs the status data in machine readable format.
* *
* @param array $status * @param array $status
* The parsed status information. * An individual status information block parsed as an associative array.
*/ */
abstract public function execute(array $status); abstract public function execute(array $status);


Expand Down
2 changes: 1 addition & 1 deletion library/Nagiostatus/Plugin/Json.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
class Nagiostatus_Plugin_Json extends Nagiostatus_Plugin_Abstract class Nagiostatus_Plugin_Json extends Nagiostatus_Plugin_Abstract
{ {
/** /**
* Whether the * Flags whether we are parsing the first status block.
* *
* @var boolean * @var boolean
*/ */
Expand Down

0 comments on commit cf89c57

Please sign in to comment.