summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorMatt Perry <matt@mattperry.com>2013-08-23 03:08:41 -0700
committerAndreas Gohr <andi@splitbrain.org>2013-08-23 15:54:32 +0200
commitc404cb3b0b4946f6308f66b6324a24489b2ef5b8 (patch)
tree037a2c24abfc1907e7233034fd839f6eeeb71ff8 /inc
parentce5e852908a745e41536081ceb92448a0322e0a9 (diff)
downloadrpg-c404cb3b0b4946f6308f66b6324a24489b2ef5b8.tar.gz
rpg-c404cb3b0b4946f6308f66b6324a24489b2ef5b8.tar.bz2
Fix CodeSniffer violations for PHP files
Fix violations for Squiz.Commenting.DocCommentAlignment.SpaceBeforeTag Conflicts: inc/parser/xhtml.php
Diffstat (limited to 'inc')
-rw-r--r--inc/Input.class.php1
-rw-r--r--inc/RemoteAPICore.php4
-rw-r--r--inc/farm.php2
-rw-r--r--inc/parser/lexer.php372
-rw-r--r--inc/parser/parser.php14
-rw-r--r--inc/parser/xhtml.php4
6 files changed, 200 insertions, 197 deletions
diff --git a/inc/Input.class.php b/inc/Input.class.php
index 35aecdb45..7434d2b2c 100644
--- a/inc/Input.class.php
+++ b/inc/Input.class.php
@@ -238,7 +238,6 @@ class PostInput extends Input {
/**
* Internal class used for $_GET access in Input class
-
*/
class GetInput extends Input {
protected $access;
diff --git a/inc/RemoteAPICore.php b/inc/RemoteAPICore.php
index ec6235a49..3a713baca 100644
--- a/inc/RemoteAPICore.php
+++ b/inc/RemoteAPICore.php
@@ -506,8 +506,8 @@ class RemoteAPICore {
}
/**
- * Returns the permissions of a given wiki page
- */
+ * Returns the permissions of a given wiki page
+ */
function aclCheck($id) {
$id = $this->resolvePageId($id);
return auth_quickaclcheck($id);
diff --git a/inc/farm.php b/inc/farm.php
index 54fff3ec6..54692928d 100644
--- a/inc/farm.php
+++ b/inc/farm.php
@@ -20,7 +20,7 @@
* @author virtual host part of farm_confpath() based on conf_path() from Drupal.org's /includes/bootstrap.inc
* (see https://github.com/drupal/drupal/blob/7.x/includes/bootstrap.inc#L537)
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
-*/
+ */
// DOKU_FARMDIR needs to be set in preload.php, here the fallback is the same as DOKU_INC would be (if it was set already)
if(!defined('DOKU_FARMDIR')) define('DOKU_FARMDIR', fullpath(dirname(__FILE__).'/../').'/');
diff --git a/inc/parser/lexer.php b/inc/parser/lexer.php
index 9fe1be583..2e84eca7c 100644
--- a/inc/parser/lexer.php
+++ b/inc/parser/lexer.php
@@ -1,18 +1,18 @@
<?php
/**
-* Author Markus Baker: http://www.lastcraft.com
-* Version adapted from Simple Test: http://sourceforge.net/projects/simpletest/
-* For an intro to the Lexer see:
-* http://www.phppatterns.com/index.php/article/articleview/106/1/2/
-* @author Marcus Baker
-* @package Doku
-* @subpackage Lexer
-* @version $Id: lexer.php,v 1.1 2005/03/23 23:14:09 harryf Exp $
-*/
+ * Author Markus Baker: http://www.lastcraft.com
+ * Version adapted from Simple Test: http://sourceforge.net/projects/simpletest/
+ * For an intro to the Lexer see:
+ * http://www.phppatterns.com/index.php/article/articleview/106/1/2/
+ * @author Marcus Baker
+ * @package Doku
+ * @subpackage Lexer
+ * @version $Id: lexer.php,v 1.1 2005/03/23 23:14:09 harryf Exp $
+ */
/**
-* Init path constant
-*/
+ * Init path constant
+ */
if(!defined('DOKU_INC')) die('meh.');
/**#@+
@@ -26,11 +26,12 @@ define("DOKU_LEXER_SPECIAL", 5);
/**#@-*/
/**
- * Compounded regular expression. Any of
- * the contained patterns could match and
- * when one does it's label is returned.
- * @package Doku
- * @subpackage Lexer
+ * Compounded regular expression. Any of
+ * the contained patterns could match and
+ * when one does it's label is returned.
+ *
+ * @package Doku
+ * @subpackage Lexer
*/
class Doku_LexerParallelRegex {
var $_patterns;
@@ -39,10 +40,11 @@ class Doku_LexerParallelRegex {
var $_case;
/**
- * Constructor. Starts with no patterns.
- * @param boolean $case True for case sensitive, false
- * for insensitive.
- * @access public
+ * Constructor. Starts with no patterns.
+ *
+ * @param boolean $case True for case sensitive, false
+ * for insensitive.
+ * @access public
*/
function Doku_LexerParallelRegex($case) {
$this->_case = $case;
@@ -52,15 +54,16 @@ class Doku_LexerParallelRegex {
}
/**
- * Adds a pattern with an optional label.
- * @param mixed $pattern Perl style regex. Must be UTF-8
- * encoded. If its a string, the (, )
- * lose their meaning unless they
- * form part of a lookahead or
- * lookbehind assertation.
- * @param string $label Label of regex to be returned
- * on a match. Label must be ASCII
- * @access public
+ * Adds a pattern with an optional label.
+ *
+ * @param mixed $pattern Perl style regex. Must be UTF-8
+ * encoded. If its a string, the (, )
+ * lose their meaning unless they
+ * form part of a lookahead or
+ * lookbehind assertation.
+ * @param string $label Label of regex to be returned
+ * on a match. Label must be ASCII
+ * @access public
*/
function addPattern($pattern, $label = true) {
$count = count($this->_patterns);
@@ -70,13 +73,13 @@ class Doku_LexerParallelRegex {
}
/**
- * Attempts to match all patterns at once against
- * a string.
- * @param string $subject String to match against.
- * @param string $match First matched portion of
- * subject.
- * @return boolean True on success.
- * @access public
+ * Attempts to match all patterns at once against a string.
+ *
+ * @param string $subject String to match against.
+ * @param string $match First matched portion of
+ * subject.
+ * @return boolean True on success.
+ * @access public
*/
function match($subject, &$match) {
if (count($this->_patterns) == 0) {
@@ -98,14 +101,14 @@ class Doku_LexerParallelRegex {
}
/**
- * Attempts to split the string against all patterns at once
+ * Attempts to split the string against all patterns at once
*
- * @param string $subject String to match against.
- * @param array $split The split result: array containing, pre-match, match & post-match strings
- * @return boolean True on success.
- * @access public
+ * @param string $subject String to match against.
+ * @param array $split The split result: array containing, pre-match, match & post-match strings
+ * @return boolean True on success.
+ * @access public
*
- * @author Christopher Smith <chris@jalakai.co.uk>
+ * @author Christopher Smith <chris@jalakai.co.uk>
*/
function split($subject, &$split) {
if (count($this->_patterns) == 0) {
@@ -143,12 +146,13 @@ class Doku_LexerParallelRegex {
}
/**
- * Compounds the patterns into a single
- * regular expression separated with the
- * "or" operator. Caches the regex.
- * Will automatically escape (, ) and / tokens.
- * @param array $patterns List of patterns in order.
- * @access private
+ * Compounds the patterns into a single
+ * regular expression separated with the
+ * "or" operator. Caches the regex.
+ * Will automatically escape (, ) and / tokens.
+ *
+ * @param array $patterns List of patterns in order.
+ * @access private
*/
function _getCompoundedRegex() {
if ($this->_regex == null) {
@@ -205,9 +209,9 @@ class Doku_LexerParallelRegex {
}
/**
- * Accessor for perl regex mode flags to use.
- * @return string Perl regex flags.
- * @access private
+ * Accessor for perl regex mode flags to use.
+ * @return string Perl regex flags.
+ * @access private
*/
function _getPerlMatchingFlags() {
return ($this->_case ? "msS" : "msSi");
@@ -215,47 +219,47 @@ class Doku_LexerParallelRegex {
}
/**
- * States for a stack machine.
- * @package Lexer
- * @subpackage Lexer
+ * States for a stack machine.
+ * @package Lexer
+ * @subpackage Lexer
*/
class Doku_LexerStateStack {
var $_stack;
/**
- * Constructor. Starts in named state.
- * @param string $start Starting state name.
- * @access public
+ * Constructor. Starts in named state.
+ * @param string $start Starting state name.
+ * @access public
*/
function Doku_LexerStateStack($start) {
$this->_stack = array($start);
}
/**
- * Accessor for current state.
- * @return string State.
- * @access public
+ * Accessor for current state.
+ * @return string State.
+ * @access public
*/
function getCurrent() {
return $this->_stack[count($this->_stack) - 1];
}
/**
- * Adds a state to the stack and sets it
- * to be the current state.
- * @param string $state New state.
- * @access public
+ * Adds a state to the stack and sets it
+ * to be the current state.
+ * @param string $state New state.
+ * @access public
*/
function enter($state) {
array_push($this->_stack, $state);
}
/**
- * Leaves the current state and reverts
- * to the previous one.
- * @return boolean False if we drop off
- * the bottom of the list.
- * @access public
+ * Leaves the current state and reverts
+ * to the previous one.
+ * @return boolean False if we drop off
+ * the bottom of the list.
+ * @access public
*/
function leave() {
if (count($this->_stack) == 1) {
@@ -267,13 +271,13 @@ class Doku_LexerStateStack {
}
/**
- * Accepts text and breaks it into tokens.
- * Some optimisation to make the sure the
- * content is only scanned by the PHP regex
- * parser once. Lexer modes must not start
- * with leading underscores.
- * @package Doku
- * @subpackage Lexer
+ * Accepts text and breaks it into tokens.
+ * Some optimisation to make the sure the
+ * content is only scanned by the PHP regex
+ * parser once. Lexer modes must not start
+ * with leading underscores.
+ * @package Doku
+ * @subpackage Lexer
*/
class Doku_Lexer {
var $_regexes;
@@ -283,13 +287,13 @@ class Doku_Lexer {
var $_case;
/**
- * Sets up the lexer in case insensitive matching
- * by default.
- * @param Doku_Parser $parser Handling strategy by
- * reference.
- * @param string $start Starting handler.
- * @param boolean $case True for case sensitive.
- * @access public
+ * Sets up the lexer in case insensitive matching
+ * by default.
+ * @param Doku_Parser $parser Handling strategy by
+ * reference.
+ * @param string $start Starting handler.
+ * @param boolean $case True for case sensitive.
+ * @access public
*/
function Doku_Lexer(&$parser, $start = "accept", $case = false) {
$this->_case = $case;
@@ -300,15 +304,15 @@ class Doku_Lexer {
}
/**
- * Adds a token search pattern for a particular
- * parsing mode. The pattern does not change the
- * current mode.
- * @param string $pattern Perl style regex, but ( and )
- * lose the usual meaning.
- * @param string $mode Should only apply this
- * pattern when dealing with
- * this type of input.
- * @access public
+ * Adds a token search pattern for a particular
+ * parsing mode. The pattern does not change the
+ * current mode.
+ * @param string $pattern Perl style regex, but ( and )
+ * lose the usual meaning.
+ * @param string $mode Should only apply this
+ * pattern when dealing with
+ * this type of input.
+ * @access public
*/
function addPattern($pattern, $mode = "accept") {
if (! isset($this->_regexes[$mode])) {
@@ -318,17 +322,17 @@ class Doku_Lexer {
}
/**
- * Adds a pattern that will enter a new parsing
- * mode. Useful for entering parenthesis, strings,
- * tags, etc.
- * @param string $pattern Perl style regex, but ( and )
- * lose the usual meaning.
- * @param string $mode Should only apply this
- * pattern when dealing with
- * this type of input.
- * @param string $new_mode Change parsing to this new
- * nested mode.
- * @access public
+ * Adds a pattern that will enter a new parsing
+ * mode. Useful for entering parenthesis, strings,
+ * tags, etc.
+ * @param string $pattern Perl style regex, but ( and )
+ * lose the usual meaning.
+ * @param string $mode Should only apply this
+ * pattern when dealing with
+ * this type of input.
+ * @param string $new_mode Change parsing to this new
+ * nested mode.
+ * @access public
*/
function addEntryPattern($pattern, $mode, $new_mode) {
if (! isset($this->_regexes[$mode])) {
@@ -338,12 +342,12 @@ class Doku_Lexer {
}
/**
- * Adds a pattern that will exit the current mode
- * and re-enter the previous one.
- * @param string $pattern Perl style regex, but ( and )
- * lose the usual meaning.
- * @param string $mode Mode to leave.
- * @access public
+ * Adds a pattern that will exit the current mode
+ * and re-enter the previous one.
+ * @param string $pattern Perl style regex, but ( and )
+ * lose the usual meaning.
+ * @param string $mode Mode to leave.
+ * @access public
*/
function addExitPattern($pattern, $mode) {
if (! isset($this->_regexes[$mode])) {
@@ -353,16 +357,16 @@ class Doku_Lexer {
}
/**
- * Adds a pattern that has a special mode. Acts as an entry
- * and exit pattern in one go, effectively calling a special
- * parser handler for this token only.
- * @param string $pattern Perl style regex, but ( and )
- * lose the usual meaning.
- * @param string $mode Should only apply this
- * pattern when dealing with
- * this type of input.
- * @param string $special Use this mode for this one token.
- * @access public
+ * Adds a pattern that has a special mode. Acts as an entry
+ * and exit pattern in one go, effectively calling a special
+ * parser handler for this token only.
+ * @param string $pattern Perl style regex, but ( and )
+ * lose the usual meaning.
+ * @param string $mode Should only apply this
+ * pattern when dealing with
+ * this type of input.
+ * @param string $special Use this mode for this one token.
+ * @access public
*/
function addSpecialPattern($pattern, $mode, $special) {
if (! isset($this->_regexes[$mode])) {
@@ -372,24 +376,24 @@ class Doku_Lexer {
}
/**
- * Adds a mapping from a mode to another handler.
- * @param string $mode Mode to be remapped.
- * @param string $handler New target handler.
- * @access public
+ * Adds a mapping from a mode to another handler.
+ * @param string $mode Mode to be remapped.
+ * @param string $handler New target handler.
+ * @access public
*/
function mapHandler($mode, $handler) {
$this->_mode_handlers[$mode] = $handler;
}
/**
- * Splits the page text into tokens. Will fail
- * if the handlers report an error or if no
- * content is consumed. If successful then each
- * unparsed and parsed token invokes a call to the
- * held listener.
- * @param string $raw Raw HTML text.
- * @return boolean True on success, else false.
- * @access public
+ * Splits the page text into tokens. Will fail
+ * if the handlers report an error or if no
+ * content is consumed. If successful then each
+ * unparsed and parsed token invokes a call to the
+ * held listener.
+ * @param string $raw Raw HTML text.
+ * @return boolean True on success, else false.
+ * @access public
*/
function parse($raw) {
if (! isset($this->_parser)) {
@@ -418,18 +422,18 @@ class Doku_Lexer {
}
/**
- * Sends the matched token and any leading unmatched
- * text to the parser changing the lexer to a new
- * mode if one is listed.
- * @param string $unmatched Unmatched leading portion.
- * @param string $matched Actual token match.
- * @param string $mode Mode after match. A boolean
- * false mode causes no change.
- * @param int $pos Current byte index location in raw doc
- * thats being parsed
- * @return boolean False if there was any error
- * from the parser.
- * @access private
+ * Sends the matched token and any leading unmatched
+ * text to the parser changing the lexer to a new
+ * mode if one is listed.
+ * @param string $unmatched Unmatched leading portion.
+ * @param string $matched Actual token match.
+ * @param string $mode Mode after match. A boolean
+ * false mode causes no change.
+ * @param int $pos Current byte index location in raw doc
+ * thats being parsed
+ * @return boolean False if there was any error
+ * from the parser.
+ * @access private
*/
function _dispatchTokens($unmatched, $matched, $mode = false, $initialPos, $matchPos) {
if (! $this->_invokeParser($unmatched, DOKU_LEXER_UNMATCHED, $initialPos) ){
@@ -456,50 +460,50 @@ class Doku_Lexer {
}
/**
- * Tests to see if the new mode is actually to leave
- * the current mode and pop an item from the matching
- * mode stack.
- * @param string $mode Mode to test.
- * @return boolean True if this is the exit mode.
- * @access private
+ * Tests to see if the new mode is actually to leave
+ * the current mode and pop an item from the matching
+ * mode stack.
+ * @param string $mode Mode to test.
+ * @return boolean True if this is the exit mode.
+ * @access private
*/
function _isModeEnd($mode) {
return ($mode === "__exit");
}
/**
- * Test to see if the mode is one where this mode
- * is entered for this token only and automatically
- * leaves immediately afterwoods.
- * @param string $mode Mode to test.
- * @return boolean True if this is the exit mode.
- * @access private
+ * Test to see if the mode is one where this mode
+ * is entered for this token only and automatically
+ * leaves immediately afterwoods.
+ * @param string $mode Mode to test.
+ * @return boolean True if this is the exit mode.
+ * @access private
*/
function _isSpecialMode($mode) {
return (strncmp($mode, "_", 1) == 0);
}
/**
- * Strips the magic underscore marking single token
- * modes.
- * @param string $mode Mode to decode.
- * @return string Underlying mode name.
- * @access private
+ * Strips the magic underscore marking single token
+ * modes.
+ * @param string $mode Mode to decode.
+ * @return string Underlying mode name.
+ * @access private
*/
function _decodeSpecial($mode) {
return substr($mode, 1);
}
/**
- * Calls the parser method named after the current
- * mode. Empty content will be ignored. The lexer
- * has a parser handler for each mode in the lexer.
- * @param string $content Text parsed.
- * @param boolean $is_match Token is recognised rather
- * than unparsed data.
- * @param int $pos Current byte index location in raw doc
- * thats being parsed
- * @access private
+ * Calls the parser method named after the current
+ * mode. Empty content will be ignored. The lexer
+ * has a parser handler for each mode in the lexer.
+ * @param string $content Text parsed.
+ * @param boolean $is_match Token is recognised rather
+ * than unparsed data.
+ * @param int $pos Current byte index location in raw doc
+ * thats being parsed
+ * @access private
*/
function _invokeParser($content, $is_match, $pos) {
if (($content === "") || ($content === false)) {
@@ -521,18 +525,18 @@ class Doku_Lexer {
}
/**
- * Tries to match a chunk of text and if successful
- * removes the recognised chunk and any leading
- * unparsed data. Empty strings will not be matched.
- * @param string $raw The subject to parse. This is the
- * content that will be eaten.
- * @return array Three item list of unparsed
- * content followed by the
- * recognised token and finally the
- * action the parser is to take.
- * True if no match, false if there
- * is a parsing error.
- * @access private
+ * Tries to match a chunk of text and if successful
+ * removes the recognised chunk and any leading
+ * unparsed data. Empty strings will not be matched.
+ * @param string $raw The subject to parse. This is the
+ * content that will be eaten.
+ * @return array Three item list of unparsed
+ * content followed by the
+ * recognised token and finally the
+ * action the parser is to take.
+ * True if no match, false if there
+ * is a parsing error.
+ * @access private
*/
function _reduce(&$raw) {
if (! isset($this->_regexes[$this->_mode->getCurrent()])) {
@@ -550,9 +554,9 @@ class Doku_Lexer {
}
/**
-* Escapes regex characters other than (, ) and /
-* @TODO
-*/
+ * Escapes regex characters other than (, ) and /
+ * @TODO
+ */
function Doku_Lexer_Escape($str) {
//$str = addslashes($str);
$chars = array(
diff --git a/inc/parser/parser.php b/inc/parser/parser.php
index 064178a54..3caad834a 100644
--- a/inc/parser/parser.php
+++ b/inc/parser/parser.php
@@ -45,9 +45,9 @@ $PARSER_MODES = array(
//-------------------------------------------------------------------
/**
-* Sets up the Lexer with modes and points it to the Handler
-* For an intro to the Lexer see: wiki:parser
-*/
+ * Sets up the Lexer with modes and points it to the Handler
+ * For an intro to the Lexer see: wiki:parser
+ */
class Doku_Parser {
var $Handler;
@@ -70,9 +70,9 @@ class Doku_Parser {
}
/**
- * PHP preserves order of associative elements
- * Mode sequence is important
- */
+ * PHP preserves order of associative elements
+ * Mode sequence is important
+ */
function addMode($name, & $Mode) {
if ( !isset($this->modes['base']) ) {
$this->addBaseMode(new Doku_Parser_Mode_base());
@@ -134,7 +134,7 @@ class Doku_Parser {
* all modes are registered
*
* @author Harry Fuecks <hfuecks@gmail.com>
-*/
+ */
class Doku_Parser_Mode {
/**
diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php
index a719bca26..ff4d7eb41 100644
--- a/inc/parser/xhtml.php
+++ b/inc/parser/xhtml.php
@@ -59,7 +59,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
* Finish an edit section range
*
* @param $end int The byte position for the edit end; null for the rest of
- the page
+ * the page
* @author Adrian Lang <lang@cosmocode.de>
*/
public function finishSectionEdit($end = null) {
@@ -541,7 +541,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
}
/**
- */
+ */
function camelcaselink($link) {
$this->internallink($link,$link);
}