Skip to content
Permalink
Browse files

Adapted to less strict rules for Digital Peak

  • Loading branch information...
laoneo committed Nov 7, 2013
1 parent ab70fb6 commit 308e348dd66125ab3cca2addd2b259e009b67f12
@@ -39,6 +39,8 @@ public function register()
*/
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
// Not neccessary for Digital Peak
return;
$tokens = $phpcsFile->getTokens();
$running = true;
@@ -142,6 +142,8 @@ public function register()
*/
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
// Not neccessary for Digital Peak
return;
$this->currentFile = $phpcsFile;
$tokens = $phpcsFile->getTokens();
@@ -679,10 +679,14 @@ protected function processAuthors($commentStart)
// Dot character cannot be the first or last character
// in the local-part.
$localMiddle = $local.'.\w';
if (preg_match('/^([^<]*)\s+<(['.$local.']['.$localMiddle.']*['.$local.']@[\da-zA-Z][-.\w]*[\da-zA-Z]\.[a-zA-Z]{2,7})>$/', $content) === 0) {
$error = 'Content of the @author tag must be in the form "Display Name <username@example.com>"';
$this->currentFile->addError($error, $errorPos, 'InvalidAuthors');
}
/*
Not neccessary for Digital Peak
if (preg_match('/^([^<]*)\s+<(['.$local.']['.$localMiddle.']*['.$local.']@[\da-zA-Z][-.\w]*[\da-zA-Z]\.[a-zA-Z]{2,7})>$/', $content) === 0) {
$error = 'Content of the @author tag must be in the form "Display Name <username@example.com>"';
$this->currentFile->addError($error, $errorPos, 'InvalidAuthors');
}
*/
} else {
$error = 'Content missing for @author tag in %s comment';
$docBlock = (get_class($this) === 'PEAR_Sniffs_Commenting_FileCommentSniff') ? 'file' : 'class';
@@ -107,6 +107,9 @@ public function register()
*/
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
// Not neccessary for Digital Peak
return;
$find = array(
T_COMMENT,
T_DOC_COMMENT,
@@ -56,6 +56,10 @@ public function register()
*/
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
// Not neccessary for Digital Peak
return;
$tokens = $phpcsFile->getTokens();
$nextNonWhiteSpace = $phpcsFile->findNext(
@@ -91,11 +91,14 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
if ($tokens[$stackPtr]['line'] - 1 == $tokens[$previousSemicolon]['line'])
{
/*
Not neccessary for Digital Peak
$error = sprintf('Please consider an empty line before the %s statement;',
$tokens[$stackPtr]['content']
);
$phpcsFile->addError($error, $stackPtr, 'SpaceBefore');
*/
return;
}
@@ -82,11 +82,14 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
$firstContent = $phpcsFile->findNext(T_WHITESPACE, ($scopeOpener + 1), null, true);
/*
Not neccessary for Digital Peak
if ($tokens[$firstContent]['line'] !== ($tokens[$scopeOpener]['line'] + 1))
{
$error = 'Blank line found at start of control structure';
$phpcsFile->addError($error, $scopeOpener);
}
*/
$lastContent = $phpcsFile->findPrevious(T_WHITESPACE, ($scopeCloser - 1), null, true);
@@ -175,6 +178,9 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
}
else
{
/*
Not neccessary for Digital Peak
if ($tokens[$trailingContent]['line'] === ($tokens[$scopeCloser]['line'] + 1))
{
// T_ELSE
@@ -188,6 +194,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
$phpcsFile->addError($error, $scopeCloser);
}
}
*/
}
}
}
@@ -35,7 +35,6 @@
<rule ref="PEAR.Classes.ClassDeclaration" />
<rule ref="PEAR.Commenting.InlineComment" />
<rule ref="PEAR.Formatting.MultiLineAssignment" />
<rule ref="PEAR.Functions.ValidDefaultValue" />
<rule ref="PEAR.NamingConventions.ValidClassName" />

<!-- Include some additional sniffs from the Squiz standard -->
@@ -51,7 +50,6 @@
<exclude name="Squiz.Operators.IncrementDecrementUsage.processAssignment" />
</rule>
<rule ref="Squiz.Scope.StaticThisUsage" />
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace" />

<!-- Include some additional sniffs from the Zend standard -->
<rule ref="Zend.Files.ClosingTag" />

0 comments on commit 308e348

Please sign in to comment.
You can’t perform that action at this time.