Index: contrib/phpcs/Observium/ruleset.xml
===================================================================
--- contrib/phpcs/Observium/ruleset.xml	(revision 0)
+++ contrib/phpcs/Observium/ruleset.xml	(revision 0)
@@ -0,0 +1,182 @@
+<?xml version="1.0"?>
+<ruleset name="Observium">
+ <description>The Observium coding standard.</description>
+
+ <!--
+ TODO:
+ - WARN: ternary control structures ??
+ - ERROR: Empty line between the "global" line and the rest of the code in a function.
+ - ERROR: Empty line between the final "return" statement and the rest of the code in a function. 
+ -->
+
+ <!-- 1. Indenting and Whitespace -->
+
+ <!-- Code MUST use an indent of 2 spaces, and MUST NOT use tabs for indenting. -->
+ <rule ref="Generic.WhiteSpace.ScopeIndent">
+  <properties>
+   <property name="indent" value="2"/>
+  </properties>
+ </rule>
+ <rule ref="Generic.WhiteSpace.DisallowTabIndent"/>
+
+ <!-- There MUST NOT be trailing whitespace at the end of non-blank lines. -->
+ <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
+  <properties>
+   <property name="ignoreBlankLines" value="true"/>
+   </properties>
+ </rule>
+ <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.StartFile">
+  <severity>0</severity>
+ </rule>
+ <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EndFile">
+  <severity>0</severity>
+ </rule>
+ <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines">
+  <severity>0</severity>
+ </rule>
+
+
+ <!-- 2. Files -->
+
+ <!-- MUST use only UTF-8 without BOM -->
+ <rule ref="Generic.Files.ByteOrderMark"/>
+
+ <!-- All PHP files MUST use the Unix LF (linefeed) line ending. -->
+ <rule ref="Generic.Files.LineEndings">
+  <properties>
+   <property name="eolChar" value="\n"/>
+  </properties>
+ </rule>
+
+ <!-- All PHP files MUST end with a single blank line. -->
+ <!-- checked in Files/EndFileNewlineSniff -->
+ <rule ref="PSR2.Files.EndFileNewline"/>
+
+ <!-- MUST use the long <?php ?> tags -->
+ <rule ref="Generic.PHP.DisallowShortOpenTag"/>
+
+ <!-- The closing ?> tag MUST be omitted from files containing only PHP. -->
+ <rule ref="Zend.Files.ClosingTag"/>
+
+
+ <!-- 3. Lines -->
+
+ <!-- There MUST NOT be more than one statement per line. -->
+ <rule ref="Generic.Formatting.DisallowMultipleStatements"/>
+
+ <!-- 4. Keywords and True/False/Null -->
+
+ <!-- PHP keywords MUST be in lower case. -->
+ <rule ref="Generic.PHP.LowerCaseKeyword"/>
+
+ <!-- The PHP constants true, false, and null MUST be in upper case. -->
+ <rule ref="Generic.PHP.UpperCaseConstant"/>
+
+ <!-- Function names MUST be in underscore naming format. -->
+ <!-- checked in Observium/NamingConventions/ValidFunctionNameSniff -->
+
+ <!-- Variable names MUST be in underscore naming format. -->
+ <!-- checked in Observium/NamingConventions/ValidVariableNameSniff -->
+
+
+ <!-- 5. Control Structures -->
+
+ <!-- The general style rules for control structures are as follows:
+ There MUST be one space after the control structure keyword
+ There MUST NOT be a space after the opening parenthesis
+ There MUST NOT be a space before the closing parenthesis
+ There MUST be one space between the closing parenthesis and the opening brace
+ The structure body MUST be indented once
+ The closing brace MUST be on the next line after the body -->
+ <rule ref="Observium.ControlStructures.ControlSignature">
+  <properties>
+   <property name="ignoreComments" value="true"/>
+  </properties>
+ </rule>
+ <!--rule ref="Squiz.WhiteSpace.ScopeClosingBrace"/-->
+ <rule ref="Squiz.ControlStructures.ForEachLoopDeclaration"/>
+ <rule ref="Squiz.ControlStructures.ForLoopDeclaration"/>
+ <rule ref="Squiz.ControlStructures.LowercaseDeclaration"/>
+ <rule ref="PSR2.ControlStructures.ControlStructureSpacing"/>
+
+ <!-- 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. -->
+ <rule ref="Generic.ControlStructures.InlineControlStructure"/>
+
+ <!-- Parameters to "echo" MUST use parentheses -->
+ <!-- checked in Observium/ControlStructures/EchoParenthesesSniff -->
+
+ <!-- 5.1. if, elseif, else -->
+
+ <!-- The keyword elseif SHOULD be used instead of else if so that all control keywords look like single words. -->
+ <rule ref="PSR2.ControlStructures.ElseIfDeclaration"/>
+
+ <!-- 5.2. switch, case -->
+
+ <!-- The case statement MUST be indented once from switch, and the break keyword (or other terminating keyword) MUST be indented at the same level as the case body. There MUST be a comment such as // no break when fall-through is intentional in a non-empty case body. -->
+ <rule ref="PSR2.ControlStructures.SwitchDeclaration">
+  <properties>
+   <property name="indent" value="2"/>
+  </properties>
+ </rule>
+
+
+ <!-- 6. Methods -->
+
+ <!-- Visibility MUST be declared on all methods. -->
+ <rule ref="Squiz.Scope.MethodScope"/>
+ <rule ref="Squiz.WhiteSpace.ScopeKeywordSpacing"/>
+
+ <!-- Method names SHOULD NOT be prefixed with a single underscore to indicate protected or private visibility. -->
+ <rule ref="PSR2.Methods.MethodDeclaration"/>
+
+ <!-- Method names MUST NOT be declared with a space after the method name. The opening brace MUST go on its own line, 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. -->
+ <rule ref="Squiz.Functions.FunctionDeclaration"/>
+ <rule ref="Squiz.Functions.LowercaseFunctionKeywords"/>
+
+ <!-- In the argument list, there MUST NOT be a space before each comma, and there MUST be one space after each comma. -->
+ <rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing">
+  <properties>
+   <property name="equalsSpacing" value="1"/>
+  </properties>
+ </rule>
+
+ <!-- Method arguments with default values MUST go at the end of the argument list. -->
+ <rule ref="PEAR.Functions.ValidDefaultValue"/>
+
+ <!-- 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. 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. -->
+ <rule ref="Squiz.Functions.MultiLineFunctionDeclaration"/>
+
+ <!-- When present, the abstract and final declarations MUST precede the visibility declaration.
+      When present, the static declaration MUST come after the visibility declaration. -->
+ <rule ref="PSR2.Methods.MethodDeclaration"/>
+
+ <!-- In the argument list of a method or function call, there MUST NOT be a space before each comma, and there MUST be one space after each comma. -->
+ <rule ref="Generic.Functions.FunctionCallArgumentSpacing"/>
+
+ <!-- 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.
+ 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. -->
+ <!-- checked in Observium.Functions.FunctionCallSignature -->
+
+
+ <!-- 7. Classes and OOP -->
+ <!-- Observium doesn't generally use OOP, but if we do, we'll check against some PSR2 standards. -->
+
+ <!-- The extends and implements keywords MUST be declared on the same line as the class name.
+      The opening brace for the class go MUST go on its own line; the closing brace for the class MUST go on the next line after the body.
+      Lists of implements 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. -->
+ <rule ref="PSR2.Classes.ClassDeclaration"/>
+
+ <!-- Visibility MUST be declared on all properties.
+      The var keyword MUST NOT be used to declare a property.
+      There MUST NOT be more than one property declared per statement.
+      Property names SHOULD NOT be prefixed with a single underscore to indicate protected or private visibility. -->
+ <rule ref="PSR2.Classes.PropertyDeclaration"/>
+
+ <!-- When present, there MUST be one blank line after the namespace declaration. -->
+ <rule ref="PSR2.Namespaces.NamespaceDeclaration"/>
+
+ <!-- When present, all use declarations MUST go after the namespace declaration.
+      There MUST be one use keyword per declaration.
+      There MUST be one blank line after the use block. -->
+ <rule ref="PSR2.Namespaces.UseDeclaration"/>
+</ruleset>
Index: contrib/phpcs/Observium/Sniffs/NamingConventions/ValidVariableNameSniff.php
===================================================================
--- contrib/phpcs/Observium/Sniffs/NamingConventions/ValidVariableNameSniff.php	(revision 0)
+++ contrib/phpcs/Observium/Sniffs/NamingConventions/ValidVariableNameSniff.php	(revision 0)
@@ -0,0 +1,262 @@
+<?php
+
+if (class_exists('PHP_CodeSniffer_Standards_AbstractVariableSniff', true) === false) {
+    throw new PHP_CodeSniffer_Exception('Class PHP_CodeSniffer_Standards_AbstractVariableSniff not found');
+}
+
+/**
+ * Observium_Sniffs_NamingConventions_ValidVariableNameSniff.
+ *
+ * Checks the naming of variables and member variables.
+ *
+ * Copied from Squiz_Sniffs_NamingConventions_ValidVariableNameSniff and customized
+ */
+class Observium_Sniffs_NamingConventions_ValidVariableNameSniff extends PHP_CodeSniffer_Standards_AbstractVariableSniff
+{
+
+    /**
+     * Tokens to ignore so that we can find a DOUBLE_COLON.
+     *
+     * @var array
+     */
+    private $_ignore = array(
+                        T_WHITESPACE,
+                        T_COMMENT,
+                       );
+
+
+    /**
+     * Returns true is the specified string is in the underscore lowercase format.
+     *
+     * @param string $string The string to verify.
+     *
+     * @return boolean
+     */
+    private static function isUnderscoreLowerName($string)
+    {
+        // If there is a space in the name, it can't be valid.
+        if (strpos($string, ' ') !== false) {
+            return false;
+        }
+
+        $validName = true;
+
+        if (preg_match('|^[a-z]|', $string) === 0) {
+            // Name does not being with a lowercase letter.
+            $validName = false;
+        } elseif (preg_match('|[A-Z]|', $string) !== 0) {
+            // Name contains uppercase letter.
+            $validName = false;
+        } else {
+            $nameBits = explode('_', $string);
+
+            foreach ($nameBits as $bit) {
+                if ($bit === '') {
+                    continue;
+                }
+
+                if ($bit{0} !== strtolower($bit{0})) {
+                    $validName = $false;
+                    break;
+                }
+            }
+        }
+
+        return $validName;
+    }//end isUnderscoreLowerName()
+
+
+    /**
+     * Processes this test, when one of its tokens is encountered.
+     *
+     * @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
+     * @param int                  $stackPtr  The position of the current token in the
+     *                                        stack passed in $tokens.
+     *
+     * @return void
+     */
+    protected function processVariable(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
+    {
+        $tokens  = $phpcsFile->getTokens();
+        $varName = ltrim($tokens[$stackPtr]['content'], '$');
+
+        $phpReservedVars = array(
+                            '_SERVER',
+                            '_GET',
+                            '_POST',
+                            '_REQUEST',
+                            '_SESSION',
+                            '_ENV',
+                            '_COOKIE',
+                            '_FILES',
+                            'GLOBALS',
+                           );
+
+        // If it's a php reserved var, then its ok.
+        if (in_array($varName, $phpReservedVars) === true) {
+            return;
+        }
+
+        $objOperator = $phpcsFile->findNext(array(T_WHITESPACE), ($stackPtr + 1), null, true);
+        if ($tokens[$objOperator]['code'] === T_OBJECT_OPERATOR) {
+            // Check to see if we are using a variable from an object.
+            $var = $phpcsFile->findNext(array(T_WHITESPACE), ($objOperator + 1), null, true);
+            if ($tokens[$var]['code'] === T_STRING) {
+                $bracket = $objOperator = $phpcsFile->findNext(array(T_WHITESPACE), ($var + 1), null, true);
+                if ($tokens[$bracket]['code'] !== T_OPEN_PARENTHESIS) {
+                    $objVarName = $tokens[$var]['content'];
+
+                    // There is no way for us to know if the var is public or private,
+                    // so we have to ignore a leading underscore if there is one and just
+                    // check the main part of the variable name.
+                    $originalVarName = $objVarName;
+                    if (substr($objVarName, 0, 1) === '_') {
+                        $objVarName = substr($objVarName, 1);
+                    }
+
+                    if ($this->isUnderscoreLowerName($objVarName) === false) {
+                        $error = 'Variable "%s" is not in valid lowercase underscore naming format';
+                        $data  = array($originalVarName);
+                        $phpcsFile->addError($error, $var, 'NotUnderscoreLowerName', $data);
+                    }
+                }//end if
+            }//end if
+        }//end if
+
+        // There is no way for us to know if the var is public or private,
+        // so we have to ignore a leading underscore if there is one and just
+        // check the main part of the variable name.
+        $originalVarName = $varName;
+        if (substr($varName, 0, 1) === '_') {
+            $objOperator = $phpcsFile->findPrevious(array(T_WHITESPACE), ($stackPtr - 1), null, true);
+            if ($tokens[$objOperator]['code'] === T_DOUBLE_COLON) {
+                // The variable lives within a class, and is referenced like
+                // this: MyClass::$_variable, so we don't know its scope.
+                $inClass = true;
+            } else {
+                $inClass = $phpcsFile->hasCondition($stackPtr, array(T_CLASS, T_INTERFACE));
+            }
+
+            if ($inClass === true) {
+                $varName = substr($varName, 1);
+            }
+        }
+
+        if ($this->isUnderscoreLowerName($varName) === false) {
+            $error = 'Variable "%s" is not in valid lowercase underscore naming format';
+            $data  = array($originalVarName);
+            $phpcsFile->addError($error, $stackPtr, 'NotUnderscoreLowerName', $data);
+        }
+
+    }//end processVariable()
+
+
+    /**
+     * Processes class member variables.
+     *
+     * @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
+     * @param int                  $stackPtr  The position of the current token in the
+     *                                        stack passed in $tokens.
+     *
+     * @return void
+     */
+    protected function processMemberVar(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
+    {
+        $tokens = $phpcsFile->getTokens();
+
+        $varName     = ltrim($tokens[$stackPtr]['content'], '$');
+        $memberProps = $phpcsFile->getMemberProperties($stackPtr);
+        if (empty($memberProps) === true) {
+            // Couldn't get any info about this variable, which
+            // generally means it is invalid or possibly has a parse
+            // error. Any errors will be reported by the core, so
+            // we can ignore it.
+            return;
+        }
+
+        $public    = ($memberProps['scope'] !== 'private');
+        $errorData = array($varName);
+
+        if ($public === true) {
+            if (substr($varName, 0, 1) === '_') {
+                $error = '%s member variable "%s" must not contain a leading underscore';
+                $data  = array(
+                          ucfirst($memberProps['scope']),
+                          $errorData[0],
+                         );
+                $phpcsFile->addError($error, $stackPtr, 'PublicHasUnderscore', $data);
+                return;
+            }
+        } else {
+            if (substr($varName, 0, 1) !== '_') {
+                $error = 'Private member variable "%s" must contain a leading underscore';
+                $phpcsFile->addError($error, $stackPtr, 'PrivateNoUnderscore', $errorData);
+                return;
+            }
+        }
+
+        if ($this->isUnderscoreLowerName($varName) === false) {
+            $error = 'Variable "%s" is not in valid lowercase underscore naming format';
+            $phpcsFile->addError($error, $stackPtr, 'MemberNotUnderscoreLowerName', $errorData);
+        }
+
+    }//end processMemberVar()
+
+
+    /**
+     * Processes the variable found within a double quoted string.
+     *
+     * @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
+     * @param int                  $stackPtr  The position of the double quoted
+     *                                        string.
+     *
+     * @return void
+     */
+    protected function processVariableInString(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
+    {
+        $tokens = $phpcsFile->getTokens();
+
+        $phpReservedVars = array(
+                            '_SERVER',
+                            '_GET',
+                            '_POST',
+                            '_REQUEST',
+                            '_SESSION',
+                            '_ENV',
+                            '_COOKIE',
+                            '_FILES',
+                            'GLOBALS',
+                           );
+        if (preg_match_all('|[^\\\]\${?([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)|', $tokens[$stackPtr]['content'], $matches) !== 0) {
+            foreach ($matches[1] as $varName) {
+                // If it's a php reserved var, then its ok.
+                if (in_array($varName, $phpReservedVars) === true) {
+                    continue;
+                }
+
+                // There is no way for us to know if the var is public or private,
+                // so we have to ignore a leading underscore if there is one and just
+                // check the main part of the variable name.
+                $originalVarName = $varName;
+                if (substr($varName, 0, 1) === '_') {
+                    if ($phpcsFile->hasCondition($stackPtr, array(T_CLASS, T_INTERFACE)) === true) {
+                        $varName = substr($varName, 1);
+                    }
+                }
+
+                if ($this->isUnderscoreLowerName($varName) === false) {
+                    $varName = $matches[0];
+                    $error = 'Variable "%s" is not in valid lowercase underscore naming format';
+                    $data  = array($originalVarName);
+                    $phpcsFile->addError($error, $stackPtr, 'StringNotUnderscoreLowerName', $data);
+                    
+                }
+            }
+        }//end if
+
+    }//end processVariableInString()
+
+
+}//end class
+
+?>
Index: contrib/phpcs/Observium/Sniffs/NamingConventions/ValidFunctionNameSniff.php
===================================================================
--- contrib/phpcs/Observium/Sniffs/NamingConventions/ValidFunctionNameSniff.php	(revision 0)
+++ contrib/phpcs/Observium/Sniffs/NamingConventions/ValidFunctionNameSniff.php	(revision 0)
@@ -0,0 +1,94 @@
+<?php
+
+if (class_exists('PEAR_Sniffs_NamingConventions_ValidFunctionNameSniff', true) === false) {
+    throw new PHP_CodeSniffer_Exception('Class PEAR_Sniffs_NamingConventions_ValidFunctionNameSniff not found');
+}
+
+/**
+ * Observium_Sniffs_NamingConventions_ValidFunctionNameSniff.
+ *
+ * Ensures method names are correct depending on whether they are public
+ * or private, and that functions are named correctly.
+ *
+ * Copied from Squiz_Sniffs_NamingConventions_ValidFunctionNameSniff and customized
+ */
+class Observium_Sniffs_NamingConventions_ValidFunctionNameSniff extends PEAR_Sniffs_NamingConventions_ValidFunctionNameSniff
+{
+
+    /**
+     * Returns true is the specified string is in the underscore lowercase format.
+     *
+     * @param string $string The string to verify.
+     *
+     * @return boolean
+     */
+    private static function isUnderscoreLowerName($string)
+    {
+        // If there is a space in the name, it can't be valid.
+        if (strpos($string, ' ') !== false) {
+            return false;
+        }
+
+        $validName = true;
+
+        if (preg_match('|^[a-z]|', $string) === 0) {
+            // Name does not being with a lowercase letter.
+            $validName = false;
+        } elseif (preg_match('|[A-Z]|', $string) !== 0) {
+            // Name contains uppercase letter.
+            $validName = false;
+        } else {
+            $nameBits = explode('_', $string);
+
+            foreach ($nameBits as $bit) {
+                if ($bit === '') {
+                    continue;
+                }
+
+                if ($bit{0} !== strtolower($bit{0})) {
+                    $validName = $false;
+                    break;
+                }
+            }
+        }
+
+        return $validName;
+    }//end isUnderscoreLowerName()
+
+
+    /**
+     * Processes the tokens outside the scope.
+     *
+     * @param PHP_CodeSniffer_File $phpcsFile The file being processed.
+     * @param int                  $stackPtr  The position where this token was
+     *                                        found.
+     *
+     * @return void
+     */
+    protected function processTokenOutsideScope(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
+    {
+        $functionName = $phpcsFile->getDeclarationName($stackPtr);
+        if ($functionName === null) {
+            return;
+        }
+
+        $errorData = array($functionName);
+
+        // Does this function claim to be magical?
+        if (preg_match('|^__|', $functionName) !== 0) {
+            $error = 'Function name "%s" is invalid; only PHP magic methods should be prefixed with a double underscore';
+            $phpcsFile->addError($error, $stackPtr, 'DoubleUnderscore', $errorData);
+            return;
+        }
+
+        if ($this->isUnderscoreLowerName($functionName) === false) {
+            $error = 'Function name "%s" is not in underscore naming format';
+            $phpcsFile->addError($error, $stackPtr, 'NotUnderscoreLowerName', $errorData);
+        }
+
+    }//end processTokenOutsideScope()
+
+
+}//end class
+
+?>
Index: contrib/phpcs/Observium/Sniffs/ControlStructures/ControlSignatureSniff.php
===================================================================
--- contrib/phpcs/Observium/Sniffs/ControlStructures/ControlSignatureSniff.php	(revision 0)
+++ contrib/phpcs/Observium/Sniffs/ControlStructures/ControlSignatureSniff.php	(revision 0)
@@ -0,0 +1,46 @@
+<?php
+
+/**
+ * Verifies that control statements conform to their coding standards.
+ *
+ * Copied from Squiz_Sniffs_ControlStructures_ControlSignatureSniff and customized
+ */
+class Observium_Sniffs_ControlStructures_ControlSignatureSniff extends PHP_CodeSniffer_Standards_AbstractPatternSniff
+{
+
+    /**
+     * A list of tokenizers this sniff supports.
+     *
+     * @var array
+     */
+    public $supportedTokenizers = array(
+                                   'PHP',
+                                   'JS',
+                                  );
+
+
+    /**
+     * Returns the patterns that this test wishes to verify.
+     *
+     * @return array(string)
+     */
+    protected function getPatterns()
+    {
+        return array(
+                'try {EOL...}EOL\s*catch (...)EOL\s*{EOL',
+                'doEOL\s*{...} while (...);EOL',
+                'while (...)EOL\s*{EOL',
+                'for (...)EOL\s*{EOL',
+                'if (...)EOL\s*{EOL',
+                'foreach (...)EOL\s*{EOL',
+                '}EOL\s*else if (...)EOL\s*{EOL',
+                '}EOL\s*elseif (...)EOL\s*{EOL',
+                '}EOL\s*elseEOL\s+{EOL',
+               );
+
+    }//end getPatterns()
+
+
+}//end class
+
+?>
Index: contrib/phpcs/Observium/Sniffs/PHP/EchoSniff.php
===================================================================
--- contrib/phpcs/Observium/Sniffs/PHP/EchoSniff.php	(revision 0)
+++ contrib/phpcs/Observium/Sniffs/PHP/EchoSniff.php	(revision 0)
@@ -0,0 +1,50 @@
+<?php
+/**
+ * Observium_Sniffs_PHP_EchoSniff.
+ *
+ * The use of echo() is discouraged.
+ *
+ * Copied from Squiz_Sniffs_PHP_EvalSniff and customized
+ */
+class Observium_Sniffs_PHP_EchoSniff implements PHP_CodeSniffer_Sniff
+{
+
+
+    /**
+     * Returns an array of tokens this test wants to listen for.
+     *
+     * @return array
+     */
+    public function register()
+    {
+        return array(T_ECHO);
+
+    }//end register()
+
+
+    /**
+     * Processes this test, when one of its tokens is encountered.
+     *
+     * @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
+     * @param int                  $stackPtr  The position of the current token in
+     *                                        the stack passed in $tokens.
+     *
+     * @return void
+     */
+    public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
+    {
+        $tokens = $phpcsFile->getTokens();
+
+        $openingBracket = $phpcsFile->findNext(PHP_CodeSniffer_tokens::$emptyTokens, ($stackPtr+1), null, true);
+
+        if ($tokens[$openingBracket]['code'] !== T_OPEN_PARENTHESIS) {
+            $error = 'Echo called without parentheses';
+            $phpcsFile->addError($error, $stackPtr, 'NoParentheses');
+            return;
+        }
+    }//end process()
+
+
+}//end class
+
+?>
Index: contrib/phpcs/Observium/Sniffs/Functions/FunctionCallSignatureSniff.php
===================================================================
--- contrib/phpcs/Observium/Sniffs/Functions/FunctionCallSignatureSniff.php	(revision 0)
+++ contrib/phpcs/Observium/Sniffs/Functions/FunctionCallSignatureSniff.php	(revision 0)
@@ -0,0 +1,305 @@
+<?php
+/**
+ * Observium_Sniffs_Functions_FunctionCallSignatureSniff.
+ *
+ * Copied from PEAR_Sniffs_Functions_FunctionCallSignatureSniff and customized
+ */
+
+class Observium_Sniffs_Functions_FunctionCallSignatureSniff implements PHP_CodeSniffer_Sniff
+{
+
+    /**
+     * The number of spaces code should be indented.
+     *
+     * @var int
+     */
+    public $indent = 2;
+
+    /**
+     * If TRUE, multiple arguments can be defined per line in a multi-line call.
+     *
+     * @var bool
+     */
+    public $allowMultipleArguments = true;
+
+
+    /**
+     * If TRUE, the first argument(s) in a multi-line call can begin on the same line as the call.
+     *
+     * @var bool
+     */
+    public $allowSameLineOpening = true;
+
+    /**
+     * If TRUE, the closing parenthesis in a multi-line call can be on the same line as the last argument(s).
+     *
+     * @var bool
+     */
+    public $allowSameLineClosing = true;
+
+
+    /**
+     * Returns an array of tokens this test wants to listen for.
+     *
+     * @return array
+     */
+    public function register()
+    {
+        return array(T_STRING);
+
+    }//end register()
+
+
+    /**
+     * Processes this test, when one of its tokens is encountered.
+     *
+     * @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
+     * @param int                  $stackPtr  The position of the current token
+     *                                        in the stack passed in $tokens.
+     *
+     * @return void
+     */
+    public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
+    {
+        $tokens = $phpcsFile->getTokens();
+
+        // Find the next non-empty token.
+        $openBracket = $phpcsFile->findNext(PHP_CodeSniffer_Tokens::$emptyTokens, ($stackPtr + 1), null, true);
+
+        if ($tokens[$openBracket]['code'] !== T_OPEN_PARENTHESIS) {
+            // Not a function call.
+            return;
+        }
+
+        if (isset($tokens[$openBracket]['parenthesis_closer']) === false) {
+            // Not a function call.
+            return;
+        }
+
+        // Find the previous non-empty token.
+        $search   = PHP_CodeSniffer_Tokens::$emptyTokens;
+        $search[] = T_BITWISE_AND;
+        $previous = $phpcsFile->findPrevious($search, ($stackPtr - 1), null, true);
+        if ($tokens[$previous]['code'] === T_FUNCTION) {
+            // It's a function definition, not a function call.
+            return;
+        }
+
+        $closeBracket = $tokens[$openBracket]['parenthesis_closer'];
+
+        if (($stackPtr + 1) !== $openBracket) {
+            // Checking this: $value = my_function[*](...).
+            $error = 'Space before opening parenthesis of function call prohibited';
+            $phpcsFile->addError($error, $stackPtr, 'SpaceBeforeOpenBracket');
+        }
+
+        $next = $phpcsFile->findNext(T_WHITESPACE, ($closeBracket + 1), null, true);
+        if ($tokens[$next]['code'] === T_SEMICOLON) {
+            if (in_array($tokens[($closeBracket + 1)]['code'], PHP_CodeSniffer_Tokens::$emptyTokens) === true) {
+                $error = 'Space after closing parenthesis of function call prohibited';
+                $phpcsFile->addError($error, $closeBracket, 'SpaceAfterCloseBracket');
+            }
+        }
+
+        // Check if this is a single line or multi-line function call.
+        if ($tokens[$openBracket]['line'] === $tokens[$closeBracket]['line']) {
+            $this->processSingleLineCall($phpcsFile, $stackPtr, $openBracket, $tokens);
+        } else {
+            $this->processMultiLineCall($phpcsFile, $stackPtr, $openBracket, $tokens);
+        }
+
+    }//end process()
+
+
+    /**
+     * Processes single-line calls.
+     *
+     * @param PHP_CodeSniffer_File $phpcsFile   The file being scanned.
+     * @param int                  $stackPtr    The position of the current token
+     *                                          in the stack passed in $tokens.
+     * @param int                  $openBracket The position of the opening bracket
+     *                                          in the stack passed in $tokens.
+     * @param array                $tokens      The stack of tokens that make up
+     *                                          the file.
+     *
+     * @return void
+     */
+    public function processSingleLineCall(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $openBracket, $tokens)
+    {
+        if ($tokens[($openBracket + 1)]['code'] === T_WHITESPACE) {
+            // Checking this: $value = my_function([*]...).
+            $error = 'Space after opening parenthesis of function call prohibited';
+            $phpcsFile->addError($error, $stackPtr, 'SpaceAfterOpenBracket');
+        }
+
+        $closer = $tokens[$openBracket]['parenthesis_closer'];
+
+        if ($tokens[($closer - 1)]['code'] === T_WHITESPACE) {
+            // Checking this: $value = my_function(...[*]).
+            $between = $phpcsFile->findNext(T_WHITESPACE, ($openBracket + 1), null, true);
+
+            // Only throw an error if there is some content between the parenthesis.
+            // i.e., Checking for this: $value = my_function().
+            // If there is no content, then we would have thrown an error in the
+            // previous IF statement because it would look like this:
+            // $value = my_function( ).
+            if ($between !== $closer) {
+                $error = 'Space before closing parenthesis of function call prohibited';
+                $phpcsFile->addError($error, $closer, 'SpaceBeforeCloseBracket');
+            }
+        }
+
+    }//end processSingleLineCall()
+
+
+    /**
+     * Processes multi-line calls.
+     *
+     * @param PHP_CodeSniffer_File $phpcsFile   The file being scanned.
+     * @param int                  $stackPtr    The position of the current token
+     *                                          in the stack passed in $tokens.
+     * @param int                  $openBracket The position of the openning bracket
+     *                                          in the stack passed in $tokens.
+     * @param array                $tokens      The stack of tokens that make up
+     *                                          the file.
+     *
+     * @return void
+     */
+    public function processMultiLineCall(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $openBracket, $tokens)
+    {
+        // We need to work out how far indented the function
+        // call itself is, so we can work out how far to
+        // indent the arguments.
+        $functionIndent = 0;
+        for ($i = ($stackPtr - 1); $i >= 0; $i--) {
+            if ($tokens[$i]['line'] !== $tokens[$stackPtr]['line']) {
+                $i++;
+                break;
+            }
+        }
+
+        if ($tokens[$i]['code'] === T_WHITESPACE) {
+            $functionIndent = strlen($tokens[$i]['content']);
+        }
+
+        // Each line between the parenthesis should be indented n spaces.
+        $closeBracket = $tokens[$openBracket]['parenthesis_closer'];
+        $lastLine     = $tokens[$openBracket]['line'];
+        for ($i = ($openBracket + 1); $i < $closeBracket; $i++) {
+            // Skip nested function calls.
+            if ($tokens[$i]['code'] === T_OPEN_PARENTHESIS) {
+                $i        = $tokens[$i]['parenthesis_closer'];
+                $lastLine = $tokens[$i]['line'];
+                continue;
+            }
+
+            if ($tokens[$i]['line'] !== $lastLine) {
+                $lastLine = $tokens[$i]['line'];
+
+                // Ignore heredoc indentation.
+                if (in_array($tokens[$i]['code'], PHP_CodeSniffer_Tokens::$heredocTokens) === true) {
+                    continue;
+                }
+
+                // Ignore multi-line string indentation.
+                if (in_array($tokens[$i]['code'], PHP_CodeSniffer_Tokens::$stringTokens) === true) {
+                    if ($tokens[$i]['code'] === $tokens[($i - 1)]['code']) {
+                        continue;
+                    }
+                }
+
+                // We changed lines, so this should be a whitespace indent token, but first make
+                // sure it isn't a blank line because we don't need to check indent unless there
+                // is actually some code to indent.
+                if ($tokens[$i]['code'] === T_WHITESPACE) {
+                    $nextCode = $phpcsFile->findNext(T_WHITESPACE, ($i + 1), ($closeBracket + 1), true);
+                    if ($tokens[$nextCode]['line'] !== $lastLine) {
+                        $error = 'Empty lines are not allowed in multi-line function calls';
+                        $phpcsFile->addError($error, $i, 'EmptyLine');
+                        continue;
+                    }
+                } else {
+                    $nextCode = $i;
+                }
+
+                // Check if the next line contains an object operator, if so rely on
+                // the ObjectOperatorIndentSniff to test the indent.
+                if ($tokens[$nextCode]['type'] === 'T_OBJECT_OPERATOR') {
+                    continue;
+                }
+
+                if ($nextCode === $closeBracket) {
+                    // Closing brace needs to be indented to the same level
+                    // as the function call.
+                    $expectedIndent = $functionIndent;
+                } else {
+                    $expectedIndent = ($functionIndent + $this->indent);
+                }
+
+                if ($tokens[$i]['code'] !== T_WHITESPACE) {
+                    // Just check if it is a multi-line block comment. If so, we can
+                    // calculate the indent from the whitespace before the content.
+                    if ($tokens[$i]['code'] === T_COMMENT
+                        && $tokens[($i - 1)]['code'] === T_COMMENT
+                    ) {
+                        $trimmed     = ltrim($tokens[$i]['content']);
+                        $foundIndent = (strlen($tokens[$i]['content']) - strlen($trimmed));
+                    } else {
+                        $foundIndent = 0;
+                    }
+                } else {
+                    $foundIndent = strlen($tokens[$i]['content']);
+                }
+
+                if ($expectedIndent !== $foundIndent) {
+                    $error = 'Multi-line function call not indented correctly; expected %s spaces but found %s';
+                    $data  = array(
+                              $expectedIndent,
+                              $foundIndent,
+                             );
+                    $phpcsFile->addError($error, $i, 'Indent', $data);
+                }
+            }//end if
+
+            // Skip the rest of a closure.
+            if ($tokens[$i]['code'] === T_CLOSURE) {
+                $i        = $tokens[$i]['scope_closer'];
+                $lastLine = $tokens[$i]['line'];
+                continue;
+            }
+
+            // Skip the rest of a short array.
+            if ($tokens[$i]['code'] === T_OPEN_SHORT_ARRAY) {
+                $i        = $tokens[$i]['bracket_closer'];
+                $lastLine = $tokens[$i]['line'];
+                continue;
+            }
+
+            if ($this->allowMultipleArguments === false && $tokens[$i]['code'] === T_COMMA) {
+                // Comma has to be the last token on the line.
+                $next = $phpcsFile->findNext(array(T_WHITESPACE, T_COMMENT), ($i + 1), $closeBracket, true);
+                if ($next !== false
+                    && $tokens[$i]['line'] === $tokens[$next]['line']
+                ) {
+                    $error = 'Only one argument is allowed per line in a multi-line function call';
+                    $phpcsFile->addError($error, $next, 'MultipleArguments');
+                }
+            }
+        }//end for
+
+        if ($this->allowSameLineOpening === false && $tokens[($openBracket + 1)]['content'] !== $phpcsFile->eolChar) {
+            $error = 'Opening parenthesis of a multi-line function call must be the last content on the line';
+            $phpcsFile->addError($error, $stackPtr, 'ContentAfterOpenBracket');
+        }
+
+        $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($closeBracket - 1), null, true);
+        if ($this->allowSameLineClosing === false && $tokens[$prev]['line'] === $tokens[$closeBracket]['line']) {
+            $error = 'Closing parenthesis of a multi-line function call must be on a line by itself';
+            $phpcsFile->addError($error, $closeBracket, 'CloseBracketLine');
+        }
+
+    }//end processMultiLineCall()
+
+
+}//end class
+?>