Skip to content

Commit

Permalink
Unify doc comment styles
Browse files Browse the repository at this point in the history
[ci skip] still no PSR tests :/
  • Loading branch information
J5lx committed Aug 4, 2015
1 parent 599a065 commit 4284855
Show file tree
Hide file tree
Showing 33 changed files with 287 additions and 217 deletions.
13 changes: 6 additions & 7 deletions src/Luminous.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* the abstract class methods.
*/

/// @cond USER
/** @cond USER */

// here's our 'real' UI class, which uses the above singleton. This is all
// static because these are actually procudural functions, we're using the
Expand Down Expand Up @@ -318,11 +318,11 @@ public static function guessLanguage($src, $confidence = 0.05, $default = 'plain
* probable language coming first in the array.
* Each array element is an array which represents a language (scanner),
* and has the keys:
* \li \c 'language' => Human-readable language description,
* \li \c 'codes' => valid codes for the language (array),
* \li \c 'p' => the probability (between 0.0 and 1.0 inclusive),
* @li @c 'language' => Human-readable language description,
* @li @c 'codes' => valid codes for the language (array),
* @li @c 'p' => the probability (between 0.0 and 1.0 inclusive),
*
* note that \c 'language' and \c 'codes' are the key => value pair from
* note that @c 'language' and @c 'codes' are the key => value pair from
* luminous::scanners()
*
* @warning Language guessing is inherently unreliable but should be right
Expand Down Expand Up @@ -435,5 +435,4 @@ public static function headHtml()
}
}

/// @endcond
// ends user
/** @endcond */
4 changes: 2 additions & 2 deletions src/Luminous/Caches/Cache.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
/// @cond ALL
/** @cond ALL */

namespace Luminous\Caches;

Expand Down Expand Up @@ -116,4 +116,4 @@ public function write($data)
}
}

/// @endcond
/** @endcond */
25 changes: 16 additions & 9 deletions src/Luminous/Caches/FileSystemCache.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
/// @cond ALL
/** @cond ALL */

namespace Luminous\Caches;

Expand All @@ -22,22 +22,29 @@
*
* This driver implements necessary functions for reading/writing the cache
* and performing maintenance.
*
*/
class FileSystemCache extends Cache
{
/// root cache directory
/**
* root cache directory
*/
private $dir = null;

/// full path to the cached file (for convenience)
/**
* full path to the cached file (for convenience)
*/
private $path = null;

/// subdir within the cache - we factor out the first two
/// characters of the filename, this reduces the number of files in
/// any one folder.
/**
* subdir within the cache - we factor out the first two
* characters of the filename, this reduces the number of files in
* any one folder.
*/
private $subdir = null;

/// the base filename of the cached file
/**
* the base filename of the cached file
*/
private $filename = null;

public function __construct($id)
Expand Down Expand Up @@ -171,4 +178,4 @@ protected function purgeInternal()
}
}

/// @endcond
/** @endcond */
4 changes: 2 additions & 2 deletions src/Luminous/Caches/SqlCache.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
/// @cond ALL
/** @cond ALL */

namespace Luminous\Caches;

Expand Down Expand Up @@ -155,4 +155,4 @@ protected function purgeInternal()
}
}

/// @endcond
/** @endcond */
5 changes: 2 additions & 3 deletions src/Luminous/Cli.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
///@cond ALL
/** @cond ALL */

namespace Luminous;

Expand Down Expand Up @@ -127,7 +127,6 @@ public function parseArgs()
}
}


public function highlight()
{
$this->parseArgs();
Expand Down Expand Up @@ -218,4 +217,4 @@ public function highlight()
}
}

///@endcond
/** @endcond */
10 changes: 3 additions & 7 deletions src/Luminous/Core/Filters.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
<?php

/**
* @cond CORE
*/
/** @cond CORE */

namespace Luminous\Core;

/*
/**
* @brief A collection of useful common filters.
*
* Filters are either stream filters or individual filters.
* Stream filters operate on the entire token stream, and return the new
* token stream. Individual filters operate on individual tokens (bound by type),
* and return the new token. Any publicly available member here is one of those,
* therefore the return and param documents are omitted.
*
*/
class Filters
{
Expand Down Expand Up @@ -338,5 +335,4 @@ public static function ooStreamFilter($tokens)
}
}

/// @endcond
// end CORE
/** @endcond */
20 changes: 13 additions & 7 deletions src/Luminous/Core/Scanners/EmbeddedWebScriptScanner.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

/// @cond CORE
/** @cond CORE */

namespace Luminous\Core\Scanners;

Expand All @@ -21,9 +21,9 @@
* state, which might be necessary if they are interrupted by server-side tags.
* For this reason, the main() method might be called multiple times, therefore
* each web sub-scanner should
* \li Not rely on keeping state related data in main()'s function scope,
* @li Not rely on keeping state related data in main()'s function scope,
* make it a class variable
* \li flush its token stream every time main() is called
* @li flush its token stream every time main() is called
*
* The init method of the class should be used to set relevant rules based
* on whether or not the embedded flags are set; and therefore the embedded
Expand Down Expand Up @@ -51,10 +51,14 @@ abstract class EmbeddedWebScriptScanner extends Scanner
*/
public $serverTags = '/<\?/';

/// @brief closing HTML tag for our code, e.g \</script\>
/**
* @brief closing HTML tag for our code, e.g \</script\>
*/
public $scriptTags;

/** @brief I think this is ignored and obsolete */
/**
* @brief I think this is ignored and obsolete
*/
public $interrupt = false;

/**
Expand Down Expand Up @@ -105,7 +109,9 @@ public function addChildScanner($name, $scanner)
$this->childScanners[$name] = $scanner;
}

// override string to hit the child scanners as well
/**
* override string to hit the child scanners as well
*/
public function string($str = null)
{
if ($str !== null) {
Expand Down Expand Up @@ -265,4 +271,4 @@ public function scriptBreak($tokenName, $match = null, $pos = null)
}
}

/// @endcond
/** @endcond */
18 changes: 9 additions & 9 deletions src/Luminous/Core/Scanners/Scanner.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

/// @cond CORE
/** @cond CORE */

/**
* @file
Expand Down Expand Up @@ -50,10 +50,11 @@
* index stores whether or nto it has been escaped.
*
*/

class Scanner extends StringScanner
{
/// scanner version.
/**
* scanner version.
*/
public $version = 'master';

/**
Expand Down Expand Up @@ -131,7 +132,9 @@ class Scanner extends StringScanner
*/
protected $caseSensitive = true;

/// constructor
/**
* constructor
*/
public function __construct($src = null)
{
parent::__construct($src);
Expand Down Expand Up @@ -241,7 +244,6 @@ public function init()
* The main method is fully responsible for tokenizing the string stored
* in string() at the time of its call. By the time main returns, it should
* have consumed the whole of the string and populated the token array.
*
*/
public function main()
{
Expand Down Expand Up @@ -309,7 +311,6 @@ public function removeStreamFilter($name)
* A stream filter receives the entire token stream and should return it.
*
* The parameters are: ([name], filter). Name is an optional argument.
*
*/
public function addStreamFilter($arg1, $arg2 = null)
{
Expand Down Expand Up @@ -357,7 +358,7 @@ public function pop()

/**
* @brief Flushes the token stream
*/
*/
public function start()
{
$this->tokens = array();
Expand Down Expand Up @@ -533,7 +534,6 @@ public function skipWhitespace()
*
* @throws Exception if called at a non-matching point (i.e.
* <code>$this->scan($open)</code> does not match)
*
*/
public function nestableToken($tokenName, $open, $close)
{
Expand Down Expand Up @@ -562,4 +562,4 @@ public function nestableToken($tokenName, $open, $close)
}
}

/// @endcond
/** @endcond */
4 changes: 2 additions & 2 deletions src/Luminous/Core/Scanners/SimpleScanner.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

/// @cond CORE
/** @cond CORE */

namespace Luminous\Core\Scanners;

Expand Down Expand Up @@ -63,4 +63,4 @@ public function main()
}
}

/// @endcond CORE
/** @endcond CORE */
29 changes: 17 additions & 12 deletions src/Luminous/Core/Scanners/StatefulScanner.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

/// @cond CORE
/** @cond CORE */

namespace Luminous\Core\Scanners;

Expand Down Expand Up @@ -34,15 +34,15 @@
* stores the current state data. State data is currently a pattern, as the
* above tuple.
*
*
* @warning Currently 'stream filters' are not applied, because we at no point
* end up with a flat stream of tokens. Although the rule name remapper is
* applied.
*
*/
class StatefulScanner extends SimpleScanner
{
/// @brief Transition table
/**
* @brief Transition table
*/
protected $transitions = array();

/**
Expand Down Expand Up @@ -73,15 +73,21 @@ class StatefulScanner extends SimpleScanner
*/
protected $tokenTreeStack = array();

/// Records whether or not the FSM has been set up for the first time.
/// @see setup()
/**
* Records whether or not the FSM has been set up for the first time.
* @see setup()
*/
private $setup = false;
/// remembers the state on the last iteration so we know whether or not
/// to load in a new transition-set
/**
* remembers the state on the last iteration so we know whether or not
* to load in a new transition-set
*/
private $lastState = null;

/// Cache of transition rules
/// @see next_start_data()
/**
* Cache of transition rules
* @see next_start_data()
*/
private $transitionRuleCache = array();

/**
Expand Down Expand Up @@ -288,7 +294,6 @@ protected function setup()
* @warning the second and third parameters are not applicable to this
* method, they are only present to suppress PHP warnings. If you set them,
* an exception is thrown.
*
*/
public function record($str, $dummy1 = null, $dummy2 = null)
{
Expand Down Expand Up @@ -453,4 +458,4 @@ public function tagged()
}
}

/// @endcond CORE
/** @endcond CORE */
Loading

0 comments on commit 4284855

Please sign in to comment.